Post

Replies

Boosts

Views

Activity

How should you programatically add a contact so it remains only on the device and isn't synched to iCloud?
I want to programmatically add a contact, preferably within its own group, such that it remains only on the (iPhone) device local copy of contacts and doesn't get synched elsewhere. However if I programmatically create a group then the group itself appears in iCloud, so presumably contacts within it will to. What sort of arrangement of containers/groups/contacts etc. should I create to achieve this?
0
0
1.3k
Jan ’23
"ITMS-90338: Non-public API usage - The app references non-public selectors" issue still present when uploading to TestFlight, except now its preventing builds from appearing
While attempting to upload my app to TestFlight (which has already been uploaded numerous times, including just a few days ago with the same code base) there is this error "TMS-90338: Non-public API usage - The app references non-public selectors in : _isKeyDown, _modifiedInput, _modifierFlags....." Nothing new there, that's been happening for months for myself and countless others and has been reported numerous times, i.e. https://developer.apple.com/forums/thread/127678?answerId=715975022#715975022 https://developer.apple.com/forums/thread/714450 But now there's a difference - in the past the builds always appeared in Testflight after getting this warning, so it wasn't an issue. But now that's changed, the build is no longer appearing in Testflight, so it suddenly is a very big issue.
3
0
895
Feb ’23
What size image should be added to a contact such that it appears in full screen mode on the incoming call screen?
I'm programmatically adding a contact with an image with the intention the image should display in full screen size when a caller matching the number of the contact calls (as opposed to the image appearing as a tiny round icon next to the caller name). I'm creating an image of the same size and scale factor as the iPhone, and so far its working out ok - I have about 15 different phones, of various dimensions and scale factors, ranging from an old iPhone mini up to the most recent iPhone Pro Max, and on all of these it works as intended. But there's an exception, an iPhone 12 Pro (which has dimensions 390 * 844 and scale factor 3), on this phone when there is a call the contact image appears as a tiny icon. Why. Why is this phone different? How can I know what size image should be added to a contact to appear at full size in the call screen when every phone has different dimensions and they are not behaving the same? Additional question - the iPhone applies some cropping and expansion to whatever image gets added, is it possible to know what's being done to the image in order to make it display perfectly? (i.e. if the image contains some text, the fact the OS crops away some of the edge of the image, then expands what's left to fill the screen dimensions results in some pixelation)
0
0
617
Feb ’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
Xcode 14.3 fails creating an archive if it contains a pod
This takes 2 minutes to recreate: Create a new project in XCode Run pod init to create a pod file Add some pod to the pod file, I tried with MMWormhole or PhoneNumberKit or Realm Run pod install The app can be built however an archive cannot, it generates an error: rsync error: some files could not be transferred (code 23) at /AppleInternal/Library/BuildRoots/97f6331a-ba75-11ed-a4bc-863efbbaf80d/Library/Caches/com.apple.xbs/Sources/rsync/rsync/main.c(996) [sender=2.6.9] Switch to Xcode 14.2 however and the archive can be built
0
0
615
Apr ’23
How does Robokiller deep link into Settings, are they using a private URL scheme?
An app can legally link into its own section of the Settings app, and if it uses CallKit, it can link into the Call Blocking & Identification section. Linking anywhere else into Settings is making use of private URL schemes and is supposed to not be permitted and the app rejected during submission. However the Robokiller app deep links into the Settings app with the page scrolled down to where the Phone section is. How are they doing that? Is there some new API that permits the app to link to there? Or are they making illegal use of private URIs and have been getting away with getting past App Store review for years?
0
0
359
Apr ’23
How have I been able to make Ad-hod builds/upload to App Store Connect without a distribution certificate
I intentionally deleted iOS development/distribution related certificates from my keychain (Login, Local Items, System, System Roots). Then built my app in Xcode. Automatically manage signing is turned on and Xcode created/installed an Apple Development certificate to my keychain). But if I create an archive, I am able to successfully create a development distribution, an ad-hoc distribution, and even upload to App Store Connect. Yet I don't have a distribution certificate anywhere in my keychain. I therefore don't understand how this was possible. How could I create all those distributions without a distribution certificate in the keychain?
0
0
336
Apr ’23
Read only container error attempting to create a contact group
Without exception, every single code example/tutorial for adding a contact group uses a nil container value i.e. the toContainerWithIdentifier parameter is nil, as below. I've not been able to find an example usage where it isn't nil. let group = CNMutableGroup() group.name = "whatever" let saveRequest = CNSaveRequest() saveRequest.add(group, toContainerWithIdentifier: nil) do { try store.execute(saveRequest) } catch { handle error } I've been running this code and 99.9% of the time it works as expected. However on one handset the catch is being executed with Error Domain=CNErrorDomain Code=207 "Container is read-only" How should I deal with this? How can I find out what container it is being added to? Why would it be read only? If nil means add to the default container, why is the default container in this case read only? How can I change the code that it will always run on every device? I've not been able to find any examples/tutorials for creating a custom container to which the group can be added.
0
0
753
May ’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
lipo command doesn't work with .xcframeworks
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
0
0
849
May ’23
Xcode 15 - Can't launch console for iPhone
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).
0
0
629
Jun ’23
Unable to retrieve contacts from a linked Exchange account
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") } }
0
0
658
Jul ’23
Any logging library that can enable a shared log file between the app and app extensions?
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?
0
0
385
Jul ’23
When does a notification service extension process get terminated?
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?
1
0
618
Jul ’23