Mobile Core Services

RSS for tag

Use uniform type identifier (UTI) information to create and manipulate data that can be exchanged between your app and other apps and services using Mobile Core Services.

Posts under Mobile Core Services tag

5 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

UTI Conflicts, iOS
My iOS app wants to associate itself with a certain file extension, let's say .aaa. To do so I declare the following exported type: <dict> <key>UTTypeConformsTo</key> <array> <string>public.data</string> </array> <key>UTTypeDescription</key> <string>AAA File</string> <key>UTTypeIdentifier</key> <string>com.myapp.aaa</string> <key>UTTypeTagSpecification</key> <dict> <key>public.filename-extension</key> <array> <string>aaa</string> </array> </dict> </dict> As well as this under the supported document types: <dict> <key>CFBundleTypeExtensions</key> <array> <string>aaa</string> </array> <key>CFBundleTypeName</key> <string>AAA File</string> <key>LSItemContentTypes</key> <array> <string>com.myapp.aaa</string> </array> <key>LSHandlerRank</key> <string>Owner</string> </dict> Turns out, several other apps on the App Store also register the .aaa file extension, each under a different UTI, making it impossible to open .aaa in my app if they installed it after already having installed another app claiming this extension. Moreover, some of these app declare all of their supported file extensions under a single UTI (e.g. both .aaa and .bbb are associated with the com.theirapp.generic UTI), so I can't even add their UTI to LSItemContentTypes without associating myself with files I don't support. How do I force iOS to allow opening every file with the .aaa extension with my app, regardless of any potential third-party app registering the same extension? For clarification – the .aaa file extension in this example is always associate with a single type and format, but it doesn't have an agreed-on UTI identifier or MimeType, nor is there a single app that should be the sole "exporter" of the UTI type.
2
0
148
1w
Detect iPhone unlock / lock
I am trying to create an iOS app where I need to immediately know when the iPhone is unlocked. Let's say I want to print a log on the Xcode console whenever the phone is unlocked. From my app, how do I detect if the phone is unlocked? Some code pointers will be highly appreciated. I am a newbie in iOS/APP development. It should work even if my app is not running. Is it even possible to do so?
3
0
224
3w
Implementing A Direct Link to App Settings
Howdy, I have a ***** feeling that the answer to my question is "Y'all cain't do that!", but I figure I'll ask, anyway. THE SAD STORY (GET YOUR HANKY): We have an app that implements Sign [up|in] with Apple. It does it pretty well, with no password visible to the user, and a pretty smooth UX. The issue is what happens when users bork their install. We don't think it will happen often, but want to be able to give the user the best way out, if possible. With the regular (non-SiiA) method, they bonk on a "Forgot Password" button, and the app sends them a new password. We can't do that, with SiiA. The password is stored in the app (in the keychain, so it's very persistent, and shared across devices), and it would a Very Bad Security Hole, to allow users to simply send a new password to the server (the other method generates a rando in the server), which is what would happen, with our method of handling the password. It would also be equally bad, if the server could simply send a new password to the user, directly to their device (the other method sends an email, based on the sign-in information on the server). So the user needs to delete their keychain data completely, which we can easily do, but that does not deal with their SiiA stuff, stored on Apple's server. This is what Apple tells us to do, to delete that. WHICH BEGS THE QUESTION: My question is: Is there a URL scheme that I can use to directly open that panel? If so, it would allow us to create a screen that helps the user to do all the deletions (on the device, our server, and the Apple server).
3
0
349
3w
File Sharing: ‘Open in App’ option is not available along with Share extension from iOS 16 and above
Hi, My iOS app used to import say abc.xyz file using ‘Open in App’ option which is achieved using Uniform Type Identifiers(UTI). This abc.xyz file was attached and shared via an email client. [Note: My app also has Share extension to import other file type] Upto iOS 15, When I try to import this file to my app I can see 2 options(Expected behaviour): Open in app Share with app But from iOS 16 and above(latest iOS 17 beta 4), I can only see below option, Share with app To debug further, I created a project(iOS 17 beta 4) and added UTI support for abc.xyz file format(Same as above). When the same file is attached in email client and try to import to app, I can see below option, Copy to app When this file is saved locally(on device) and later try to import from the Files folder, I can see below option, Open in app But the moment I add Share extension(Which is the requirement of my app), the only option to import file is Share with app From the above observation my queries are, Why there is behavioural change from iOS 16 and above when showing the options to import file ? Has “Open in app” option removed when Share extension is present in app from iOS 16 and above ? Does that mean when Share extension target is added in project the only way to import files is via Share extension from iOS 16 and above ? Or can you please suggest if any extra parameters to be added to info.plist from iOS 16 and above to support both options i.e., Open in app & Share with app ?
0
1
872
Aug ’23
ESIM: Always taken to unknown state for iOS 14.0, where it work perfect for iOS 13.0
I work for one of the networks. I am able to successful download the eSIM in iPhone for iOS 13.*. Where I was taken to unknown state (CTCellularPlanProvisioningAddPlanResult) in iOS 14.0 always also it prompt the os screen to install eSIM("Set up Mobile Plan") Please let me know why it take to unknown state always and why OS screen popup ?, please let me know if any configuration needed specific for iOS 14.x Also attached the configuration & prototype code for your reference       hud.show(animated: true)       let plan = CTCellularPlanProvisioning()       self.request = CTCellularPlanProvisioningRequest()       self.request?.address = "" // SMDP Address       self.request?.matchingID = ""  // Acitvation code.       if let validRequest = self.request {         weak var weakSelf = self         plan.addPlan(with: validRequest) {[weak self] result in           self?.hud.hide(animated: true)           switch result {           case .success:             weakSelf?.alertMessageToUser(title: "Hurray !...", message: "ESIM Downloaded Successfully")             print("Successful")           case .fail:             print("ESIM Download failed, contact your carrier")           case .unknown:             print("Unknown details, contact your carrier")           @unknown default:             print("Unknown details, CONTACT CARRIER")           }         }       }     } <array> <dict> <key>MCC</key> <string></string> // Country Code <key>MNC</key> <string></string> //Network Code </dict> </array>   <key>com.apple.security.network.server</key>   <true/>   <key>com.apple.security.network.client</key>   <true/>   <key>com.apple.CommCenter.fine-grained</key>   <array>     <string>spi</string>     <string>sim-authentication</string>     <string>identity</string>   </array>   <key>com.apple.wlan.authentication</key>   <true/>   <key>keychain-access-groups</key>   <array>     <string>apple</string>     <string>com.apple.identities</string>     <string>com.apple.certificates</string>   </array>   <key>com.apple.private.system-keychain</key> I am successful in download eSIM to iPhone for 13.*, Where I was getting the below error for iOS 14.0.1 Logs(OSACTIVITYMODE enabled) Remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated from this process." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated from this process.} BackTrace thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1frame #0: 0x0000000104cf9428 My Optus`closure #1 in ViewControllerTwo.installESIM_1(result=unknown, self=0x0000000107904d80, weakSelf=0x0000000107904d80) at ViewControllerTwo.swift:44:25  frame #1: 0x0000000104cf99a4 My Optus`thunk for @escaping @callee_guaranteed (@unowned CTCellularPlanProvisioningAddPlanResult) -> () at <compiler-generated>:0   frame #2: 0x0000000194fe412c CoreTelephony`__60-[CTCellularPlanProvisioning addPlanWith:completionHandler:]_block_invoke + 28   frame #3: 0x0000000195053268 CoreTelephony`__90-[CoreTelephonyClient(CellularPlanManager) addPlanWith:appName:appType:completionHandler:]_block_invoke + 36   frame #4: 0x0000000105077b68 libdispatch.dylib`_dispatch_call_block_and_release + 32   frame #5: 0x00000001050795f0 libdispatch.dylib`_dispatch_client_callout + 20   frame #6: 0x0000000105088890 libdispatch.dylib`_dispatch_main_queue_callback_4CF + 1000   frame #7: 0x0000000194a271e4 CoreFoundation`CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 16   frame #8: 0x0000000194a213b4 CoreFoundation`__CFRunLoopRun + 2508   frame #9: 0x0000000194a204bc CoreFoundation`CFRunLoopRunSpecific + 600   frame #10: 0x00000001ab4a5820 GraphicsServices`GSEventRunModal + 164   frame #11: 0x00000001973c4734 UIKitCore`-[UIApplication _run] + 1072   frame #12: 0x00000001973c9e10 UIKitCore`UIApplicationMain + 168   frame #13: 0x0000000104cfb688 My Optus`main at AppDelegate.swift:12:7   frame #14: 0x00000001946e7e60 libdyld.dylib`start + 4
8
0
4.4k
Jun ’23