Post

Replies

Boosts

Views

Created

The auto generate asset download extension entitlements file prevents compilation
Apple this is dead easy and quick to reproduce. Just create an app and then add a target of type background download. Xcode automatically assigns a group id to the target and generates a corresponding entitlements file like so: However the extension will not build, there is this error: You can bugger about in the developer portal as long as you want, ensuring the group identifier exists, ensuring provisioning profiles have this group capability, etc. etc. nothing will make this error go away. Now, what is unique about the download extension's entitlements file is the com.apple.developer.team-identifier key. This does not get generated for other extension - go ahead and see for yourself, create an action extension and give it a group, the result is its group appears in the entitlements file but not this com.apple.developer.team-identifier. If you try to print out $(TeamIdentifierPrefix) (via echoing it in a build script), you get this /Users/me/Library/Developer/Xcode/DerivedData/experiments-clpwbtcvdpqwuodxzwmsxwpztguo/Build/Intermediates.noindex/experiments.build/Debug-iphoneos/backgroundDownloadExtension.build/Script-243C9904292461BC001FDE14.sh: line 4: TeamIdentifierPrefix: command not found Hmm, command not found, but if you change the echo to ${TeamIdentifierPrefix} guess what gets printed, yes the team identifier i.e. in my case MV8J9D3236. Now if in the entitlements file I add the team identifier explicitly, like so Then magically the error about automatic signing and the provisioning profile goes away. Change it back to $(TeamIdentifierPrefix) and the error appears, change it to be explicit and it goes away. So by tweaking the entitlements file its possible to get the extension to build, however all is not well, now that it builds, if the extension is installed and run, the OS says: "Event (1) dropped for client (com.company.experiments) failed because the app and extension do not share any application groups." It says that despite the fact the app and extension both do have the same group capability. This is driving me nuts - the auto generated entitlements file is stopping the extension from compiling, but if you fix the build, it can't run. (Xcode 14.1, iOS 16.2)
2
0
1.5k
Nov ’22
Xcode 14.1 is unable to provision an asset download extension
This can easily be reproduced from scratch following these steps: Launch Xcode and choose to create a new iOS app. Organization name: com.company, ProductName:experiments. Therefore the bundle id is: com.company.experiments Create a background download target, productName:backgroundDownloadExtension. Therefore the bundle is is: com.company.experiments.backgroundDownloadExtension When Xcode creates the extension it automatically gives it a group capability with id: group.com.company.experiements. Within the signing & Capabilities section for the extension there is the following error: Within the developer portal, go to the Identifiers section, locate the main app bundle com.company.experiements. If not ticked, tick the App Groups capability. Click on edit, select group.com.company.experiments Within the developer portal Identifiers section, locate the extension bundle, com.company.experiments.backgroundDownloadExtension. Ensure the App Groups capability is ticked. Click on edit, select group.com.company.experiments. Like so for both the app and extension: Back in Xcode, for the app add the group capability, tick group.com.company.experiments. Now it matches the extension and will be like this for both of them: Quit and relaunch Xcode because Xcode is so unbelievably sticky and seems to cache everything, e-v-e-r-y-t-h-i-n-g, and millions of problems can be solved just by quitting/relaunching it. In the Signing & Capabilities section for the extension it still displays this: Back in the developer portal, create a provisioning profile for iOS development, choose the com.company.experiments bundle id, download it. Do likewise for the com.company.experiments.backgroundDownloadExtension After downloading, click on them both. Quit and re-lanch Xcode again. Any luck? No its still displaying the provisioning error. Ok, enough of Xcode's automatic management of signing. Let's turn that off and import the the extension provisioning profile that was just downloaded. Still getting this error: The entitlements file's contents are: <key>com.apple.security.application-groups</key> <array> <string>group.com.company.experiments</string> </array> The contents of the downloaded extension profile are: <key>Entitlements</key> <dict> <key>com.apple.security.application-groups</key> <array> <string>group.com.company.experiments</string> </array> <key>application-identifier</key> <string>MV8J9D3236.com.company.experiments.backgroundDownloadExtension</string> <key>keychain-access-groups</key> <array> <string>MV8J9D3236.*</string> <string>com.apple.token</string> </array> <key>get-task-allow</key> <true/> <key>com.apple.developer.team-identifier</key> <string>MV8J9D3236</string> </dict> I give up, how the hell can you create a background download extension without Xcode displaying the error?
3
1
1.7k
Nov ’22
Background assed download error: "BAApplicationInfo is missing an extensionIdentity"
I've added a background asset extension and am trying to invoke it using this: xcrun backgroundassets-debug --app-bundle-id com.myCompany.myApp  --device-id 00008120-000225060C9B401E --simulate --app-update  When I run that command I see this in the phone's log: Unable to observe extension for (com.cequint.myapp), the BAApplicationInfo is missing an extensionIdentity. So how should an extension identify be added? The extension's info.plist is as created by the Xcode template: &lt;key&gt;EXAppExtensionAttributes&lt;/key&gt; &lt;dict&gt; &lt;key&gt;EXExtensionPointIdentifier&lt;/key&gt; &lt;string&gt;com.apple.background-asset-downloader-extension&lt;/string&gt; &lt;/dict&gt; And I've added the following to the app's info.plist: &gt; &lt;dict&gt; &lt;key&gt;BGTaskSchedulerPermittedIdentifiers&lt;/key&gt; &lt;array&gt; &lt;string&gt;kBackgroundTaskIdIdentifier_RNScheduleAppRunEvent&lt;/string&gt; &lt;/array&gt;   &lt;key&gt;BAMaxInstallSize&lt;/key&gt;   &lt;integer&gt;3221225472&lt;/integer&gt;   &lt;key&gt;BAInitialDownloadRestrictions&lt;/key&gt;   &lt;dict&gt;          &lt;key&gt;BADownloadDomainAllowList&lt;/key&gt;          &lt;array&gt;                 &lt;string&gt;*.drive.google.com&lt;/string&gt;          &lt;/array&gt;          &lt;key&gt;BADownloadAllowance&lt;/key&gt;          &lt;integer&gt;2147483648&lt;/integer&gt;   &lt;/dict&gt; &lt;key&gt;BAManifestURL&lt;/key&gt; &lt;string&gt;https://drive.google.com/file/d/1doJtzxBKCoVHEF80sndK6VskCrkD9H9r/view?usp=sharing&lt;/string&gt; What else needs doing to provide the extension identifier the OS is saying is missing? (Using Xcode 14.1 and iOS 16.2)
2
0
1.9k
Nov ’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
550
Nov ’22
VPN causes developer cert in keychain to become untrusted
After not happening to me for a few months, this issue has started hitting me again with currently %100 reproducability. If turn on VPN on my Mac then instantly the developer certificates within the keychain become untrusted. But that's not all, if VPN is then turned off the certificates do not revert to their trusted status but remain untrusted. The consequence of this is that if VPN is turned on and then a build is perform, it fails, and the only way to fix things is to delete the cert(s) from they keychain and re-install them. As a remote worker, having this happen several or even dozens of times a day is incredibly annoying and frustrating. This issue has been occurring for literally years, sometimes it occurs very often, others while its quiet for a while, and has spanned multiple versions of Xcode and Mac OS. So whatever the cause is its endemic. It doesn't just affect myself, but all the members in my development team. I'm currently using Xcode 14.1 RC 2 and Monterey but I've seen this issue occur with many versions of Xcode and Mac. (I'm using Cisco AnyConnect Secure Mobility Client). If the VPN is somehow interfering/affecting the connectivity aspect when an attempt is made by Xcode to validate the certificate, then why does it not rectify itself after turning off VPN? This is so so so so annoying. Can somebody please comment on why this happens and if there's a way to prevent it.
5
1
3.4k
Nov ’22
So its not possible for an app to have more than one action extension?
I added two actions extensions to my app, however if from the iPhone's call history, Share Contact is selected, then Edit Actions, then only one of the action extensions is visible (they both have the same NSExtensionActivationRule, but the intention being they'll have different action names and perform different actions). So presumably, having more than one action extension just isn't possible. Could somebody please confirm if that is the case or not.
0
0
496
Oct ’22
Why do some call blocking apps have multiple call extensions instead of just one?
Truecaller uses 4 call extension, Hiya has 3 and RoboKiller has 2. But why? There's no limitation or lack of functionality from just using one, why have multiple with the additional complexity of managing multiple ones within the app. I can't think of any possible reason for this, so I'm mystified why so many call blocking/identification apps have lots of them. Are they storing data in a database which doesn't support lazy loading / the ability to read a set of data in chunks, so instead they create multiple databases?
0
0
566
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
iOS 16.1 is setting Personal Focus Smart Activation to be on by default - is there a way an app can detect if a focus mode currently active or not
As a user, I've been hit several times missing calls and notifications when I was expecting them. I've just figured out why that is - its because iOS 16.1 is automatically setting Smart Activation to on for Personal Focus. So I kept missing phone calls because the iPhone had been turning on Personal Focus when I was unaware it was. As well as blocking calls, it also doesn't display any notification. (I never use this focus feature, I didn't even know it existed until now, so for it to be enabled by default is absolutely ridiculous behavior. This is iOS 16.1 beta yet but its so close to the release date of 16.1 it must be the final behavior). Now with my developer hat on, I would like my application to detect if notifications are being suppressed due to a focus's do not disturb. Is there an API available for an app to determine if a notification has not been displayed to the user due to this for non communication type apps? Just a regular app that receives user-directed push messages and needs to know if they were displayed to the user.
0
0
1.4k
Oct ’22
How to view TSIs?
In this section of this web site https://developer.apple.com/account/#CodeLevelSupportCard its possible to view a historical list of submitted TSIs, but there's nothing in their content which is clickable. Looking around elsewhere, there doesn't appear to be anywhere or anyway to view the original question and the responses in submitted TSIs? Is that really the case, or is there a bug in the Apple web site and they are supposed to be viewable?
2
0
1.5k
Oct ’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
507
Sep ’22
Background Assets: how to add BAManifestURL | backgroundassets-debug tool doesn't do anything
I've added a background downloads extension to my app and added device console logging to every method in the placeholder code created by XCode, then installed the app to the phone. When I run the following command: xcrun backgroundassets-debug --app-bundle-id com.myCompany.myApp  --device-id 00008110-001E0DDA0AB8801E --simulate --app-update  and watch the console log - there's none of my logging from within the extension. In the OS log I can see this: error 11:24:41.550702-0700 backgroundassets.user Event (1) dropped for client () failed because client Info dictionary is missing its 'BAManifestURL' key. The template generated code says this: "The manifest that is downloaded is determined by BAManifestURL defined in the application's Info.plist" So I tried adding a key of BAManifestURL with a url hoping to initially just get the extension launching. But I still get the error saying the info dictionary is missing the BAManifestURL key. So exactly how should the BAManifestURL key value pair be added to the info.plist?
2
0
1.2k
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
959
Sep ’22