Post

Replies

Boosts

Views

Activity

How can an app detect which environment a push should be sent over / how should a server know whether to send pushes via production or sandox?
If a server is sending a push to an app, then how can it know whether it should be sending the push using the Apple sandbox push server, or the production server? If the app is on the app store or testflight then it needs to be using the sandbox server, but if the app is being run via XCode interactively as devs are developing/testing then the push needs to be sent via the sandbox server. But the server itself has no idea if the app was installed via Testflight/app store/XCode/ or a development .ipa. So the server can't know how to send the push. The app has to send the push token to the server anyway, so the app could inform the server which environment it should be sent over. But then how can the app detect that itself? A naive answer is to use #ifdef DEBUG to detect this, but that is incorrect. Which environment a push should be sent over is not correlated with that. For example an app could be being run with a debug scheme or a release scheme, but in both cases if the app is installed/running via xcode then the push environment has to be the sandbox. So my question is, is there a way the app can detect which push environment a push should be sent over in order than it can instruct the server accordingly?
1
2
741
Nov ’24
How do you symbolicate a .ips file? & .crash symbolication instructions out of date
I've got a .ips file from a handset that had hang detection turned on. Its not fully symbolicated, how can I symbolicate it? On that topic, the instructions for symbolicating a .crash file are out of date: https://developer.apple.com/documentation/xcode/adding-identifiable-symbol-names-to-a-crash-report It says "click the Device Logs button in the Devices and Simulators window, then drag and drop the crash report file into the list of device logs." However with XCode 15.1 there is no Device Logs button in the Devices and Simulators window. (If there were that button, presumably these instructions only apply for logs collected from the same device as listed in Devices and Simulators. What if you have a log collected from a device to which you don't have access for it to be in Devices and Simulators?)
1
1
2.7k
Feb ’24
App hanging at __ulock_wait2 in NSLog
I've got an app which is hanging, I turned on Hang Detection and got an .ips file and the top of the hang stack has this: Dispatch queue: com.apple.main-thread (0) 0 __ulock_wait2 7 NSLog 8 _MMKVLogWithLevel <snip> MMKV is a 3rd party library being used in the app. But this looks like MMKV is calling NSLog and then that is hanging? Is that correct, if so then how and why is NSLog hanging and how to solve this issue? Here's an image of the full stack from XCode when the .ips file is imported: And here is the heaviest stack info when the .ips is opened as a text file: Heaviest stack for the main thread of the target process: 411 start + 2240 (dyld + 23940) [0x1bcacad84] 411 main + 96 (MyApp + 108384) [0x10232e760] 411 UIApplicationMain + 340 (UIKitCore + 2270528) [0x19ad20540] 411 -[UIApplication _run] + 888 (UIKitCore + 2273028) [0x19ad20f04] 411 GSEventRunModal + 164 (GraphicsServices + 13536) [0x1dd8554e0] 411 CFRunLoopRunSpecific + 608 (CoreFoundation + 211304) [0x1988a6968] 397 __CFRunLoopRun + 1996 (CoreFoundation + 213528) [0x1988a7218] 397 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 (CoreFoundation + 226588) [0x1988aa51c] 397 _dispatch_main_queue_callback_4CF + 44 (libdispatch.dylib + 74168) [0x1a07831b8] 396 _dispatch_main_queue_drain + 1060 (libdispatch.dylib + 75244) [0x1a07835ec] 396 _dispatch_client_callout + 20 (libdispatch.dylib + 15828) [0x1a0774dd4] 396 _dispatch_call_block_and_release + 32 (libdispatch.dylib + 8508) [0x1a077313c] 396 __49-[RCTCxxBridge _prepareModulesWithDispatchGroup:]_block_invoke + 156 (MyApp + 11155392) [0x102db77c0] 396 -[RCTModuleData instance] + 816 (MyApp + 11498212) [0x102e0b2e4] 396 RCTUnsafeExecuteOnMainQueueSync + 52 (MyApp + 11906956) [0x102e6ef8c] 396 __25-[RCTModuleData instance]_block_invoke + 44 (MyApp + 11499132) [0x102e0b67c] 392 -[RCTModuleData setUpInstanceAndBridge:] + 1324 (MyApp + 11490784) [0x102e095e0] 392 __115-[RCTModuleData initWithModuleClass:bridge:moduleRegistry:viewRegistry_DEPRECATED:bundleManager:callableJSModules:]_block_invoke + 36 (MyApp + 11488056) [0x102e08b38] 392 -[MMKVNative init] + 100 (MyApp + 20934364) [0x10370aedc] 392 RCTExecuteOnMainQueue + 52 (MyApp + 11906684) [0x102e6ee7c] 392 __18-[MMKVNative init]_block_invoke + 232 (MyApp + 20934688) [0x10370b020] 392 +[MMKV initializeMMKV:] + 48 (MyApp + 9265708) [0x102bea22c] 392 +[MMKV initializeMMKV:logLevel:] + 80 (MyApp + 9265800) [0x102bea288] 392 _MMKVLogWithLevel(mmkv::MMKVLogLevel, char const*, char const*, int, char const*, ...) + 348 (MyApp + 9518596) [0x102c27e04] 392 NSLog + 56 (Foundation + 602868) [0x1977b42f4] 392 _NSLogv + 164 (Foundation + 603072) [0x1977b43c0] 392 _CFLogvEx3 + 252 (CoreFoundation + 652276) [0x1989123f4] 392 _CFLogvEx2Predicate + 352 (CoreFoundation + 652792) [0x1989125f8] 392 __CFLogCString + 84 (CoreFoundation + 652948) [0x198912694] 392 _logToStderr + 144 (CoreFoundation + 653980) [0x198912a9c] 392 __ulock_wait2 + 8 (libsystem_kernel.dylib + 59708) [0x1e1a7193c] *392 ??? (<7ABFF6F3-9E55-3D7B-8DB8-8CF19FB41EFE> + 5068548) [0xfffffff008229704]
3
1
1.2k
Feb ’24
App keeps hanging at different locations but always features NSLog and __ulock_wait2
I reported this first here: https://developer.apple.com/forums/thread/746539 But have since discovered more findings. In that report there is a hang stack trace (from an .ips file) showing the 3rd party library KKMV featuring. However since posting that I have discovered that my app is hanging all over the place at random places, I've been collecting .ips files and they are all different - expect they all have one thing in common, which is that it always involves __ulock_wait2 / NSLog. There's one example posted in the linked post, but here's a different example but with the same last lines of __ulock_wait2/NSLog Here's another snippet from a hang, again, just like all the others, it finishes with NSLog/__ulock_wait2 318 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 148 (CoreFoundation + 194472) [0x1988a27a8] 318 @objc CallExtensionManager.appBecameActive() + 28 (Myapp + 296292) [0x100ba8564] 317 CallExtensionManager.appBecameActive() + 912 (Myapp + 295912) [0x100ba83e8] 317 specialized static Logger.always(_:) + 316 (CallFilterFast + 108104) [0x100b7a648] 317 specialized withVaList<A>(_:_:) + 428 (Foundation + 5337508) [0x197c381a4] 317 _NSLogv + 164 (Foundation + 603072) [0x1977b43c0] 317 _CFLogvEx3 + 252 (CoreFoundation + 652276) [0x1989123f4] 317 _CFLogvEx2Predicate + 352 (CoreFoundation + 652792) [0x1989125f8] 317 __CFLogCString + 84 (CoreFoundation + 652948) [0x198912694] 317 _logToStderr + 144 (CoreFoundation + 653980) [0x198912a9c] 317 __ulock_wait2 + 8 (libsystem_kernel.dylib + 59708) [0x1e1a7193c] *317 ??? (<7ABFF6F3-9E55-3D7B-8DB8-8CF19FB41EFE> + 5068548) [0xfffffff008229704] Every time the app hangs, in the .ips logging is featured when the ips is opened in XCode or when the ips is examined it always features in the Heaviest stack for the main thread of the target process. I've drastically reduced the amount of logging within the app in case it was too much, but it made no difference. When the app hangs there's no crash, I'm running the app either from Testflight, or installing via XCode but then running it from XCode. If its installed via XCode then a dialog pops up saying it crashed, but there is not crash stack (there's no .crash files on the iPhone, only .ips files, there's no crash reported to crashlytics, and if reported via Testflight there's also no crash info). Why is NSLog featuring in every .ips file when this happen but at a different location everytime? If the app is hanging and blocking the main thread, then why isn't it being terminated by Watchdog and thus not producing a .crash file?
0
1
790
Feb ’24
What can be done about XCode always spinning its wheels and stuck on installing/attaching to app?
I have a real problem with XCode (15 and 16) which is that all the time it'll get stuck installing/attaching to an app. It'll be working fine one minute, I can make a code change, build, and run the app (on hardware) and everything will be fine. But then make another change, build and run again and now XCode will get stuck saying "Installing app to phone" / "Attaching to app on phone". If I click stop and try and run again now there'll be two "Installing app to phone" instances running, do it again and then there'll be three and so on. If I quit XCode and relaunch it then it does not fix the issue, I have to terminate XCode and reboot the phone. And then it'll be ok again, but only for about 10 minutes, but then it'll start doing the exact same thing again. Its impossible to work like this, having to reboot the phone every 10 minutes or so. Is there any solution or tricks? (is it possible to kill the hung task within XCode for example?)
4
1
807
Aug ’24
Callkit blocking behaviour is overridden in iOS 18
In iOS 18 if a number is registered with CallKit to be blocked, then if that number is also in contacts, then the number isn't blocked. If a user has added a number to their contacts, then in all probability they might not want the number blocked, so this might seem reasonable behaviour. However the point is, this is new behaviour for CallKit in iOS 18, and its never been like this before going back several years to the very first release. Why suddenly change it now, after all these years, without notice nor documentation, and take away that option from the user, should for some reason, they want to block a number which is also in their contacts. This is quite a disruptive change for apps using CallKit.
11
1
1.7k
Oct ’24
Message filter extension doesn't run on iOS 18
If I run an app with a message filter extension on < iOS 18 everything is as expected, if I run the same app, without any changes on iOS 18 then it doesn't work. I've discovered that problems occur if the extension has the following code: extension MessageFilterExtension: ILMessageFilterQueryHandling, ILMessageFilterCapabilitiesQueryHandling { func handle(_ capabilitiesQueryRequest: ILMessageFilterCapabilitiesQueryRequest, context: ILMessageFilterExtensionContext, completion: @escaping (ILMessageFilterCapabilitiesQueryResponse) -> Void) { let response = ILMessageFilterCapabilitiesQueryResponse() response.transactionalSubActions = [.transactionalCarrier, .transactionalHealth, .transactionalPublicServices, .transactionalFinance, .transactionalWeather, .transactionalRewards, .transactionalOrders, .transactionalOthers, .transactionalReminders] response.transactionalSubActions = [.transactionalFinance, .transactionalOrders, .transactionalHealth] completion(response) } This code doesn't run on iOS 18, however the following code does run on iOS 18: let response = ILMessageFilterCapabilitiesQueryResponse() completion(response) I downloaded several apps from the app store which provide message filtering, within the Message app they all had one thing in common, on < iOS 18 they all show 12 filtering categories, but within iOS 18 they only show 2. So it seems the issue is endemic and effects other apps, not just mine.
4
1
905
Sep ’24
How to implement server-side authentication for text filtering requests??
If an app has a text filtering extension and associated server that the iPhone OS communicates with, then how can that communication be authenticated? In other words, how can the server verify that the request is valid and coming from the iPhone and not from some spoofer? If somebody reverse engineers the associated domain urls our of the app's info.plist or entitlement files and calls the server url directly, then how can the server detect this has occurred and the request is not coming from the iPhone OS of a handset on which the app is installed?
16
1
815
Jan ’25
Switch between distributing code as source / as a binary
I'm getting confused reading conflicting information about Swift Packages (for example, many sources say its for distributing source code only, but Apple's documentation says a binary framework can be included in them). What I would like to be able to do is to distribute a project as a binary to external customers (so they cannot see the source code) but distribute it as source code for internal consumption (so when developing a test app that uses the project, source code can be stepped through in the debugger etc.) Is the feasible/easy? Could a package manifest be created that can easily be flipped between creating a package containing source only, and a binary only. Or would it be better to have two separate manifests?
1
0
636
Jun ’24
How does an app manage its own contacts?
In the documentation for the Contact Provider Extension contact provider it says Use the Contact Provider framework if your app manages its own contacts and wants to make them available in other apps that use the Contacts framework. But how does an app manage its own contacts? What needs to be done differently if it manages its own contacts versus managing a user's contacts? Does the user still need to grant contacts access for example? Is there a special group/domain that should be used (how) to add app contacts? There's no mention of any of this that I can see in the documentation for CNContact or CNContactStore.
4
0
760
Jul ’24
A couple of questions about Live Caller ID lookup
Hello I have a few questions regarding the Live Caller ID lookup feature First question: The documentation for Live Caller ID Lookup says that "the system does not use private relay when the application is installed directly from XCode.This allows the application & the service deployment to be tested before filling out the onboarding form and setting up private relay." What is the situation regarding development distribution signed .ipas? Would they be able to bypass the private relay too? Second question: Is there anyway an application could dynamically switch which blocking dataset gets used? The use case for this is providing the option to the user whether a set of numbers gets blocked or not. If the OS makes a blocking lookup and an identity lookup, then if these always map to the same blocking dataset then it means the blocking behaviour is the same for every user there is. That means whatever decisions the server makes as to what numbers to block applies to every user. Whether to block a number of not is a fuzzy decision, it would be good if users had the ability to decide for themselves if fuzzy numbers should be blocked or not rather than have that imposed upon them. Third question: It looks from the way things are set up that 2) is not actually possible. If that is the case then will it be permitted for two endpoints to be registered with Apple? (then the app could implement more than one Live Caller ID extension which provide different blocking behaviour)? Thank you very much.
2
0
905
Aug ’24
Confused between custom URL schemes and Universal linking and redirecting to the app store
I have a requirement to launch an app from another app (there is no requirement to launch the app from a website), and if its not installed then for the user to be redirected to the app store to download the app. The app already has a custom url scheme implemented, however the documentation and tutorials in this area are confusing and unclear. In order to launch the app, the custom url scheme will provide that, however, in order to get the redirection to the app store then firstly does the custom url scheme have to be replaced with universal links? Secondly, is it necessary to have a webpage that links to the app store? Is it possible to get this behaviour without having a website? Is it the case that Apple doesn't provide this functionality and developers have to have the hassle of hosting a website purely just for the sake of redirecting to the App Store?
1
0
1.1k
Aug ’24
Is the Communication Notifications capability required for a Notification Service Extension and a Notification Content Extension?
I would like to add both a Notification Service Extension and a Notification Content Extension to my application. After reading some documentation and tutorials etc. I'm not clear if the Communication Notifications capability is needed or not. If it is, should it get added to the App ID or the notification IDs, or both?
1
0
620
Aug ’24
How can you use ContactAccessButton() or contactAccessPicker() with a storyboard?
I've got an existing app using storyboards and would like to incorporate the new iOS 18 ContactAccessButton() and contactAccessPicker() into the GUI. However, how can that be done? If I try to do something like add a UIView to a view controller in the storyboard, then ContactAccessButton can't be assigned to it (even though ContactAccessButton inherits from UIView). Nor can a ContactAccessButton be used as a type within the Storyboard/the View Controller. How do I go about integrating this new iOS feature into an existing app using Storyboards and view controllers?
2
0
595
Sep ’24