Delve into the world of built-in app and system services available to developers. Discuss leveraging these services to enhance your app's functionality and user experience.

Post

Replies

Boosts

Views

Activity

SMJobSubmit works in user domain, but cannot be submitted in system domain
Hi, I'm in the process of creating an App + Helper Tool combo application, and depending on the necessity of root privileges, I'm setting up two paths in the app: If root privileges are not necessary, I'm using SMJobSubmit rather directly: var submissionError: Unmanaged<CFError>? let submissionResult = SMJobSubmit(kSMDomainUserLaunchd, plist, nil, &submissionError) where plist contains these items: Label=com.***.redactedApp.redacted, ProgramArguments=[path/to/helper-tool, commandName, commandArg1, commandArg2] RunAtLoad=1, KeepAlive=0 and it works as necessary, and performs the operations. Now, in the case of privilege escalation being necessary, this call becomes a bit more complex: let authorization = SFAuthorization() var authRef: AuthorizationRef? do { try authorization?.obtain(withRight: kSMRightModifySystemDaemons, flags: [.extendRights, .interactionAllowed]) authRef = authorization?.authorizationRef() } catch let error { // Logging error } var submissionError: Unmanaged<CFError>? let submissionResult = SMJobSubmit(kSMDomainSystemLaunchd, plist, authRef, &submissionError) while using the same plist, same executable at the same path, same Label. However, when using the second path, suddenly SMJobSubmit fails: Error Domain=CFErrorDomainLaunchd Code=2 "(null)" Now, naturally I headed over to system logs in Console.app, and this is the weirdest - there is nothing suspicious near the log item I submit with the above error from the main application. The tool is embedded in the Contents/MacOS folder. However, my problem is that anything that I can think of seems to lead to the same thought: it should be a problem in both cases, not just the privileged one. Is there something extra that must be taken care of when using SMJobSubmit with privileged helper tools?
3
0
112
1d
Issues with ApplicationTokens After Transferring an App Using FamilyControls Framework
I am encountering an issue after transferring an app that uses the FamilyControls framework to a different app account. After releasing a new version of the app post-transfer, the following problems arose: ApplicationTokens obtained in the pre-transfer version no longer function when used with ManagedSettingsGroup.ShieldSettings in the post-transfer version. Using the same ApplicationTokens with Label(_ applicationToken: ApplicationToken) does not display the app name or icon. These issues did not occur in the pre-transfer version and everything worked as expected. We suspect that ApplicationTokens obtained prior to the transfer are no longer valid in the updated app released under the new app account. We are seeking guidance on the following: Is this expected behavior after transferring an app to another app account? What steps should we take to ensure that ApplicationTokens obtained before the transfer remain functional in the post-transfer environment? If these tokens are invalidated due to the transfer, what are the recommended procedures for regenerating or updating ApplicationTokens for existing app users? Maintaining a seamless user experience after transferring the app is critical. We would greatly appreciate any insights or guidance. Please let us know if additional information or logs would assist in investigating this issue. Thank you!
0
1
37
2d
Embedding automation command line tool into an AppStore app
I am developing a macOS word-processing app that should be distributed via the Apple App Store. Some of the app's functions like generating HTML and PDF exports should be automatable via Shortcuts and via shell scripts. To support the latter, I plan to include a command line tool inside the app that can be called from the Terminal or a shell script. The tool should be able to instruct the main app to then perform the desired commands. A well-known AppStore app that uses this design is BBEdit which also contains multiple command line tools that offer functionality from the main app to users of the Terminal. My technical questions now are: Should the command line tool executable be sandboxed and if yes, how? Even after many trials, I have not found a way to make a working sandboxed command line tool. If a sandboxed tool is started from the Terminal, it is immediately terminated with an exception in _libsecinit_appsandbox.cold.12. I am aware of the Apple developer documentation article Embedding A Helper Tool In A Sandboxed App, but it addresses a different architecture in which the helper tool is started from the main app and therefore is able to inherit its sandbox. BBEdit is only sandboxing the main app, but not its embedded command line tools and is still allowed in the App Store. Is this the way to go for me as well or does BBEdit get some special treatment in the App Store? How can the command line tool pass the permission to access files to the main app? As my main app is sandboxed, it needs explicit permission from the user to be able to access files. Users of a command line tool give this permission by providing file paths as arguments. How can I pass these permissions along to the main app? BBEdit is able to do this even when the user has not given it full-disk access. I know that it is using Apple Events for the communication between the command line tool and the main app, but I am not sure how this allows to pass permissions. Can anyone shed light on how to implement a solution here? Thanks!
0
0
77
2d
Getting ASAuthorizationError 1004 (notInteractive) when testing web credential sharing with Apple sample app
Using both the Apple sample app for passkeys (link below) and another barebones sample app from github (link below), we are getting this same error when trying to retrieve a user's passkey that has been created from our website associated with the sample app: ASAuthorizationController credential request failed with error: Error Domain=com.apple.AuthenticationServices.AuthorizationError Code=1004 "(null)" Error: ["NSLocalizedFailureReason": Unable to verify webcredentials association of TEAMID.com.company.product with domain app.company.com. Please try again in a few seconds.] Note I have replaced TEAMID, the bundle id and the website id here, but the values match our site association file, which has this content: { "webcredentials": { "apps": [ "TEAMID.com.company.product" ] } } and is hosted at: https://app.company.com/.well-known/apple-app-site-association (returned with Content-Type: application/json header) The enum values for ASAuthorizationError.Code I believe are: canceled: 1000 failed: 1001 invalidResponse: 1002 notHandled: 1003 notInteractive: 1004 unknown: 1005 Thus we are getting notInteractive, which according to another forum post here, we should not be seeing. With both sample apps, I've made sure the request to perform authentication is triggered from a button press by the user. Can someone please help us figure out why we are getting this error? Xcode version: 16.2 MacOS version: 15.2 iOS version: 18.2 iPhone model: iPhone SE (MHGT3X/A) Link for Apple sample app: https://developer.apple.com/documentation/authenticationservices/connecting_to_a_service_with_passkeys Link for Github sample app: https://github.com/hansemannn/iOS16-Passkeys-Sample
1
0
65
2d
iOS18 - NSInternalInconsistencyException
Does any ont encountered such crash? It only occured on iOS18 device. Application Specific Information: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '_endUndoGroupRemovingIfEmpty:: _UITextUndoManager 0x30d3bca50 is in invalid state, endUndoGrouping called with no matching begin UserInfo:(null)' Pthread id: 2420148 Thread 0 Crashed: 0 CoreFoundation __exceptionPreprocess + 164 1 libobjc.A.dylib objc_exception_throw + 88 2 Foundation -[NSUndoManager endUndoGrouping] + 0 3 Foundation __NSFirePerformWithOrder + 296 4 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 36 5 CoreFoundation __CFRunLoopDoObservers + 552 6 CoreFoundation __CFRunLoopRun + 788 7 CoreFoundation CFRunLoopRunSpecific + 588 8 GraphicsServices GSEventRunModal + 164 9 UIKitCore -[UIApplication _run] + 816 10 UIKitCore UIApplicationMain + 340 11 application main (main.m:39) 12 (null) 0x00000001abfecde8 0x0 + 7180570088
1
0
80
3d
`user` not returned from Sign in with Apple REST API
I have tried everything to get the user field returned with Sign in flow and it never does, not for new users, not even if i create a new app! Working with Apple is so frustrating and you have to pay for it!! Referencing this page, I am using scope=name email. I have tried using + and %20 as the spacer and neither makes a difference. I have also tried setting response_type = code and code id_token (again with + and %20 as the spacer) which also doesn't make a difference. Always the id_token is returned and always the email, but never the user. https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_js/incorporating_sign_in_with_apple_into_other_platforms#3332115 AUTHORIZE REQUEST https://appleid.apple.com/auth/authorize? { "response_type": "code", "client_id": "com.example.service", "scope": "name email", "state": "77264297-813c-4738-83ef-f1b77daea04c", "redirect_uri": "https://example.com/auth/apple/callback", "code_challenge_method": "S256", "code_challenge": "2SJCneEpjKcN.....xIIHnpqcvjK_Y0s", "access_type": "offline", "nonce": "1734523662", "response_mode": "form_post" } TOKEN REQUEST https://appleid.apple.com/auth/token? { "grant_type": "authorization_code", "code": "c870aaec987a14.....dqakaGP4Yn1nH3dnPgww", "client_id": "com.hikesync.service", "client_secret": "eyJhbGciOiJFUzI....3izij6dojYfdV6JMdbQPx3sOA", "redirect_uri": "https://hikesync.com/auth/apple/callback", "code_verifier": "38hHUC....mYuE0zfYVNTycg" } RESPONSE { "access_token": "a2b70e12d38b446....4hA7-RLNj0ifU5Q", "token_type": "Bearer", "expires_in": 3600, "refresh_token": "rb4ed9be2b4024......w5RWjVFUQ", "id_token": "eyJraWQiOiJyQlJmV.......0Df0ihEJiA" } JWT { "iss": "https://appleid.apple.com", "aud": "SERVICE_ID", "exp": 1734606699, "iat": 1734520299, "sub": "000000.f7f7c0ac.....db9fad7e19.1111", "nonce": "NONCE", "at_hash": "NAfjmciTi2NtmPYIMAgjig", "email": "abc123@privaterelay.appleid.com", "email_verified": true, "is_private_email": true, "auth_time": 1734520297, "nonce_supported": true }
0
0
69
3d
Live Caller ID Extensions - EvaluationKey vs. Identifier-Based Queries and Automatic Refresh Timing
What determines whether the live caller ID call extension sends a /queries request with an EvaluationKey instead of an EvaluationKeyMetadata.Identifier? Is this behavior configurable through our app? In the live-callerid-lookup-example, the code checks if the PirRequest contains an EvaluationKey and uses it for evaluation if present; otherwise, it defaults to the uploaded key. However, during testing with the live caller ID extension, we observed that the client system (iPhone) consistently sends /queries requests using only EvaluationKeyMetadata.Identifier. Is it possible for the client to send queries with an EvaluationKey to reduce storage requirements? In the "Refresh the Data" section, it is mentioned that "The system periodically refreshes these parameters automatically." Could you provide more details on the specific timing or frequency of these automatic refreshes? For example, do factors such as Low Power Mode, power-saving mode, or a screen-locked state affect the frequency or occurrence of these updates?
0
0
56
3d
Transfer sub is different length
Hello. I'm preparing transfer app now but don't understand identifier length. reporence : https://developer.apple.com/documentation/sign_in_with_apple/transferring_your_apps_and_users_to_another_team 1 : xxxxxx.15fbexc6b31e41e78b891803a56b1axx.0247 2: xxxxxx.26ae9x5347f1f4fcebb3ae1b91807b5xx number 1 is The team-scoped user identifier number 2 is transfer identifier but length is different so i scared is it okay?
0
0
30
3d
Can anyone help?
I recently used Open core legacy patcher to update my old 2012 Macbook pro to run a new pice of dj software. the update went smooth but now the Dj software wont open just gives me a crash report. Im totally stumped. the crash report. Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_INSTRUCTION (SIGILL) Exception Codes: 0x0000000000000001, 0x0000000000000000 Termination Reason: Namespace SIGNAL, Code 4 Illegal instruction: 4 Terminating Process: exc handler [3839] Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 Engine DJ 0x10c9e3d81 0x10c28f000 + 7687553 1 dyld 0x7ff807632729 invocation function for block in dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const + 241 2 dyld 0x7ff80766b34e invocation function for block in dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const + 133 3 dyld 0x7ff80765fb73 invocation function for block in dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const + 543 4 dyld 0x7ff80761a07b dyld3::MachOFile::forEachLoadCommand(Diagnostics&, void (load_command const*, bool&) block_pointer) const + 249 5 dyld 0x7ff80765ebe8 dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const + 176 6 dyld 0x7ff807661266 dyld3::MachOFile::forEachInitializerPointerSection(Diagnostics&, void (unsigned int, unsigned int, bool&) block_pointer) const + 116 7 dyld 0x7ff80766b084 dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const + 390 8 dyld 0x7ff8076325c2 dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const + 150 9 dyld 0x7ff807638af7 dyld4::JustInTimeLoader::runInitializers(dyld4::RuntimeState&) const + 21 10 dyld 0x7ff807632928 dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&, dyld3::Array<dyld4::Loader const*>&) const + 276 11 dyld 0x7ff807636141 dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const::$_0::operator()() const + 147 12 dyld 0x7ff8076329bc dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const + 90 13 dyld 0x7ff80764e1f7 dyld4::APIs::runAllInitializersForMain() + 277 14 dyld 0x7ff80761f52e dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 3433 15 dyld 0x7ff80761e792 dyld4::start(dyld4::KernelArgs*, void*, void*)::$_0::operator()() const + 572 16 dyld 0x7ff80761e27f start + 1727 Thread 1: 0 libsystem_pthread.dylib 0x7ff8079a8bcc start_wqthread + 0 Thread 2: 0 libsystem_pthread.dylib 0x7ff8079a8bcc start_wqthread + 0 Thread 0 crashed with X86 Thread State (64-bit): rax: 0x00006000012acc80 rbx: 0x00006000032b3c90 rcx: 0x00006000012acd00 rdx: 0x000000011008e000 rdi: 0x0000000000000000 rsi: 0x00006000012ac000 rbp: 0x00007ff7b3c5a9f0 rsp: 0x00007ff7b3c5a9c0 r8: 0x0000000000000002 r9: 0x000000000000001b r10: 0x00000000001ff800 r11: 0x0000000000000080 r12: 0x000000010eeae278 r13: 0x000000010c28f6e8 r14: 0x00007ff84a461050 r15: 0x00007ff84a4614a0 rip: 0x000000010c9e3d81 rfl: 0x0000000000010207 cr2: 0x0000000000000000 Logical CPU: 2 Error Code: 0x00000000 Trap Number: 6
0
0
42
3d
Problems running the "Paloalto GlobalProtect" app on iOS iPhone
When connecting SSLVPN through the "Paloalto GlobalProtect" app on an iOS iPhone, I try to connect through my Google Workspace account. During this process, an error occurs when logging in after entering my Google account. The error is as follows. The Paloalto Networks TAC Support team recommends that you contact Apple Support. When connecting SSLVPN through the "Paloalto GlobalProtect" app on an Android device, I can log in normally with my Google account. It only doesn't work on iOS iPhones. ~/Downloads/GPSupportInfo/Agent.log:119: 2024-12-16 14:08:08.047 GlobalProtect[4402:1352815] Error: (ManagerUtils.mm:566) Send message failed: GlobalProtect, error: Error Domain=NEVPNErrorDomain Code=1 "(null)" ~/Downloads/GPSupportInfo/Agent.log:119: 2024-12-16 14:08:08.047 GlobalProtect[4402:1352815] Error: (ManagerUtils.mm:566) Send message failed: GlobalProtect, error: Error Domain=NEVPNErrorDomain Code=1 "(null)" ~/Downloads/GPSupportInfo/Agent.log:119: 2024-12-16 14:08:08.047 GlobalProtect[4402:1352815] Error: (ManagerUtils.mm:566) Send message failed: GlobalProtect, error: Error Domain=NEVPNErrorDomain Code=1 "(null)" ~/Downloads/GPSupportInfo/Agent.log:119: 2024-12-16 14:08:08.047 GlobalProtect[4402:1352815] Error: (ManagerUtils.mm:566) Send message failed: GlobalProtect, error: Error Domain=NEVPNErrorDomain Code=1 "(null)" Paloalto said that it is the same as the content of the Apple Developer Forum below and told me to contact Apple Support. https://developer.apple.com/forums/thread/25928 Please tell me how to solve this problem.
0
0
31
3d
MacOS Sequoia install error
Good day. Installed Sequoia Developer Beta. After that, the laptop started to behave incorrectly, programs over 1 GB stopped installing, updates were not installed, sometimes it rebooted spontaneously. Decided to roll back. With the help of another Macbook, I managed to install 14.6.1. Errors remained. Updates are not installed. Tried to restore through the recovery menu, error at 52 minutes, using a boot disk, the same error. What else can I do? Mac Book Pro M1 16gb/2tb
0
0
53
3d
Deep Link not working - what am I missing?
We’re trying to enable deep links for our application com.remonon.remonon. Only links that start with https://remonon.com/app/ should redirect to our app. I’ve closely followed the tutorial at https://developer.apple.com/documentation/xcode/supporting-associated-domains. Our apple-app-site-association is correctly placed at https://remonon.com/.well-known/apple-app-site-association and looks like this: { "applinks": { "details": [ { "appIDs": [ "25N8TLPALL.com.remonon.remonon" ], "components": [ { "/": "/app/*", "comment": "Only URLs under /app/ will be handled as deep links" } ] } ] }, "webcredentials": { "apps": [ "25N8TLPALL.com.remonon.remonon" ] } } Our *.entitlements looks like this: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>aps-environment</key> <string>production</string> <key>com.apple.developer.associated-domains</key> <array> <string>applinks:remonon.com</string> <string>webcredentials:remonon.com</string> </array> <key>com.apple.developer.default-data-protection</key> <string>NSFileProtectionComplete</string> <key>com.apple.security.application-groups</key> <array> <string>group.com.remonon.remonon</string> </array> </dict> </plist> Our apple-app-site-association was published two weeks ago to make sure apple’s caches were able to catch up in the meantime. Still, opening the link https://remonon.com/app/test on a real device with our app installed does not open our app but safari. A while ago, when all remonon.com-urls should open our app instead of only those which have the "app" path prefix, the deep links was working perfectly fine. What am I missing?
5
0
137
3d