Post

Replies

Boosts

Views

Activity

Battery state notifications, when app is in the background
Does anyone know how battery state notification (UIDevice.batteryStateDidChangeNotification) is supposed to work regarding app foreground/background state? Assume there is no other reason why the app is running in the background. I have enabled UIDevice.current.isBatteryMonitoringEnabled when the app was in the foreground. What should happen if the external power is later connected or removed when the app is in the background? The docs don't mention this. Possibilities include I don't get a notification, so I should check the state myself when the app next comes to the foreground. I'll get a notification when the app next comes to the foreground, if the state changed while it was in the background. The app will be woken up in the background to receive the notification. The app will be kept running in the background while isBatteryMonitoringEnabled is true. It looks as if it's doing either 3 or 4, which I find a bit surprising. But is this influenced by the fact that it's connected (wirelessly) to the debugger?
4
0
132
1w
Why I am seeing "Grace Period" events for my new subscription app?
Dear All, I've recently released a new app with a subscription. It has a 3-day free trial and a 1-year subscription, and I've enabled a grace period of 16 days, but the grace period is enabled only for paid-to-paid renewals. As it's a new app, no-one has reached the end of their subscription yet; there will not have been any paid-to-paid renewals. Yet I see a small number of "enter grace period" and "renewal from grace period" events reported in App Store Connect. Can anyone explain why this could be?
3
1
430
Sep ’24
When is NSMotionUsageDescription shown?
I'm using CMMotionManager startDeviceMotionUpdatesUsingReferenceFrame: CMAttitudeReferenceFrameXTrueNorthZVertical and have set the NSMotionUsageDescription ("Privacy - Motion Usage Description") property in the info.plist. But I don't see a permissions popup. I also don't see any mention of this in the app's section of the Settings app. When is this usage description string used? I wonder if there is some connection between the motion permission and the location permission, which I also use?
5
0
596
Aug ’24
Drag-and-drop from Safari
I am experimenting with drag-and-drop on iPadOS. If I drag a JPEG image from a webpage in Safari to my app, I get items of types public.jpeg and public.url. Typically, the URL is the URL of the image. If, however, the image is itself a link, then the URL seems to be the target of the link. Is there some way that I can always get the URL of the image itself? Is there some way that I can determine whether the URL I have received is the URL of the image or of a link?
0
0
327
Jul ’24
Should I get UIPasteboardChangedNotification when another app changes the clipboard?
Dear Experts, My app is observing UIPasteboardChangeNotification in order to enable/disable its paste button. I do not seem to be getting any notifications when other apps copy to the clipboard. For example, if I have my app and Safari in split-screen on my iPad and I copy something in Safari, I don't see the notification. Similarly if I switch to Safari, copy something, and switch back to my app, I do not get the notification either when I'm in the background or when I return to the foreground. The only time that I see UIPasteboardChangedNotification is when the clipboard is modified by my app itself. Is this supposed to work? Is there some other way to get notified when the clipboard is changed by another app? Thanks.
0
0
262
Jul ’24
PHPickerViewController in Limited Access photos mode
Dear Experts, In "limited access" photos mode, I present a PHPickerViewController. It shows the entire photo library, with a note at the top saying that the app can only access the items that I select. I select a photo. In the delegate method, I get a PHPickerResult containing a plausible-looking string for the assetIdentifier. It's the same string that I get for that photo in "full access" mode. Should this photo now be accessible, or do I need to do something else at this point? When I call fetchAssetsWithLocalIdentifiers using this assetIdentifier, I get no results. When I call cloudIdentifierMappingsForLocalIdentifiers, I get error PHPhotosErrorIdentifierNotFound. In "full access" mode, both work OK. What am I missing? Thanks.
3
0
693
Jul ’24
Acceptable location purpose strings
Does anyone have recent experience of what App Review consider acceptable for location purpose strings these days? My map apps simply display a blue spot on the map showing your current location when you turn on the app's location button. That data doesn't leave the app; I'm not selling it to anyone, or doing anything nefarious. For years, I've had concise location purpose strings such as "Your location will be shown on the map". Now, App Review seem to find that inadequate. They say: "One or more purpose strings in the app do not sufficiently explain the use of protected resources. Purpose strings must clearly and completely describe the app's use of data and, in most cases, provide an example of how the data will be used. Next steps: Update the ... location purpose string to explain how the app will use the requested information and provide an example of how the data will be used. " I've just look at what Apple Maps uses as its purpose string, and it's just "Your location is used to show your position on the map, get directions, estimate travel times, and improve search results." I'm only doing the first of those things, so surely "Your location is used to show your position on the map" would get approved, right? Wrong! I have similar issues with the photos purpose string.
4
1
825
Jun ’24
Does SubscriptionStoreView .storeButton(for:.policies) work?
I've added .storeButton(.visible, for:.policies) to my SubscriptionStoreView, and the buttons do appear, but when I tap on them I get a sheet that just says "Terms of Service Unavailable / Somethng went wrong. Try Again.". (similar for Privacy Policy). Is this expected in development? Will these start working correctly in production? (and, more importantly, in App Review?) The docs say that these use the values (i.e. URLs) set in App Store Connect, but that I can override those. This is a new app. Is that wrong, do I need to set the URLs explicitly? Edited to add: the console reports: Failed to fetch terms of service and privacy policy: Error Domain=NSURLErrorDomain Code=-1011 "(null)"
4
1
610
Jun ’24
Moving the selection handles in UITextSelectionDisplayInteraction
I am attempting to use UITextSelectionDisplayInteraction. It basically works, but I'm unsure how the selection handles are supposed to work. The documentation is minimal and the WWDC video (2023 session 10058) doesn't say much either. As the name suggests, it seems that this interaction only displays the cursor, selection background, and handles. As I change the selection, it updates these views. So if I want the user to be able to drag the selection handles I need to implement that, right? OK, so I add a gesture recognizer to each selection handle. But this doesn't seem to do anything, i.e. the gesture recognizer action never seems to be invoked. Maybe I'm doing something wrong - but I'd like to understand what is supposed to happen. Is adding a pan gesture recognizer to each selection handle the right approach? P.S. I wanted to tag this "WWDC2023-10058", but the per-session tags seem to have disappeared. Is this a forum bug, or deliberate?
0
0
431
May ’24
Does UITextInteraction have a way to dismiss the edit menu?
If I use UIEditMenuInteraction to present an edit menu, it has a dismissMenu method that I can call to remove the menu when necessary. When I use UITextInteraction, I get an edit menu automatically that is normally presented and dismissed at appropriate times. But sometimes I want to dismiss the menu myself, and I can't find a way to do that. Am I missing something? I was hoping to find that UITextInteraction inherited from UIEditMenuInteraction, or had some other way to access the underlying menu in order to dismiss it. But it seems that the menu must be a private part of the UITextInteraction implementation. The particular case that I need to deal with is when I call resignFirstResponder. This seems to cause the keyboard to close and the insertion point and any selection to be hidden, but if an edit menu was shown then it remains visible (a ghost!). If anyone knows of an alternative to resignFirstResponder that will make UITextInteraction tidy up properly, that would also be useful to know. Thanks for any suggestions!
2
0
631
May ’24
DSA compliance phone verification fails
Has anyone successfully completed DSA compliance phone number verification using the "receive a phone call" option? It seems that Apple first tries to send an SMS. You then have the option to resend another SMS, to receive a phone call, or to upload documents. When I choose to receive a phone call, it seems that the Apple system calls me but it hangs up without reading out a code. Has anyone got this to work?
3
0
995
Apr ’24
Is Settings.bundle deprecated? What required-reason API code to use?
I'm referring to the use of a "settings bundle" plist to cause the main Settings app to display your app's preferences which the app can then read via NSUserDefaults, as described here: https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/UserDefaults/Preferences/Preferences.html#//apple_ref/doc/uid/10000059i-CH6 I am wondering if this is actually deprecated, or something. I ask because, (1), it still has the high-quality old-style documentation, and (2) there doesn't seem to be a "required reason API" code for using it. Specifically, the NSUserDefaults required reason API codes are CA92.1 : "This reason does not permit reading information that was written by other apps or the system" 1C8F.1 : "This reason does not permit reading information that was written by apps, app extensions, or App Clips outside the same App Group or by the system." C56D.1: "...third-party SDK..." - nope. AC6B.1: "... com.apple.configuration.managed ..." - nope. None of the codes permit reading preferences that have been set by the Settings app using this method.
2
0
902
Mar ’24