The previous betas have all been ok, but beta 6 is for me totally and utterly unusable because it keeps hanging forever during the installation and attaching phases when trying to run an app (attached physically via cable, not bluetooth).
The first time or two of making a code change, then running, its ok, but then its guaranteed to hang eventually, it gets stuck on the "Installing app to iPhone" phase. If I restart the phone and try again it might get past that, but then it just gets stuck on "Waiting to attach to app on iPhone" phase.
I know its beta software and not expected to be perfect, but its unusable and previous beta versions are no longer available to rollback to.
Has anybody encountered this before and knows of any tricks to get it to stop hanging and load/run the app? (Restarting Xcode, restarting the phone, re-building, does not fix it for me)
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I've been successfully using CXProvider.reportNewIncomingVoIPPushPayload() as follows:
a (non VoIP) push is sent to the handset
this is intercepted by a notification service extension
the extension calls CXProvider.reportNewIncomingVoIPPushPayload() (the extension has the required com.apple.developer.usernotifications.filtering entitlement)
this results in the app delegate's implementation of PKPushRegistryDelegate:didReceiveIncomingPushWithPayload getting called (the app is launched if terminated)
This all works as expected, in particular when the app is terminated it still works.
However its suddenly stopped working since my phone got updated to iOS 16.6 (I can't remember exactly what was on it previously, 16.5 or 16.4).
Now with iOS 16.6 the behavior is that PKPushRegistryDelegate:didReceiveIncomingPushWithPayload() only gets called if the app is not terminated.
If the app is terminated then calling CXProvider.reportNewIncomingVoIPPushPayload() results in the app getting launched and didFinishLaunchingWithOptions() getting called BUT didReceiveIncomingPushWithPayload() is not called when launching from a terminated state.
As a consequence of didReceiveIncomingPushWithPayload() not getting called, the app isn't calling reportNewIncomingCallWithUUID() and so after a few runs the OS stops launching the app entirely saying: "Application will not be launched because it failed to report an incoming call too many times".
When didFinishLaunchingWithOptions() is called the launchOptions are nil, i.e. there is no way to distinguish the app from being launched as a consequence of reportNewIncomingVoIPPushPayload()(*) being called and therefore it is not possible to call reportNewIncomingCallWithUUID(). So this feature is totally broken apparently from previous behavior.
Any comment?
TIA
(*)Well actually, the extension could write a flag to a shared group and the app read that on launch, but what a hack, and should be unnecessary.
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)
In WWDC 2016 Session 230 (https://wwdctogether.com/wwdc2016/230) they show the incoming Voip call screen (at time 02.59) with an image covering the entire call screen. How is that achieved?
I've got a complex app extension and I'd like to be able to combine the logging from the app and the extension into a single file (for extraction/uploading etc.)
I experimented adding the following code to both the app and the extension i.e. using the same subsystem for both app and extension logging.
let subsystem = "mySubsystem"
let logger = Logger(subsystem: subsystem, category: "main")
logger.info("Log from within extension") // the version in the app says Log from within app
do {
let logStore = try OSLogStore(scope: .currentProcessIdentifier)
let oneHourAgo = logStore.position(date: Date().addingTimeInterval(-3600))
let allEntries = try logStore.getEntries(at: oneHourAgo)
let filtered = allEntries
.compactMap { $0 as? OSLogEntryLog }
.filter { $0.subsystem == subsystem }
}
The filtered content only contains logging from either the app or the extension.
I suppose the issue might be the use of .currentProcessIdentifier as the scope, however that's the only scope that is defined.
Is what is being attempted here possible? Is there any way to write to and extract a unified log for an app and app extension? If not, how about adding it, surely this would be something useful for people to be able to do
If there is the following code for a notification service extension
var countOfInvocations = 0
public class NotificationService: UNNotificationServiceExtension {
public override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
NSLog("Push count: \(countOfInvocations)")
countOfInvocations = countOfInvocations + 1
Then if pushes are sent to the handset it can be observed in the console log that the value of countOfInvocations keeps increasing, meaning the NotificationService class is getting instantiated and destroyed within the same process.
However at what point does that process get torn down by the OS? It seems to be kept alive for about 10 minutes or so. Is there a way the extension can detect its the same or a new process?
If you create a CallKit extension with Xcode 15 beta, then add some logging to the template code that gets created and run it on an iOS 17.3 beta phone the logging clearly shows that the OS is running the extension twice when the user turns on the extension in Settings. Run it on any device with < iOS 17 and its only invoked once, as it should be.
However, not only does the OS run it twice, but based on the logging the two invocations are in parallel, not serial, suggesting two CallDirectoryHandler instances are being created and run simultaneously.
My app has several app extensions and I'd like to be able to unify the logging between them such that they write to a single shared file (which can be read from and subsequently uploaded to things like Crashltyics or Bugsnag etc.)
Its possible to log directly to things like Crashlytics, however none of them I've investigated have a unified approach for the app and extensions (for example, if you use Crashlytics you have to configure the app and the extensions separately, so any logging goes to two entirely separate consoles.)
Hence, instead I'm wondering if there a library that provides the ability to log to a file, and that file can be shared and simultaneously written to (in the case where the app and its extensions are running simultaneously).
Do any of the existing log libraries for iOS have this ability?
If you go to https://feedbackassistant.apple.com and create a new feedback (for iOS and iPad) item, then these are the types of feedback choices:
Incorrect/Unexpected Behavior
Application Crash
Application Slow/Unresponsive
Battery Life
Suggestion
A suggestion sounds more like something an iPhone user want so suggest as a feature, not how a developer might request an API feature. Is that really what, as a developer, you are supposed to use to make a development feature request?
On my iPhone, in Settings, I've added my company Exchange account. Consequently, within the Contacts app, 4 new lists appear - the bottom as shown in the attached image.
There's a few thousand contacts in the Company Exchange account, so why are the count values showing as 0? If I click on the Global Address list and search, it can succfully find whatever I search for. I want to programatically retrieve the contacts within the Exchange account, in addition to those stored locally or within iCloud, however if I execute the following code, for the container of type exchange, the count of results of the call to unifiedContacts() is 0.
How can I programatically get the Exchange contacts? If the call to unifiedContacts() is resulting in 0 because the count for the lists when viewing the Contacts app is 0, then how to make it not 0 in the Contacts app (but if that were the case, how come manually searching for a contact is successful?)
let keysToFetch = [
CNContactFormatter.descriptorForRequiredKeys(for: .fullName),
CNContactPhoneNumbersKey,
CNContactEmailAddressesKey,
CNContactThumbnailImageDataKey] as [Any]
var allContainers: [CNContainer] = []
do {
allContainers = try CNContactStore().containers(matching: nil)
} catch {
print("Error fetching containers")
}
var results: [CNContact] = []
for container in allContainers {
let type = container.type
let identifier = container.identifier
let fetchPredicate = CNContact.predicateForContactsInContainer(withIdentifier: container.identifier)
do {
let containerResults = try CNContactStore().unifiedContacts(matching: fetchPredicate, keysToFetch: keysToFetch as! [CNKeyDescriptor])
let count = containerResults.count
results.append(contentsOf: containerResults)
} catch {
print("Error fetching containers")
}
}
You can programatically get/set a picture and a thumbnail for a contact, however the new poster field added to iOS 17 apparently has no programatic access? I'm not able to see anything new being added to CNContact.h
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() }
The Xcode 15 beta does not have a 17.* folder within Developer/Platforms/iPhoneOS.platform/DeviceSupport.
How therefore does it build/install/run on a a phone with iOS 17 installed? Is there a different mechanism for device support used from 17 onwards than has historically been the case?
I want to build/run using Xcode 14.n with an iOS 17 phone, but without being able to locate the iOS 17 support file am unable to do so.
Where is the iOS 17 device support files with Xcode 15? How can I build using Xcode 14 for iOS 17 if its not present in Xcode15 (in order to drag and drop it into Xcode 14)
With Xcode 15 if you attach an iPhone (with iOS 17 installed) and then select Window|Devices & Simulators, then you can see the connected iPhone of the left hand side of the organizer.
However with the iPhone selected, when the Open Console button is clicked it doesn't launch the console for the phone but instead for the Mac.
There's therefore no way to view the handset logs (you can see the app logs within Xcode as per usual, but you can't view the holistic handset logs).
In the past I've used lipo to remove unwanted architectures from fat frameworks, using lipo -remove.
However when attempting to do similarly with a .xcframework I keep getting errors, its not just the -remove command.
If for example I run lipo -info someFramework.xcframework then the error is:
can't map input file: someFramework.xcframework (Invalid argument)
if I cd into the xcframework and run
lipo -remove ios-arm64_x86_64-simulator
then the error is
unknown architecture specification flag: ios-arm64_x86_64-simulator in specifying remove operation: -remove ios-arm64_x86_64-simulator