I have a simple Safari extension for iOS.
In its popup, I want a button that will open the app via a universal link.
I have this kind-of working, except that Safari opens the actual online destination of the link with a banner at the top saying "Open in the XXXX app" and an OPEN button.
What do I have to do to go directly to the app?
More generally, I know that if I copy-and-paste a universal link into the Safari address bar, Safari does the same thing - but it does go directly to the app from an <a href="...."> link.
In my app extension JavaScript, I set window.location. Presumably this is too similar to pasting into the address bar.
Is there some alternative to setting window.location that is more like clicking on a link and will go directly to the universal link's app?
Thanks.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I have a new app which requires iOS 16. App Store Connect wants me to upload screenshots of various sizes, mostly optional - but 5.5" with square corners and physical home button is required.
As I understand it, the only device that can run iOS 16 and that has a 5.5" screen is the iPhone 8 plus.
I have an iPhone 6 plus, which has the right dimensions, but it doesn't run iOS 16. The newer phones with physical home buttons (i.e. the SE 2 and 3) have 4.7" screens.
Apple won't sell me anything older than an iPhone 12, even refurbished. Do I need to buy an iPhone 8 plus from eBay? Is there something that I can do to prevent the app from running on this device, and thereby make this screenshot size not required?
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
iPhone
App Store Connect
I've been getting 500 error responses from the https://data.appattest.apple.com/v1/attestationData server for the last few hours. About half of requests complete OK and half fail.
Anyone else seeing this?
I've just downloaded Xcode 15 (3.18 GB), and when I start it it downloads "additional components". It's currently downloading "iOS 17.0 Simulator" (7.56 GB).
I don't need the simulator, but I do need to compile for iOS and run on devices. Do I need this "simulator" download?
I note that while the small download progress window says "iOS 17.0 Simulator (21A328)", the main Xcode window won't let me compile/run the project because it is "Downloading iOS 17.0..." - though I'm not sure if the "..." at the end of that is a truncation eliding the word "Simulator".
NSString* fmt = [NSDateFormatter dateFormatFromTemplate: @"yyyy-MM-dd HH:mm:ss"
options: 0 locale: [NSLocale currentLocale]];
My understanding is that this should rewrite the format string to something that reflects the users current settings. When I run it, it does seem to reflect the "24-Hour Time" setting under General -> Date & Time. But it doesn't reflect the "Date Format" setting under General -> Language & Region. It seems that the date format is always the default for the region set in General -> Language & Region -> Region. It also seems to insert an unexpected comma.
Specifically:
Region=US, fmt="MM/dd/yyyy, h:mm:ss a"
Region=UK, fmt="dd/MM/yyyy, h:mm:ss a"
irrespective of the "Date Format" setting. What's going on?
I have been trying to tidy up my Mac's storage which is getting full. (See also my other question about "bridgeOS".)
In Settings -> General -> Storage -> Developer there were numerous multi-gigabyte items for different versions of iOS. Most of them were for point releases that I no longer have on my devices, which auto-update. For example I think I had 17.0, 17.1.1 and 17.1.2; my dev iPad and iPhone are both now running 17.1.2, so I deleted the others.
But now when I try to run, XCode complains that "iOS 17.0 is not installed".
Does this mean that iOS 17.0 device support is required in addition to iOS 17.1.2, in order to run on a 17.1.2 device?
This would make sense if it just said "iOS 17", rather than "iOS 17.0".
I'm referring to the use of a "settings bundle" plist to cause the main Settings app to display your app's preferences which the app can then read via NSUserDefaults, as described here:
https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/UserDefaults/Preferences/Preferences.html#//apple_ref/doc/uid/10000059i-CH6
I am wondering if this is actually deprecated, or something. I ask because, (1), it still has the high-quality old-style documentation, and (2) there doesn't seem to be a "required reason API" code for using it.
Specifically, the NSUserDefaults required reason API codes are
CA92.1 : "This reason does not permit reading information that was written by other apps or the system"
1C8F.1 : "This reason does not permit reading information that was written by apps, app extensions, or App Clips outside the same App Group or by the system."
C56D.1: "...third-party SDK..." - nope.
AC6B.1: "... com.apple.configuration.managed ..." - nope.
None of the codes permit reading preferences that have been set by the Settings app using this method.
Has anyone successfully completed DSA compliance phone number verification using the "receive a phone call" option?
It seems that Apple first tries to send an SMS. You then have the option to resend another SMS, to receive a phone call, or to upload documents. When I choose to receive a phone call, it seems that the Apple system calls me but it hangs up without reading out a code.
Has anyone got this to work?
Does anyone have recent experience of what App Review consider acceptable for location purpose strings these days?
My map apps simply display a blue spot on the map showing your current location when you turn on the app's location button. That data doesn't leave the app; I'm not selling it to anyone, or doing anything nefarious. For years, I've had concise location purpose strings such as "Your location will be shown on the map".
Now, App Review seem to find that inadequate. They say: "One or more purpose strings in the app do not sufficiently explain the use of protected resources. Purpose strings must clearly and completely describe the app's use of data and, in most cases, provide an example of how the data will be used. Next steps: Update the ... location purpose string to explain how the app will use the requested information and provide an example of how the data will be used. "
I've just look at what Apple Maps uses as its purpose string, and it's just "Your location is used to show your position on the map, get directions, estimate travel times, and improve search results." I'm only doing the first of those things, so surely "Your location is used to show your position on the map" would get approved, right? Wrong!
I have similar issues with the photos purpose string.
Topic:
App Store Distribution & Marketing
SubTopic:
App Review
Tags:
App Review
Privacy
Core Location
Does anyone know how battery state notification (UIDevice.batteryStateDidChangeNotification) is supposed to work regarding app foreground/background state?
Assume there is no other reason why the app is running in the background. I have enabled UIDevice.current.isBatteryMonitoringEnabled when the app was in the foreground. What should happen if the external power is later connected or removed when the app is in the background? The docs don't mention this.
Possibilities include
I don't get a notification, so I should check the state myself when the app next comes to the foreground.
I'll get a notification when the app next comes to the foreground, if the state changed while it was in the background.
The app will be woken up in the background to receive the notification.
The app will be kept running in the background while isBatteryMonitoringEnabled is true.
It looks as if it's doing either 3 or 4, which I find a bit surprising. But is this influenced by the fact that it's connected (wirelessly) to the debugger?
Is there a way to determine whether the current device has a physical home button or not?
I am building part of a UI which is very much like the Files app - it has buttons for "iCloud Documents" and "Documents on this device". For the latter, it will use a suitable symbol from SF Symbols i.e. "iphone" or "ipad" (or something for Macs). Just like the Files app.
But I notice that the Files app uses the ".homebutton" symbol variants on older devices that have a physical home button. What is the easiest way to replicate that?
I was considering looking at the "iPhoneNN,M" string and comparing it with the model number of the first devices without a physical button, but that is complicated by e.g. the current iPhone SE, which is "iPhone14,6". I don't want to have to maintain a table.
Is there some easy way to do this?
Thanks.
Dear Experts,
Xcode 14 is giving me a new deprecation warning about sprintf.
I understand why this is here (*) but I need to suppress it in some cases. I don't want to disable it everywhere (or lose other deprecation warnings).
Specifically, I #include some Boost headers which use it in inline functions. I know that I can use #pragma to disable it, but I don't want to modify the Boost headers. Adding #pragma everywhere that I #include a Boost header is also unappealing.
What other options do I have?
(*) I'm not enthusiastic about the suggesting in the warning to use snprintf instead; snprintf leaves the destination unterminated on overflow, which can be just as bad as the sprintf behaviour.
Dear Experts,
I'm attempting to make a custom icon appear in the iOS Files app, etc., for my file type. I've found a couple of bits of documentation for Info.plist keys:
https://developer.apple.com/documentation/bundleresources/information_property_list/utexportedtypedeclarations/uttypeiconfiles describes UTTypeIconFiles, to be included in UTImportedTypeDeclarations. This documentation is very sparse!
Older document https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/TP40009249-SW9 describes CFBundleTypeIconFiles, to be included in CFBundleDocumentTypes.
Which of these should I be using? (Both? Neither?)
Nothing I've tried so far has worked. I wonder if I need to, for example, power-cycle to make the Files app pick up the new icons.
Also, in Xcode, I've found the Imported Type Identifiers section of the Info settings which has a box labelled "Add imported type identifiers here" - but clicking + and choosing a file does nothing; the box remains empty. Anyone else have that problem?
What size should the icons be? The older document suggests some rather small sizes, e.g. 22x29; the newer doc says nothing.
Suggestions anyone?
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
iOS
Xcode
Uniform Type Identifiers
Core Services
Dear Experts,
PHAsset.creationDate is an NSDate, which does not have a timezone associated with it, right?
Consider a photo viewer app. If I take a photo of the sunrise at 0600 local time while I am away, when I get home and view the photo in the app, I believe I want the timestamp shown with the photo to be 0600. Do you agree?
But NSDate is just a time-point, and I don't think Foundation (or anything else in iOS) has a type that combines a time-point with a time zone. Nor does PHAsset have any other useful attributes - unless I were to determine the time zone from the location!
Am I missing anything?
Dear All,
My iOS app used to work OK on macOS, but since a macOS update in-app purchases have stopped working. It seems that the storekitagent process is no longer able to save the receipt to the filesystem. Here is what I see in the system log after I do a "refresh receipt":
default 22:03:47.822657+0100 storekitagent [58C16E76_SK1] Writing receipt (83905 bytes) to file:///Users/phil/Library/Containers/0407ACA7-9EE2-4E32-AA3E-101A1B38EE70/Data/StoreKit/sandboxReceipt
error 22:03:47.823539+0100 kernel Sandbox: storekitagent(1382) deny(1) file-write-unlink /Users/phil/Library/Containers/0407ACA7-9EE2-4E32-AA3E-101A1B38EE70/Data/StoreKit/sandboxReceipt
error 22:03:47.824306+0100 storekitagent [58C16E76_SK1] Error writing receipt (83905 bytes) to file:///Users/phil/Library/Containers/0407ACA7-9EE2-4E32-AA3E-101A1B38EE70/Data/StoreKit/sandboxReceipt: Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “sandboxReceipt” in the folder “StoreKit”." UserInfo={NSFilePath=/Users/phil/Library/Containers/0407ACA7-9EE2-4E32-AA3E-101A1B38EE70/Data/StoreKit/sandboxReceipt, NSUnderlyingError=0x145c19f80 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}
Note that is a sandboxReceipt on my development system, but I have a report from a user who seems to be suffering the same problem with the app store version of the app.
Is anyone else seeing this?
Is there a "quick hack" I can do to grant the storekitagent process permission to write to that folder?