Search results for

214 results found

Post

Replies

Boosts

Views

Activity

What size image to programmatically add to a contact such that it'll appear on the call screen nicely?
I want to programmatically create a contact with an image with the result that when the iPhone receives a call from the number associated with that contact its image will appear on the incoming call screen (occupying the full screen, not the little tiny icon variation). But I'm having a hell of a job trying to figure out what dimensions should be used for the image to add to the contact. If on the iPhone I take a screenshot and add that manually to a contact then make a call, then the call screen more or less displays the entire screenshot almost the same as the actual desktop. The call screen appears to be slightly magnifying the image. So whatever size the screenshot is should be close enough for the contact image. I've got an iPhone 14 pro and its UIScreen.main.bounds is 932 by 430. If I export an iPhone screenshot to a Mac, I can see its image size is 2796 by 1290, which is exactly 3 times the bounds size. So I created an image of size 2796 by 1290 and programmatically added it to a contact (using CNMutab
0
0
808
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
0
753
Dec ’22
A small number of testers never receive Testflight invites/redemption codes
There's about 20 internal testers on our Testflight account, but a couple of them just never ever receive the invites/redemption codes so its impossible to get them set set up to be able to test the app. They are added to the Internal Testing App Store Connect Users group, and I've also tried creating a new group and adding them to that as well as and instead of the App Store Connect Users group. These groups are added as testers of builds, and for the other 20 users their status says Installed but for a couple of testers their status always shows as Invited Resend Invite. The problem is, even if I click on Resend Invite an infinite number of times, these testers never receive anything. Never. Not after waiting an hour, 10 hours, a day, a week, a month. Click on click on click on Resend Invite and it does nothing, they never get anything. No emails are not going into their trash/spam folder. I've tried deleting the testers entirely from the entire developer account, and then when I re-add them back, then in t
0
0
715
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.c
1
0
1.5k
Jan ’23
Notification Service Extension doesn't free memory between invocations
I've got a notification service extension which uses quite a lot of memory when it runs. Its using UIGraphicsImageRenderer:image() to create an image based on the push payload, and that that is a very memory hungry function. When the extension receives a push it uses less than the 25MB memory limit for extensions and its successful and runs to completion. However the next push that gets receives crashes due to memory not being freed (it doesn't matter if several minutes elapses between pushes). After its crashed its successful once more (the action of it crashing must obviously be freeing up the memory, so after a crash there's enough memory to run again, but then the next push after that will crash and so on and so on). I've run the extension interactively in Xcode's debugger to observe this behavior, but it also happens when running independently of Xcode (and thus lifetimes of things aren't being kept alive by the Xcode debugger). As my extension has no control over the creation/destruction lifecycle of UN
0
0
794
Jan ’23
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
887
Feb ’23
Builds not appearing in Testflight
A few days ago I uploaded a build to Testflight successfully. Just now I made absolutely no changes whatsoever other than to increment the build number. This latest build doesn't appear in Testflight. Tell me this can't be anything other than a bug with Testflight, if a build from a few days was good enough to appear, then how come with no changes it no longer is.
2
0
512
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 ad
0
0
610
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.3k
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
610
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
356
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
329
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
740
May ’23