Posts under App & System Services topic

Post

Replies

Boosts

Views

Activity

Universal Link / AppLinks not opening the app
I am struggling getting universal links/applinks working for an App Store Event. I have been through the docs and various troubleshooting methods a number of times and cannot figure out why the universal link is not opening the app. Here's the apple-app-site-association file we have hosted on our website in .well-known (full url https://binaryformations.com/.well-known/apple-app-site-association): { "applinks": { "details": [{ "appIDs": ["com.BinaryFormations.UnderMyRoof"], "components": [{ "/": "/umrappevent/*", "comment": "Matches any URL whose path starts with /umrappevent/" }] }] } } Here's the configuration in the Associated Domains section in Xcode: I've also implemented scene(_ scene: UIScene, continue userActivity: NSUserActivity) in the window scene delegate. Just to see if it might solve the problem, I also implemented application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([any UIUserActivityRestoring]?) -> Void) -> Bool in the application delegate. I've been testing with this URL, among others, and the app is not being opened: https://binaryformations.com/umrappevent/9999 I've tried every troubleshooting technique I could find, including the once mentioned in TN3155 on debugging universal links (https://developer.apple.com/documentation/technotes/tn3155-debugging-universal-links) and everything seems to be as it should. Here's a summary of what I've tried so far: Checked that the CDN was returning the correct apple-app-site-association file: https://app-site-association.cdn-apple.com/a/v1/binaryformations.com Ran the following test with curl to verify there are no redirects (it returned with the response code of 200): curl -v https://binaryformations.com/.well-known/apple-app-site-association Using the above mentioned apple-app-site-association file as test.json, I randomly this test using swcutil and the URL seems to match fine: sudo swcutil verify -d binaryformations.com -j test.json -u https://binaryformations.com/umrappevent/9999 { s = applinks, a = com.BinaryFormations.UnderMyRoof, d = binaryformations.com }: Pattern "https://binaryformations.com/umrappevent/9999" matched. Associated Domains Development Diagnostics on the phone seem to indicate everything is okay with the URL: Last one: after installing a build from TestFlight on an iPhone (iOS 18), I see this in the swcutil_show.txt file from a sysdiagnose after trying the following link: https://binaryformations.com/umrappevent/9999 Service: applinks App ID: G52SXV33MH.com.BinaryFormations.UnderMyRoof App Version: 20240910.0 App PI: <LSPersistentIdentifier 0x4f8026100> { v = 0, t = 0x8, u = 0x474, db = 52D70E5E-2E19-4D2C-ADA7-1E6154CA1AFA, {length = 8, bytes = 0x7404000000000000} } Domain: binaryformations.com User Approval: unspecified Site/Fmwk Approval: denied Flags: Last Checked: 2024-09-11 15:36:17 +0000 Next Check: 2024-09-16 15:17:08 +0000 I'm sure I'm doing something silly that I just keep overlooking, but cannot seem to figure it out. Is there anything that's jumping out from all of this that I'm missing? Is there any way to get more information from the diagnostics as to why the rule was denied or anything else I should try? Thank you in advance.
2
0
4.9k
Sep ’24
A few questions on UWB on iOS
I’m thinking about making an app that requires two UWB things to work. I can’t seem to find anything about them and I haven’t got the money to just try it out. The questions are: how far can the iPhone be to a moving UWB chip to make a connection? can this work in the background? If so, is it intermittent? i need to be able to detect moving objects pretty reliably and have the app respond when it isn’t open. I guess a bit like the Covid tracking stuff. would the Apple frameworks allow for me to do this?
1
0
618
Sep ’24
Helper app is not relaunched after main app is updated from the Mac App Store
I have a macOS app that embeds a helper app in its bundle. That helper app is started by the main app, and from then on it runs independently. I noticed that after updating the main app from the Mac App Store, while the helper app is running, it is not auto-restarted, unlike the main app. What is the correct way to handle this? The main app's bundle looks like this: Main.app - Contents - MacOS - Main - Helper.app
9
0
914
Sep ’24
BLE Scanning stops when phone is in locked mode
I have a solution where my application should scan the Bluetooth enabled Beacon devices in the foreground, background, locked mode for the iphone. Currently we have built the project, which is working fine in foreground mode. We have tried exploring multiple options to enable the feature in background and locked mode. As of now, we have come up with the solution which implements Picture in Picture mode in the application and once the application is minimized. The PIP window opens which solves our problem. But the problem stays with locked mode. The scanning is not working in locked mode. So can we know how the bluetooth scanning will work in background and locked mode. Please also mention the alternative solutions to the problem statement if background and locked mode scanning is not possible. I have attached the project source code for reference. This project is being built for Google, so it is bit urgent. Can I expect a quick response to this query?
4
0
964
Sep ’24
Apps not quitting immediately
Hello all, Recently I observed a strange behaviour on macOS. Some apps with UI, after you quit them (right click on the Dock, select Quit or select Quit from the menubar), the apps are not actually quitting immediately, but in a few seconds (including in Activity Monitor the apps are staying alive). Also, if you open the apps again fast, the same PID is kept. Not all apps do this, some of them, for example WhatsApp. I'm not referring to closing all windows, but explicitly quitting. This was not the case in the past. Is there any reason for this? Is some kind of optimisation I'm not aware of? The actual issue is that in a Swift developed app events like NSWorkspace.didLaunchApplicationNotification or NSWorkspace.didTerminateApplicationNotification are not triggered. Is there any way to tell if an app was closed, even if macOS still keeps it around for a few more seconds? Thank you.
1
0
680
Sep ’24
Xcode 16.0. SwiftData Schema Fatal error: Inverse already set to another relationship
Hi, after upgrading to Xcode 16.0 I encountered the fact that when loading preview, I get an error: Fatal error: Inverse already set to another relationship - secondAccount - cannot assign to - firstAccount import Foundation import SwiftData import SwiftUI @Model class TransactionModel { @Relationship(inverse: \AccountModel.accountTransactions) var firstAccount: AccountModel? /// <- here @Relationship(inverse: \AccountModel.accountTransactions) var secondAccount: AccountModel? /// <- here @Relationship(inverse: \DebtorModel.transactions) var debtor: DebtorModel? @Relationship(inverse: \CategoryModel.transactions) var category: CategoryModel? init(account: AccountModel? = nil, secondAccount: AccountModel? = nil, debtor: DebtorModel? = nil, category: CategoryModel? = nil) { self.firstAccount = account self.secondAccount = secondAccount self.debtor = debtor self.category = category } } import SwiftData import SwiftUI @Model final public class AccountModel: Identifiable, Hashable { var accountId: UUID = UUID() var accountTransactions: [TransactionModel]? init(id: UUID = UUID()) { self.accountId = id } } Is this really not possible to implement? In Xcode 15, this worked both on the device and in the editor. Thanks!
1
0
649
Sep ’24
MFMailCompose won't accept input after iOS 18 upgrade
I'm supporting an older iPad app (UIKit and objective C). The ability to send email is a critical part of our app and it's no longer working after upgrading to iOS 18. Every time we create a MFMailComposeViewController, it refuses to accept input from the user. There are multiple UIViewControllers in our code where we create a MFMailComposeViewController for our users to send email from, and the problem consistently affects all of them. I've upgraded XCode to 16, and written a minimal demo app to try and repro the problem, but haven't been able to repro the problem so far. When the problem happens, in the XCode console I get a warning, "User interaction with com.apple.MailCompositionService was ignored because it is currently presented in an unsupported configuration. Ensure this view's appearance hasn't been modified." We're not really doing anything special with it, just the bare basics you would expect when creating a dialog for a user to send an email. No special formatting. But I can't repro the problem In a minimal demo so there's gotta be something different that I'm not accounting for. Any ideas? Here's the simplest code from our app that triggers the problem: - (IBAction)sendEmailButtonTapped { NSLog(@"Send Email button tapped"); if ([MFMailComposeViewController canSendMail] == NO) { [[[UIAlertView alloc] initWithTitle:@"Mail Problem" message:@"Can't currently send mail. You may not have any mail accounts set up on this iPad." delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil] show]; return; } MFMailComposeViewController* mailComposer = [[MFMailComposeViewController alloc] init]; mailComposer.mailComposeDelegate = self; { NSString * userEmail = [AMPMercuryModel shared].user.userEmail; [mailComposer setCcRecipients:@[userEmail]]; } NSArray* mfrEmail = [AMPMercuryModel shared].selectedManufacturer.orderDeskEmails; if ([mfrEmail count]) [mailComposer setToRecipients:mfrEmail]; [self presentViewController:mailComposer animated:YES completion:nil]; } - (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error { [controller dismissViewControllerAnimated:YES completion:nil]; NSString* failureMessage; switch (result) { case MFMailComposeResultFailed: failureMessage = [NSString stringWithFormat:@"%@\n%@",[error localizedDescription],[error localizedFailureReason]]; NSLog(@"Email Error: %@",failureMessage); [[[UIAlertView alloc] initWithTitle:nil message:failureMessage delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil] show]; break; case MFMailComposeResultSent: default: break; } }
6
0
601
Sep ’24
Help with 2 way relationships with classes (SwiftData / cloudkit)
Hi I’m having real problems trying to get a simple “to do” type app working with cloudkit. It works fine with SwiftData but as soon as I add CloudKit I get lots of “container not found errors “ which I think relates to the relationships between my classes. If I strip out the group sort order class it works fine. I’ve stripped the app back to basics to test - I want to be able to add a “task” (task data) to a “group list “ (group data) also also store the position of the task in that list (group sort order) as there may be lots of tasks in a list. The same task could also be in a different group list with a different position in the list (so another entry and value in group sort order) .. why does the following not work?? any help appreciated! //  TaskData.swift //  TaskOutApp // import Foundation import SwiftData `@Model class TaskData: Identifiable, Equatable { var id = UUID() var title: String = "No Title"     var isDone: Bool = false     var isToday: Bool = false     var creationDate: Date = Date()          var doneDate: Date = Date()     var todayDate: Date = Date()     // Use an array of GroupSortOrder to maintain both group and sort order     var groupSortOrders: [GroupSortOrder]? = nil          init(id: UUID = UUID(), title: String = "No Title", isDone: Bool = false, isToday: Bool = false, creationDate: Date = Date(), doneDate: Date = Date(), todayDate: Date = Date(), groupSortOrders: [GroupSortOrder]? = nil) {         self.id = id         self.title = title         self.isDone = isDone         self.isToday = isToday         self.creationDate = creationDate         self.doneDate = doneDate         self.todayDate = todayDate         self.groupSortOrders = groupSortOrders     }          static func currentDateString() -> String {         let formatter = DateFormatter()         formatter.dateStyle = .short         formatter.timeStyle = .short         return formatter.string(from: Date())     }          static func == (lhs: TaskData, rhs: TaskData) -> Bool {         lhs.id == rhs.id     } } @Model class GroupData: Identifiable {     var id = UUID()     var title: String = "no title"     var icon: String = "no icon"     var creationDate: Date = Date()     var task: [TaskData]? = []          init(id: UUID = UUID(), title: String, icon: String, creationDate: Date = Date(), task: [TaskData] = []) {         self.id = id         self.title = title         self.icon = icon         self.creationDate = creationDate         self.task = task     }          static func currentDateString() -> String {         let formatter = DateFormatter()         formatter.dateStyle = .short         formatter.timeStyle = .short         return formatter.string(from: Date())     } } @Model class GroupSortOrder: Identifiable {     var id = UUID()     var group: GroupData? = nil     var sortOrder: Int = 0          init(id: UUID = UUID(), group: GroupData? = nil, sortOrder: Int = 0) {         self.id = id         self.group = group         self.sortOrder = sortOrder     } }`
3
0
701
Sep ’24
**Title:** Lock Screen Widget Settings Not Updating Properly in iOS 18
It seems that after adding a lock screen widget in iOS 18, changing the widget settings doesn't work properly. The first setting change is applied, but after that, adjusting the settings has no effect. This issue appears to be present in other apps like Gmail as well, which suggests it might be an iOS 18 bug. Is there a solution to this problem?
1
0
350
Sep ’24
Unable to Print or Scan to/from HP Pagewide Pro 477dw MFP
Upgraded my 2 machines to Sequoia 15 and consequently I am unable to print or scan with both machines. A 3rd machine which is not upgraded as yet is unaffected. AirPrint from iPhones is not affected. The printing process executes without error. The printer receives the job but does not actually execute the print. The machine behaves like the job in the queue is completed normally. No error message. Just no physical printout. Happens with all applications. When Scanning - fails to connect to device to enable scanning. error message after some time is attached
0
0
364
Sep ’24
requestWhenInUseAuthorization Crash iOS 18 Beta 4
When I call requestWhenInUseAuthorization in state kCLAuthorizationStatusNotDetermined on iOS 18 Beta 4 in the simulator, all my apps just terminate without any error message in the Xcode console (black screen with an activity indicator for a second or two and then it goes back to the springboard). I do have the NSLocationWhenInUseUsageDescription set in my Info.plist file. When running the exact same apps in Xcode 16.0 beta 4 (16A5211f) but with a iOS 17 simulator attached, it is working as expected by showing the location authorization dialog. Is this a known issue or am I missing something?
4
1
1.1k
Sep ’24
SwiftData & CloudKit: getting info about current updates
I have an app which uses SwiftData and CloudKit all works fine and well. Now I wanted to implement a feature which lets the user know that there are data incoming from the cloud and they have to wait a little bit for the data to show up. Furthermore my app needs to do some data sanitation when it starts up. This sanitation should only be done after the CloudKit updates are processed. So is there a way that my app can know when CloudKit is doing updates and when it is finished? I was looking for some kind of notification but couldn’t find any info on that. I don’t need to know which data are updated or process the data. I just want to get notified when a sync starts and when it has ended. Actually it would suffice to know when a sync is finished.
2
0
909
Sep ’24
Install non-sandboxed Helper app from sandboxed Main app
Hi, I developed a utility app that allows monitoring system activity and usage. It is a sandboxed app distributed via the Mac App Store. Because in the sandbox I cannot fetch enough data about system activity (like processor temperature, fans, etc.), I developed a little Helper app (non-sandboxed), which currently is distributed via my website, and to enable extra features it provides, the user is asked to download and install it manually (it installs itself as a daemon). I'm looking for ways to improve the user experience. Ideally, it would be a button inside the main app, which would download and install the helper app, without asking the user to do more than pressing a button. As far as I understand, in the previous versions of macOS, it would be possible with privileged helpers and SMJobBless, but those are deprecated APIs now. Another way I tried, is simply downloading the installer app from the website, but opening it programmatically from the main app is tricky since it cannot remove it from the quarantine, in other words, it fails with "operation not permitted". Any advice is appreciated!
4
0
738
Sep ’24