Post

Replies

Boosts

Views

Activity

StoreKit Configuration File: Auto-Renewable Subscriptions Suddenly Stop Working in StoreKit Testing Environment After Awhile
I'm currently using a StoreKit configuration file to test auto renewable subscriptions. On my device I am subscribed to subscription with a duration set to weekly. The subscription renewal rate is set to "Monthly Renewal Every 15 Minutes." This all works fine for awhile. The subscription auto renews. But after a few hours suddenly my app detects that the subscription has expired and the app UI behaves accordingly. My app does the following: Looks at the in app purchase receipts and finds the one with the latest expiration date. If the current date is later than the expiration date of this receipt my app acts like the subscription has expired. I even add a bit of extra time on the expiration date in case an auto renewable transaction gets held up (in the debug environment I add a couple hours). I don't take any interaction to cancel the subscription in the "Manage StoreKit Transactions" area of Xcode, nor do I do anything programmatically to cancel the subscription. Autorenew just stops working. I noticed this happens when the in app purchase receipt count is high (currently it is at 1776 in app purchase receipts). So I'm wondering if this is a bug in the StoreKit configuration environment that happens when auto renewing subscriptions causes the in app purchase receipts to grow large and it just quits auto renewing the subscription? If I navigate to the area in my user interface and resubscribe to the weekly plan it works again for awhile. The issue then will reoccur after a few hours again, forcing me to "resubscribe" to the plan I've never unsubscribed for. Is StoreKit testing discarding in app purchase receipts when the receipt gets large but instead of discarding the oldest receipt it removes the in app purchase receipt that is not yet expired, thus forcing me to resubscribe? Anyone else experience this issue with StoreKit testing? Seems like it's an issue with the testing environment but naturally can't be sure.
1
0
1.8k
May ’22
UITableview content overlaps translucent nav bar when scrolled on iOS 13
So, a UItableview inside a *regular* UIViewController (not using UITableviewcontroller).1) This view controller is embedded in a UINavigationController. The navigation item has "automatic' large title mode.2) The navigation controller's nav bar prefers large title.3) When the table view is scrolled, the big title does *not* shrink to the *regular* title size like in the iOS mail app. Instead, the table view content overlaps the navbar and bleeds through, making a UI glitch.On iOS 12 the scrolled content does not overlap the nav bar. This is new in IOS 13. Anyone get this and have a workaround?
Topic: UI Frameworks SubTopic: UIKit Tags:
7
0
5.4k
May ’22
UINavigationController's interactivePopGestureRecognizer sometimes causes the popped view controller to never be released (memory leak)
I notice if I pop a view controller off a UINavigationController's navigation stack using the interactivePopGestureRecognizer, every so often the view controller being popped off is not being released from memory. Haven't been able to come up with a workaround or determine anything that seems to make the issue reproduce reliably. I simply log out dealloc in the view controller that is going to be popped. Push and pop a few times and notice that dealloc doesn't log out after it is being popped off. Not sure if something in the UI (other animation) that is interrupting the pop gesture's _UINavigationInteractiveTransition ... I haven't been able to track down what is retaining my view controller. When the issue happens I can see it is still in memory (I have it listen to UISceneWillEnterForegroundNotification and I put the scene in the background then move it to the foreground and hit a breakpoint). But...I can't seem to figure out what is strongly retaining the view controller. From he debugger I start setting view controller properties to nil to see if I can break a potential retain cycle I created) but no luck. I'm only able to reproduce the memory leak when I dismiss the view controller with the interactive pop gesture (not the back button). I know that's not a lot to go on but am wondering if someone has experience anything similar and has a potential workaround?
Topic: UI Frameworks SubTopic: UIKit Tags:
4
0
986
Jun ’22
Run CloudKit App Using the Production Environment From Xcode?
I'm getting ready to release a new app that uses CloudKit. I just deployed my Development schema to Production in CloudKit dashboard. Is there a way to run my app from Xcode using the CloudKit Production environment for testing? Details of how to test in the production environment are described here: https://developer.apple.com/library/archive/documentation/DataManagement/Conceptual/CloudKitQuickStart/TestingYourApp/TestingYourApp.html But would be faster (and easier for debugging potential issues) if I could select tell Xcode to use the production environment when running from the debugger. Is this supported? Thanks
5
0
2.2k
Jun ’22
Testing Sign Out Events with CloudKit?
I'd like to test how my app behaves when the user signs out of iCloud and my app is in memory. In the iOS Simulator, the "Sign Out" button for iCloud is grayed out so I can't use the simulator to test. I'm hesitant to use a real device tied to my Apple ID because signing out of iCloud System wide has side effects with many apps and I don't want to potentially lose any data. However, I did test on a real device by going the Settings app -> iCloud and disabled iCloud only for my app. When I do this, the system terminates my app and does not post a CKAccountChangedNotification. I only tested turning off the iCloud switch for my app. Does the system simply terminate apps when the user logs out of iCloud system wide too? In what cases is the CKAccountChangedNotification posted? Detecting sign out by listening for CKAccountChangedNotification would seem to be pointless if apps are terminated when the user signs out of iCloud.
0
0
364
Jun ’22
My Mac App Crashing on ARM-64 Devices After Calling NSURL -getResourceValue:forKey: with
I'm getting some Crash Reports for an app of mine that's on the Mac App Store. A few details: -All the crash reports are on ARM-64 Macs. -The call stack shows my app calling NSURL's -getResourceValue:forKey: method with NSURLLocalizedNameKey, which is the last call made by my app before the crash. After that crash logs look like this: **Thread 0 Crashed: 0   libobjc.A.dylib               0x00000001a623c4b0 objc_retain + 16 1   LaunchServices                0x00000001a6954f68 -[FSNode(PathAndName) nameWithError:] + 72 2   LaunchServices                0x00000001a6a36278 +[_LSDisplayNameConstructor(ConstructForAnyFile) displayNameConstructorWithContextIfNeeded:bundle:bundleClass:node:preferredLocalizations:error:] + 2732 3   LaunchServices                0x00000001a6a357ac +[_LSDisplayNameConstructor(ConstructForAnyFile) displayNameConstructorWithContextIfNeeded:node:error:] + 44 4   LaunchServices                0x00000001a6ae5b20 LaunchServices::URLPropertyProvider::getDisplayNameConstructor(LaunchServices::Database::Context&, FSNode*, LaunchServices::URLPropertyProvider::State*, NSError* __autoreleasing*) + 88 5   LaunchServices                0x00000001a6ae1930 LaunchServices::URLPropertyProvider::prepareLocalizedNameValue(LaunchServices::Database::Context&, FSNode*, __FileCache*, __CFString const*, LaunchServices::URLPropertyProvider::State*, NSError* __autoreleasing*) + 328 6   LaunchServices                0x00000001a6953d6c LaunchServices::URLPropertyProvider::prepareValues(__CFURL const*, __FileCache*, __CFString const* const*, void const**, long, void const*, __CFError**) + 456 7   CoreServicesInternal          0x00000001a8def6f0 prepareValuesForBitmap(__CFURL const*, __FileCache*, _FilePropertyBitmap*, __CFError**) + 452 8   CoreServicesInternal          0x00000001a8dec5ec _FSURLCopyResourcePropertyForKeyInternal(__CFURL const*, __CFString const*, void*, void*, __CFError**, unsigned char) + 236 9   CoreFoundation                0x00000001a64546b0 CFURLCopyResourcePropertyForKey + 144 10  CoreFoundation                0x00000001a646b944 -[NSURL getResourceValue:forKey:error:] + 120** -- I haven't been able to reproduce the issue on my ARM-64 Mac. Not sure what's going with _LSDisplayNameConstructor or if there is a way I can workaround/resolve. Some of the crashes have the following lines included: Kernel Triage: VM - Compressor failed a blocking pager_get VM - Compressor failed a blocking pager_get VM - Compressor failed a blocking pager_get VM - Compressor failed a blocking pager_get VM - Compressor failed a blocking pager_get
1
0
779
Jun ’22
Are in-app purchase receipts included in the App Store receipt on initial install on a new device?
I'm working on an app that uses Auto renewable subscriptions. The app uses StoreKit (not StoreKit2). It is pre-release. I was under the assumption that if the user subscribes via in app purchase on Device 1, and then installs the same app on Device 2 (logged in with the same Apple ID) that the receipt on Device 2 would include the in app purchase receipt on initial install, and therefore by inspecting the receipt locally I could determine that showing onboarding UI on Device 2 is not necessary (and all this could be done locally). Is this not true? I just watched the WWDC 2022 session 110404 "Implement proactive in-app purchase restore" which seems to indicate that this is not the case?
4
0
3.2k
Jul ’22
Both ios-x86_64-simulator and ios-arm64-simulator represent two equivalent library definitions. XCFramework for iOS simulator on M1 & Intel Mac? How?
I now have an M1 Mac and an Intel Mac. I have an XCFramework that targets the iOS simulator and devices. My XCFramework works fine but I'd like to be able to run my app (which uses the XCFramework) on the iOS simulator on both my Macs (m1 & intel). Now my M1 Mac complains about the x86_64 architecture when I try to run it on the simulator. So I rebuilt the XCFramework (recompiling the simulator version on the M1 Mac). I'm compiling the source code from Terminal (building OpenSSL). There is no .xcarchive here. Anyway now the app runs on the simulator on the M1 Mac but on the Intel Mac it won't build (basically the same problem in reverse). So... I made three versions of the library now (for iOS devices, iOS simulator on m1 Mac, and for the iOS simulator on Intel Macs). When I try to make an XCFramework to wrap all three static libraries I get the following error: Both "ios-x86_64-simulator" and "ios-arm64-simulator" represent two equivalent library definitions. I found another thread where the accepted answer was to lipo the x86_64 and arm simulators together, then build the xcframework. I've seen posts from Apple engineers that say using lipo is not supported (reference: https://developer.apple.com/forums/thread/709812?answerId=719667022#719667022 ) So where am I going wrong? I try to make the xcframework like so: xcodebuild -create-xcframework -library build/sim/openssl-1.1.1q/libcrypto.a -headers build/sim/openssl-1.1.1q/crypto -library build/phones/openssl-1.1.1q/libcrypto.a -headers build/phones/openssl-1.1.1q/crypto -library build/intelsim/openssl-1.1.1q/libcrypto.a -headers build/intelsim/openssl-1.1.1q/crypto -output build/Crypto.xcframework
3
1
6.7k
Aug ’22
UIActivityViewController closes automatically: SLRemoteComposeViewController: (this may be harmless) viewServiceDidTerminateWithError: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "(null)" UserInfo={Message=Service Connection Interrupted}
Simple UIActivityViewController configured like this:NSArray *activityItems = @[linkURL]; //<--linkURL is an NSURL. UIActivityViewController *activityViewController = [[UIActivityViewController alloc]initWithActivityItems:activityItems applicationActivities:nil];Then I present it:[self presentViewController:activityViewController animated:YES completion:nil];If I select the Mail or Messages activity the activity works as expected. But if I select the "Reminders" or "Notes" activity the view controller for those activities present briefly before automatically dismissing and logging out:: SLRemoteComposeViewController: (this may be harmless) viewServiceDidTerminateWithError: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "(null)" UserInfo={Message=Service Connection Interrupted}Anyone know the potential cause / workaround? The completionWithItemsHandler block does not return me an error.
Topic: UI Frameworks SubTopic: UIKit Tags:
1
0
2.2k
Aug ’22
Is UIBackgroundModes audio required for WKWebView to play audio/airplay etc in the background?
I know WKWebview is in another process from the main app. My question is is the UIBackgroundModes audio entry in Info.plist required on the main app for WKWebview to play audio/video/airplay in the background? Or is simply setting WKWebViewConfiguration allowsAirPlayForMediaPlayback and allowsPictureInPictureMediaPlayback enough? I recall having issues with background audio from WKWebView on older versions of iOS a couple years ago so I added the audio entry to the Info.plist.... but I just removed the key from the Info.plist and background audio from WKWebview seems to be working fine...maybe audio background mode is not required? Or does it only seem to be working because my app is attached to the debugger? Or is this a bug?
1
1
1.4k
Aug ’22
Find & Replace: All properties on UITextSearchOptions are readonly? How am I supposed to use it with UIFindSession?
I'm trying to figure out how I'm suppose to work with this API on UIFindSession: - (void)performSearchWithQuery:(NSString *)query options:(nullable UITextSearchOptions *)options; I want to provide a UITextSearchOptions object, but the properties are readonly so I'm not sure what purpose it serves exposing it in the public API? @interface UITextSearchOptions : NSObject /// See UITextSearchMatchMethod above. @property (nonatomic, readonly) UITextSearchMatchMethod wordMatchMethod; /// Comparison options to use when searching for strings. @property (nonatomic, readonly) NSStringCompareOptions stringCompareOptions; @end So I can't simply invoke a search like this...which would've really been nice...        UIFindSession *session = findInterfaction.activeFindSession;    UITextSearchOptions *searchOptions = [[UITextSearchOptions alloc]init];  searchOptions.stringCompareOptions = NSCaseInsensitiveSearch; //readonly can't...   [session performSearchWithQuery:searchString options:searchOptions]; There is this API: /// available in @c UITextSearchOptions, which can be either modified, augmented, or omitted. @property (nonatomic, readwrite, copy, nullable) UIMenu *_Nullable (^optionsMenuProvider)(NSArray<UIMenuElement *> *defaultOptions); So I can remove menu items that edit the UITextSearchOptions but how exactly do I "override" them for my needs?
Topic: UI Frameworks SubTopic: UIKit Tags:
3
0
452
Sep ’22
Missing or invalid signature. The bundle 'com.firebase.Firebase-nanopb' at bundle path is not signed using an Apple submission certificate
After upgrading to Xcode 14 I cannot submit an update to one of my apps that uses the GoogleMobileAdsSDK. I'm getting the following error when I try to submit to the App Store: Missing or invalid signature. The bundle 'com.firebase.Firebase-nanopb' at bundle path 'Payload/PATH_HERE/nanopb.framework' is not signed using an Apple submission certificate. Anyone else getting this and know of a solution?
1
0
1.1k
Sep ’22
Resize UITargetedPreview as part of custom animation?
I'd like to resize a UITargetedPreview as part of a custom animation. I tried doing this by using the animator provided in: - (void)tableView:(UITableView *)tableView willDisplayContextMenuWithConfiguration:(UIContextMenuConfiguration *)configuration animator:(nullable id<UIContextMenuInteractionCommitAnimating>)animator But resizing the source view for the target preview does not cause the container view to resize with it (leaving a large gap after my custom animation completes). So my preview is wrapped in a visual effects view that doesn't downsize with UITargetedPreview's view I provided. I also tried wrapping a snapshot view in a UIViewController and using previewProvider block instead of using a UITargetPreview. I am able to resize the previewViewController by setting the preferredContentSize property and resizing works, but it still doesn't look right because the default animation for the preview view controller breaks with the custom animation I'm trying to implement. Anyone know if this is possible?
Topic: UI Frameworks SubTopic: UIKit Tags:
0
0
390
Sep ’22
presentedViewController Not set to nil on iOS 16 after dismissal. Calls to -presentViewController:animated:completion: then fail.
Testing my app, I noticed a button in my UI which presents a UIAlertController appeared to do nothing all of a sudden, after a few days. So hooking up the console app I see UIKit spit out the following log when I press the button: "Warning: Attempt to present UIAlertController on MyViewController which is already presenting SomeOtherViewController. No view controller appears to be presented. SomeOtherViewController is not currently in the UI but for some reason after it was dismissed the presentedViewController property wasn't set to nil (haven't been able to reproduce the issue yet). So SomeOtherViewController I know is a "Detail View Controller" which only get pushed on the UINavigationController stack (I never present it modally). The only time it gets presented modally is when it is a "preview view controller" used in UIContextMenuConfiguration, but otherwise it doesn't get presented. Has anyone run into this sort of situation before and know of a potential cause/solution? The presentedViewController does not appear on screen but for some reason UIKit is holding a strong reference to it in the presentedViewController property which prevents subsequent calls to -presentViewController:animated:completion: As a workaround I could try using the code below but I'd really like to find the root cause of the issue: -(void)presentViewController:(UIViewController *)viewControllerToPresent animated:(BOOL)flag completion:(void (^)(void))completion {     UIViewController *currentPresentedVC = self.presentedViewController;     if ([currentPresentedVC isKindOfClass:[SomeOtherViewController class]])     {        //this is unexpected.         [currentPresentedVC dismissViewControllerAnimated:NO completion:^{             [super presentViewController:viewControllerToPresent animated:flag completion:completion];         }];     }     else     {         [super presentViewController:viewControllerToPresent animated:flag completion:completion];     } }
Topic: UI Frameworks SubTopic: UIKit Tags:
0
0
1.4k
Sep ’22