Post

Replies

Boosts

Views

Activity

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
1.2k
Dec ’21
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.6k
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.3k
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
950
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
1k
Sep ’22
Xcode 14.1 beta: How do you run the backgroundassets-debug command?
If I run "man backgroundassets-debug" I get instructions/help/comments for using the backgroundassets-debug tool to simulate the background assets download framework (which has been added back to Xcode 14.1 beta 1 after being removed from Xcode 14 beta 3) But how do you actually run the backgroundassets-debug tool itself? "backgroundassets-debug -h" for example results in a command not found message. I tried searching for the tool within the Xcode 14.1 package but can't see it anywhere running "xcode-select -p" displays "/Applications/Xcode-beta.app/Contents/Developer" And "xcode-select -v" displays "xcode-select version 2395" Within Xcode preferences, command line tools is set to Xcode-beta 14.1
1
0
957
Sep ’22
Issues with https auth challenge and background asset download extension
I'm trying to get a background asset extension working with iOS 16.1/Xcode 14.1. I'm able to succesfully download a file when using BADownloadManger from within the app, but not if the extension tries to download the same file. I've discovered its not possible to use a url with http for the asset download as the OS performs a check and throws an exception saying only https is accepted. However when you use a https url there's an authentication challenge. I implemented the auth challenge method of BADownloadManagerProtocol within the app (it completes with AuthChallengeDisposition.performDefaultHandling) and the file is sucessfully able to be downloaded when the download is initiated from within the app. However, the same file cannot be downloaded when its downloaded from the extension. I implemented the BADownloaderExtension: didReceive challenge method within the extension (which returns the same thing, AuthChallengeDisposition.performDefaultHandling) however when the extension is attempted to be invokved (using the backgroundassets-debug command line tool) then the handset logs this: Failed to send -[BADownloaderExtensionProxy sendAuthenticationChallenge:download:completionHandler:]_block_invoke and the download fails. Why does the download succeed from the app but not from the extension? Why is the OS saying it can't send the auth challenge when I'm implemented the relevant method of BADownloaderExtension?
1
0
506
Oct ’22
What is an applicationName token?
I'm looking at this tutorial on app intents and shortcuts: https://arctouch.com/blog/implementing-app-shortcuts-intents And it says "Each phrase also has to contain your app name. To make it easier, you can provide the system with a list of synonyms for your app name and then use the applicationName token instead of your app name as a string literal" But it doesn't provide an example of using an applicationName token. I've tried searching for this but can't find anything. What is the applicationName token and what might an example of it being used be in a shortcut?
1
0
1.7k
Oct ’22
Push tokens: how to get a user/app to run after users transfers to a new phone?
If the user installs an application which uses push notifications onto iPhone A and then runs the app then the app will send the push token to the server (and from that point one the app should detect if the push token changes and send the new token to the server). However there's no way that the app can do this in the situation where the user backs up iPhone A to iCloud and then restores to iPhone B. If the user doesn't explicitly launch the application, then the application has no chance to detect that the push token will have changed, and so meanwhile the server is sending pushes using the token from phone A but the user now is using phone B. User's won't know they have to launch an app on phone B, and there's no way the app can launch itself, so the user's now have a non functioning app but they don't realise it. There must a lot of apps using push that face this situation, yet there's no solution? I was hoping iOS 16's background asset download might be a solution to this - if the extension gets called after restoring from iCloud it could detect the device change and thus push token change and post a notification to the user telling them they need to launch the app, but this extension appears to be functionally sandboxed and its not possible to post a notification from within it (unlike many other extensions).
1
0
548
Nov ’22
How can a notification service extension receive a VoIP push? (as opposed to receiving a non-VoIP push)
0 If a voip push (i.e. a push with a topic of com.company.app.voip as the push topic) is sent to a handset then it is delivered directly to the app via: pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload forType:(PKPushType)type withCompletionHandler: If the app has a notification service extension, and the push payload contains mutable-content, and if the app is terminated, then the app gets launched in the background and the push still is delivered directly to the app, it does not get delivered to the extension. If the push topic is changed to be just com.company.app (and provided the payload contains the mutable-content flag) then in that case it gets delivered to the extension. However now it's no longer a voip push, it's just a regular push, because the topic no longer contains the .voip suffix. So how can things be configured whereby a voip push gets delivered to a notification service extension? Because that's what the Apple documentation says: Call this method when your notification service extension receives an encrypted VoIP call request. From: https://developer.apple.com/documentation/callkit/cxprovider/3727263-reportnewincomingvoippushpayload How is that possible, how can a notification service extension receive an encrypted VoIP call request like it mentions in the documentation?
1
0
1.5k
Nov ’22
Why is the VoIP background mode capability still present in Xcode when it was deprecated in iOS 10?
There's lots of material on the internet talking about how the VoIP background mode capability was deprecated in iOS 10. And yet its still presented as an option in the latest version of Xcode and it still appears in Apple's documentation https://developer.apple.com/documentation/xcode/configuring-background-execution-modes The documentation states: The app provides Voice over IP services and requires automatic launch after system restart. For more information, see the CallKit framework. It seems apps used to be able to be launched on restart prior to iOS 10, but since then they can't. So is the documentation for this area out of date and wrong? If its been deprecated for so long, why is it still documented and possible to add it to an application?
1
0
1.1k
Dec ’22
Is it possible to catch a memory exception in an extension?
I've got a notification service extension with quite a lot going on, and consequently I've been running out of memory. One thing in particular that is using a lot of memory is UIGraphicsImageRenderer which I'm using to construct an image at run time the size of the device's bounds. Running the extension in Xcode and profiling its memory it appears that using autoreleasepool {} doesn't seem to always release memory instantly, so if you do A and then B, and combined they have too much memory usage for the extension to handle, trying to autorelease A doesn't actually always release the memory before B (unlike if the code is running in the main app rather than an extension). A few questions is there any way of programmatically detecting the memory usage / memory limit within the extension? if the extension goes over the 24Mg limit, is there any way of catching that exception and handling it somehow? is there a way of ensuring/forcing autoreleasepool{} to clear memory before proceeding with further code?
1
1
759
Dec ’22
[__NSCFType set]: unrecognized selector with NSAttributedString:draw() gets called, based on width of position
If the code below is run it causes an exception 'NSInvalidArgumentException', reason: '-[__NSCFType set]: unrecognized selector sent to instance 0x283130be0' However, the exception can be removed by reducing the width value from 100.0 in positionRect, for example setting it to something like 50.0 removes the exception. But why is this? With a width value of 100.0 specified for positionRect, that's well short of the width of imageSize. And even if there is some size issue, why is there an unrecognized selector exception? let imageSize = CGSize(width: 400, height: 100) let testRenderer = UIGraphicsImageRenderer(size: imageSize) let testImage = testRenderer.image { context in context.cgContext.setFillColor(UIColor.black.cgColor) context.fill(CGRect(origin: .zero, size: imageSize)) let paragraphStyle = NSMutableParagraphStyle() paragraphStyle.alignment = .left let attributes: [NSAttributedString.Key: Any] = [ .font: UIFont.systemFont(ofSize: 8.0), .paragraphStyle: paragraphStyle, .foregroundColor: UIColor.white.cgColor ] let attributedString = NSAttributedString(string: "This is some text", attributes: attributes) let positionRect = CGRect(x: 10, y: 10, width: 100.0, height: 8.0) attributedString.draw(with: positionRect, options: .usesLineFragmentOrigin, context: nil) }
1
0
1.5k
Jan ’23
Is it possible to schedule a timer in a notification service extension?
I'm trying to fire a timer in a notification service extension, but what would work in the app doesn't work in the extension i.e. Timer.scheduledTimer(timeInterval: 8.0, target: self, selector: #selector(doSomeStuff2), userInfo: nil, repeats: false) or Timer.scheduledTimer(withTimeInterval: 7.0, repeats: false) { timer in ... } and so on, etc. Is that a way of getting a timer to fire in an extension?
1
0
1.4k
Apr ’23
CFBundleIdentfier Collision uploading app with 3rd party xcframework
using an xcframework supplied by 3rd party. I can build/run/install the app and use the framework without issue when running/installing from Xcode. However if I create an archive and then attempt to upload it to TestFlight I get two errors, the first is: CFBundelIdentifer Collision. There is more than one bundle with the CFBundelIdentifer value bundleidofframework under the application And the second is Invalid Bundle. The bundle at ...myextension.appex contains disallowed file Frameworks. (I'm using the framework within both the app and an extension) Within the embed frameworks section of Xcode, the tickbox code sign on copy is ticked (that's the default value and if its unticked then the app doesn't run when installed directly via Xcode).
1
0
541
May ’23