Post

Replies

Boosts

Views

Activity

Is "remotepairingd" Xcode-related?
Is remotepairingd part of Xcode? It seems to be stuck using 119% CPU. This may have started when I recently paired my new Apple Watch with Xcode - or maybe that is a coincidence. The console is full of: error 16:40:26.237601+0000 remotepairingd socket-1: No more data can be received, connection was closed
0
0
57
2d
Crash report from user unexpectedly looks like beta app
According to this page: https://developer.apple.com/documentation/xcode/interpreting-the-json-format-of-a-crash-report the storeInfo element of a JSON crash log may contain a deviceIdentifierForVendor element, but quote "This field is only present for TestFlight builds of an app". A user has just sent me a crash report which contains this key, but this isn't a testflight build. The suspicion is of course that the app is "cracked" in some way, but having interacted with the user for some time I think this is unlikely. He has had various issues with the app, affecting multiple devices; I have been wondering if there is something wrong with his Apple account. The docs also say that this "replaces the CrashReporter Key field", yet this crash report contains both. So my question for other developers: if you have any .ips crash logs, obtained from non-testflight users of your apps, please could you grep them for deviceIdentifierForVendor and let me know what you find. If any Apple people have any clues about how this could innocently end up in a crash report, please let me know. Maybe it's a documentation bug?
0
0
105
1w
SimpleWatchConnectivity sample - modernizing it
Dear Experts, I have been looking at thr SimpleWatchConnectivity sample code: https://developer.apple.com/documentation/watchconnectivity/transferring-data-with-watch-connectivity There are a couple of things in there that look out of date. Firstly, it uses a WKApplicationDelegate to receive the background tasks. I believe this can probably be entirely removed, and replaced with .backgroundTask(.watchConnectivity) { ... } on the App. Is that true? What do I need something inside the { ... } there? Secondly, it is using NSNotificationCenter to send received data from the WCSessionDelegate to the SwiftUI view hierarchy. Is there a better way to do that? I have spent a while trying to work out how a WCSessionDelegate class can connect to a binding to a SwiftUI @State property, and cause the UI to update in response to received data, but I haven't made it work. Are there any newer examples of how to do this? I'm currently only trying to send some simple applicationContext state from the phone to the watch and have some views update to show the latest values. Thanks, Phil.
3
0
168
1w
Per-project ProjectName-Swift.h, rather than per-target
Dear Experts, I have an Xcode project that generates two iOS app targets. Most of the code is shared between the two targets. Let's call them "Project", "App1" and "App2". I have some Swift code that is called from objC++. To make this work, in the objC++ files currently I #include "App1-Swift.h". Clearly this only works when building App1. What's the right way to set this up to work for both targets? Looking at the build settings, currently the "Generated Header Name" is set to "$(SWIFT_MODULE_NAME)-Swift.h". Presumably, SWIFT_MODULE_NAME expands to the target name. There are various possible ways to fix this, but which one is "right"? I bet that if I fix it in the wrong way, something else will go wrong later. I could: Change the objC++ to #include different headers depending on the target being built. Change the build setting to use the project name (from a variable?) instead of the SWIFT_MODULE_NAME. Somehow cause SWIFT_MODULE_NAME to equal the project name, rather than the target name. Any advice? Thanks.
0
0
154
3w
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
229
Nov ’24
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
486
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
718
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
361
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
295
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
770
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
986
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
681
Jun ’24