Post

Replies

Boosts

Views

Activity

Notification content extensions not working in 10.2
I wrote a notification content extension which with 10.1 was working perfectly and reliably - it was getting called 100% of the time, as it should, and eveything was great and working as it should.But now with 10.2 I just cannot get the bugger to work at all - the extension just isn't being called by the OS (actually it was called once out of about 30 attempts and on that one occasion the UNNotificationExtensionDefaultContentHidden YES flag was ignored, which it didn't use to be with 10.1)Anybody else having problem with content extensions with 10.2, but if not is there some trick or tweak or change you applied to get them to work?
4
0
3.6k
Jul ’16
OS terminates app and stops sending Voip pushes even if reportNewIncomingCall() is called
It an app receives a Voip push, but has to terminate the call, then if this happens a few times the OS is terminating the app (Message from debugger: Terminated due to signal 9) and then it stops delivering future pushes to the app.i.e. with code let endCallAction = CXEndCallAction(call: callUUID) let transation = CXTransaction(action: endCallAction) self.callController.request(transation) { (error) in } provider.reportNewIncomingCall(with: callUUID, update: callUpdate) { error in Model.priorityLog("GRUNT reportNewIncomingCall completion error \(String(describing: error))") completion() }
2
0
946
Jul ’19
Any concrete info on when Apple apply server side APNS throttling?
We have an app which gets sent APNSs by the server and use a Notification Service Extension to intercept them. In my observations I've never seen throttling applied on the device to these pushes (unlike app directed push where its easy to observe happening if you let the batter run low for example). The Apple documentation says it may perform server side throttling, but when, how often, under what circumstances? If the app has 30 million users and the server sends them 10m or 100 pushes per day will it get throttled? Does anybody have any have any documented or observed info on this.
0
0
590
Oct ’21
Sandbox restriction message caused by differing Application Identifier Prefix and Team Identifier in an extension?
I'm working on an out-sourced application for a company and when a version of it built using ids and provisioning profiles from my Apple account it runs without problems. However when it is built and run using the company's ids and provisioning profiles I am seeing an issue with it. What is happening is when a notification service extension uses a call extension then the OS logs: doQueryCallExtensionStatusWithDispatchGroup() COMPLETED WITH ERROR: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.CallKit.CallDirectory was invalidated: failed at lookup with error 159 - Sandbox restriction." UserInfo= NSDebugDescription=The connection to service named com.apple.CallKit.CallDirectory was invalidated: failed at lookup with error 159 - Sandbox restriction. I noticed that in the company's provising profile for the notification service extension the app identier prefix is different from the team identifer. In my own provisioning profile the app identifier prefix and team identifer are the same. Could it be the case that this difference in identifiers within the provisioning profile is leading to the sandbox error message? Attached is the notification service extension provisioning profle provided to me by the company (converted to a .plist for readability)
2
0
7k
Nov ’21
Notification filtering entitlement not working on iOS 13
I'm running an app with the com.apple.developer.usernotifications.filtering entitlement and the filtering works fine with iOS 15. However I tried running it on an older phone / OS (iPhone 8 / iOS 13.1.2) and it does not work. Is this entitlement not supported with iOS 13.1.2? If so, what is the earliest iOS version that supports it? The handset logged this: The OS displayed: default 07:55:58.800825-0800 NotificationServiceExtension   Mutated notification request will not visibly alert the user, will deliver original content If the app is run on iOS 15, it says : default 07:20:27.251600-0800  SpringBoard        Mutated notification request will not visibly alert the user, will supress original content
1
0
1k
Dec ’21
OSLogStore can't access an app's extensions?
I've got an iOS app with lots of extensions, some of them complex and doing a lot of stuff. After a bug I'd like to be able to use OSLogStore to get a holistic picture of logging for the app and its extensions and send that to a debugging server to retrospectively view logs for the app and its extensions. The constructor is OSLogStore.init(scope: OSLogStore.Scope), however scope only has one value .currentProcessIdentifier. Implying if that is called from within the app it can only get access to logging for its process only. I tried it out to confirm this is the case - if I log something in an extension (using Logger), then run the app with code like this:  let logStore = try! OSLogStore(scope: .currentProcessIdentifier)  let oneHourAgo = logStore.position(date: Date().addingTimeInterval(-3600)) let allEntries = try! logStore.getEntries(at: oneHourAgo)       for entry in allEntries { look at the content of the entry Then none of the entries are from the extension. Is there anyway from within the app I can access logging made within an extension?
2
0
728
Jan ’22
Notification displayed via Notification Service Extension doesn't display correctly if the iPhone is passcode protected and locked
I've got a notification service extension which is working as expected unless the user a) turns the passcode for the iPhone on and b) turns on Auto-lock and the iPhone is locked when a push arrives If auto-lock is turned on and the phone is locked but passcode is not turned on, then the notification is displayed as expected. The iPhone displays a notification with the top line being the name of the app and the second line saying "Notification", which is neither the content within the push payload, not what is being set as the content within the extension. There's no difference in behaviour of the extension when passcode is enabled. Adding logging to the extension I can confirm the content is being replaced and posted as expected: NSLog("Going to post notification title: \(notificationContent.title) subtitle: \(notificationContent.subtitle) body: \(notificationContent.body)") contentHandler(notificationContent) The notificationContent is as expected and is identical when passcode is on off. Why is the iPhone displaying the notification incorrectly if passcode is turned on and the phone locked?
3
0
895
Jan ’22
Lots of Killed: 9 compilation errors with an M1/Monterey
A couple of days ago I changed laptops from an Intel/Big Sur to a MacBook Pro M1/Monterey. Since then I've encountered endless endless problems building in Xcode (for iOS). The very first attempt at building my project after setting up the laptop was successful, but since then builds just fail randomly without making any code changes. i.e. make a build and its successful, change nothing whatsoever and it fails. Once a build fails it takes an eternity to get it building successfully again, doing a clean, delete derived data, quit/re-launch Xcode doesn't necessarily fix the problem, it might be necessary to do this 3 or 4 times before the build succeeds again. But that build success will only be temporary before it fails again. The failures are different each time, but one thing they seem to have in common is a Killed: 9 message, here's an example Script-00DD1BFF1BD5951E006B06BC.sh: line 5: 22679 Killed: 9         ../node_modules/@sentry/cli/bin/sentry-cli react-native xcode ../node_modules/react-native/scripts/react-native-xcode.sh Command PhaseScriptExecution failed with a nonzero exit code I've had about 6 or 7 different random failures in different places, but they all say Killed: 9 Command PhaseScriptExecution failed with a nonzero exit code. The project used to build fine on the old laptop, its the exact same project/code, the only variable here is the laptop itself and the MacOS. I've been struggling with this for the last 3 days, the problems are just endless. The build failures are random, like I mentioned a build will work fine one time, then just stop for no reason. They could occur at any random moment in any random component of the project or its dependencies. Its utterly impossible to proceed like this, I'm the first in my company out of about 100 employees who are going to upgrade their laptops from Intel to Silicon. I will be telling our IT department we absolutely cannot make that switch as things are just unusable and its impossible to proceed with this combination of laptop|OS|Xcode. I'm on Monterey 12.2.1 | Xcode 13.2.1, but the problem was also present with Monterey 12.0.1|Xcode 13.2.1 Opening Xcode with Rosetta makes no difference to the problems.
7
1
7.7k
Feb ’22
Unwanted Communication Extension template code doesn't work
If a unwanted communication extension target is created,then the auto-generated template code doesn't work. This can very quickly be demonstrated by: In Xcode create a new iOS project In that project create an unwanted communication extension target (I called it cheese so its easy to see in the console) Add some logging lines to the UnwantedCommunicationReportingExtension code that was created. Install app to iPhone, and select it in the settings app Swipe on a call in the call history. The following lines can be seen in the iPhone console: Unknown class _TtC6cheese13MainInterface in Interface Builder file. View controller is not of class ILClassificationUIExtensionViewController None of the logging lines added to the code are displayed, also the Done button in the presented UI is disabled - but in the code that is generated by the target templete is:       self.extensionContext.isReadyForClassificationResponse = true Which is supposed to enable the Done button. In the storyboard that gets created the custom class is set to MainInterface: How are you supposed to get this stuff working if it doesn't work out of the box? MainInterface isn't being recognized as the view controller class, and in the drop down UnwantedCommunicationReportingExtension doesn't appear. class UnwantedCommunicationReportingExtension: ILClassificationUIExtensionViewController {          override func viewDidAppear(_ animated: Bool) {         super.viewDidAppear(animated) NSLog("viewDidAppear")                  // Notify the system when you have completed gathering information         // from the user and you are ready with a classification response         self.extensionContext.isReadyForClassificationResponse = true     }          // Customize UI based on the classification request before the view is loaded     override func prepare(for classificationRequest: ILClassificationRequest) { NSLog("prepare")         // Configure your views for the classification request     }       // Provide a classification response for the classification request     override func classificationResponse(for request:ILClassificationRequest) -> ILClassificationResponse {         return ILClassificationResponse(action: .none)     } }
1
0
1.5k
Mar ’22
Unwanted communication extension is unable to persist data written to defaults
I'm currently using 4 extensions within my app and use a group in combination with UserDefaults.init(suiteName:) to share settings between the extensions and the app. However I've just tried adding an unwanted communications extension and found that data writing to defaults, in the exact same way as the other extensions, isn't saved. At first I noticed data written by the UCE wasn't present when the app tried to read it, so performed an experiment and found that while the extension is running, it can write and read data to user defaults, but the next time the extension runs, all that data has gone. I've tried using the old and now default UserDefaults.synchronize() but it makes no difference. Why is the UC extension different from every other extension? Is it possible to write and persist data from within it? let groupName = "group.com.mycompany.appName" let sharedDefaults = UserDefaults.init(suiteName: groupName) var theValue = sharedDefaults!.value(forKey: "some key") NSLog("\(theValue)") // prints nothing, despite the extension having previously run sharedDefaults!.set("some value", forKey: "some key")) sharedDefaults!.synchronize() theValue = sharedDefaults!.value(forKey: "some key") NSLog("\(theValue)") // prints "some value"
2
1
1.3k
Mar ’22
Push to talk: how is the push token supposed to be used if its lifetime is ephemeral?
I don't understand how the push tokens are supposed to be used with push to talk given that their lifetime is ephemeral and they become invalid as soon as a channel is left. Suppose there is phone A and phone B, both with a PTT app installed on it. Then on phone A if the user launches the app and, for example, pushes a button to initiate a talk session with user B, then the app on phone A will join a channel and this will result in receivedEphemeralPushToken() getting called. Then if phone A sends that push token to the server, well then what next though? How is the user on phone B going to be informed that the user on phone A wants to talk to them. The server can't send a push to phone B using that token because that's the token for phone A. If the server has a token from phone B stored from previously, then the push isn't going to work because the documentation says the push token's lifetime is empemeral and will end as soon as the channel is left. So that channel for B's push token would have been left hours, or days or even months in the past. Summary: if user A wants to talk to user B, how does user B's app get notified user A want's to talk to them if the push tokens' lifetimes are all ephemeral?
1
1
1.1k
Aug ’22
Unable to upload app with iOS 16 background asset download extension to Testflight - invalid info.plist
I'm experimenting/testing the new background download extension. The documentation for it says that the applicationDidInstall() and applicationDidUpdate() methods are only called if the app is installed from the App Store or from Testflight (I tried installing via Apple Configurator 2 but they are not called then). Hence in order to check these out I have to first upload the app to Testflight, but there's an error about the info.plist - however the info.plist is created/populated using Xcode's target template for the extension, so if Xcode itself is incorrectly creating the info.plist how is one supposed to know what's wrong with it and how to fix it? This is the content of the info.plist that was generated: <key>EXAppExtensionAttributes</key> <dict> <key>EXExtensionPointIdentifier</key> <string>com.apple.background-asset-downloader-extension</string> <key>EXPrincipalClass</key> <string>$(PRODUCT_MODULE_NAME).BackgroundDownloadHandler</string> </dict> And the error uploading to Testflight P.S. There's no apparent relevant tag for this extension
1
0
812
Aug ’22
How is one supposed to create a Background Assets extension? There's no extension type for this existing in Xcode beta 5
I want to use features described in the background assets WWDC22 session, however with Xcode 14 Beta 5 there is no application extension of this type. There was an application extension type with beta 4, but there are two problems with this firstly Testflight doesn't recognize it so its impossible to upload and therefore use (because some of the features are documented as only working when the app is installed from Testflight/App Store). secondly, if one creates an extension using Xcode beta 4, then it complies with beta 4, but it won't compile with beta 5. Therefore it is currently impossible to even begin to start working with the background assets extension framework.
3
0
1k
Aug ’22
usernotifications.filtering entitlement prevents a contact with an image from being added/updated
My notification service extension has the com.apple.developer.usernotifications.filtering entitlement and it would appear that this is preventing a contact with an image from either being added or updated, any attempt to do so results in calls to CNContactStore.execute() throwing an CNInvalidRecords error. If the filtering entitlement is removed then there are no problems and the contact can be added/updated without problem. If the entitlement is present but the contact is added/updated without an image then it is also problem free. It is specifically adding a contact with an image that cannot be accomplished if the entitlement is present. I've encountered problems with this entitlement before - for example there are problems attempting to use a CXCallDirectoryManager from within a notification service extension with this extension. Quote from Apple on the call extension issue: "Because that entitlement can "hide" notifications, its sandbox profile is actually more restrictive than the standard NSE sandbox. That's what's preventing access to CXCallDirectoryManager, not the App ID properties.  -Kevin Elliott DTS Engineer, CoreOS/Hardware" I'd be appreciative if somebody from Apple could comment and confirm if the problems with updating contacts with an image with this entitlement is the same fundamental sandboxing issue? If so, I don't understand why a contact can be added with this entitlement, its only an issue if the contact has an image, does that imply a bug?
1
0
898
Sep ’22