Post

Replies

Boosts

Views

Activity

macOS Monterey partition missing "SF Pro Text" font
I want to use the "SF Pro Text" font in my app. It works fine when I build my app on my main computer running macOS11 Big Sur, but I have a 2nd partition to run macOS Monterey, and it doesn't seem to be available there at all, whether through Interface Builder or through code (using NSFontManager). Using this returns nil on my Monterey partition: NSFont* regularFont = [[NSFontManager sharedFontManager] fontWithFamily:@"SF Pro Text" traits:NSFontWeightRegular weight:5 size: 16.0]; Maybe I'm missing something here ... should I have to install the font manually? I thought the SF Font is a 'system font', so it would be available on all Macs?
1
0
1.5k
Feb ’22
How to add SiriKit to macOS app
Hi, I haven't been able to add some basic SiriKit actions to my macOS app in macOS Monterey. To test this out, I created a new project, made it a macOS app with Storyboard. Then I added an intents definition file, and added a basic intent, with no inputs/outputs. I added the intent name to "Supported Intents" in the target "General" configuration. Now when I build and run the app, the shortcut doesn't show up in the Apple Shortcuts app. I've tried looking for the "Siri" capability in "Signing & Capabilities" and it's not listed there (compared to a new iOS app where it would be). I'm not sure what I'm missing here. Would love some help. I'm using Xcode 13.1 on macOS Monterey RC.
1
0
847
Oct ’21
Can Intents Extensions access the container app's Application Support directory?
Hi, My Mac app saves it's local database and other important information in the Application Support directory. I want to now create an Intents extension for the app so I can create shortcut actions. When I currently run this, the Application Support directory for the extension is different than for the main application. Is there any way on macOS for the extension to access it's parent applications App Support directory? I know it's not possible in iOS, and you have to use App Groups for this, but I'm wondering about the Mac. BTW, the app is a sandboxed app for the Mac App Store.
1
0
983
Oct ’21
macOS: Detect Link URL from WidgetKit extension
I am building a widget for my (AppKit) Mac app, and one thing I can't figure out is how to detect when a Link is pressed in the widget to open the parent app. It just opens the parent app but I can't get any information about the URL that was passed in. With iOS, it's easy to detect, from the AppDelegate method: - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation I can't find anything equivalent on macOS. Can someone point me to the right place?
1
0
836
Nov ’21
NSApplication's openURLs delegate method not getting called
Hi, I am trying to invoke this NSApplicationDelegate callback from my Mac app, but it's not getting called: - (void)application:(NSApplication *)application openURLs:(NSArray<NSURL *> *)urls I have registered the URL scheme in my Info.plist: <key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleTypeRole</key> <string>Editor</string> <key>CFBundleURLName</key> <string>com.my.testapp</string> <key>CFBundleURLSchemes</key> <array> <string>mytestapp</string> </array> </dict> </array> Now I use a 2nd Mac app to test this out, by invoking the following code: if let url = URL(string: "mytestapp://") {             NSWorkspace.shared.open(url)         } This causes my first app to come to the foreground, and the "applicationDidBecomeActive:(NSNotification *)notification" method gets called, but the "application:(NSApplication *)application openURLs:(NSArray<NSURL *> *)urls" method mentioned above doesn't get invoked, which is what I want. Any ideas about why that might be the case?
1
0
1.4k
Mar ’22
StoreKit2: does Transaction.all include paid apps?
Hi, I have a paid app available through the Mac App Store, and when the user opens the app, I want to verify that the transaction of the payment is valid. I would have assumed that in StoreKit2, the 'Transaction.all' would work, but when I tested this, it shows 0 transactions for all users. This is what I'm testing: for await result in Transaction.all { guard case .verified(let transaction) = result else { continue } print("verified product = \(transaction.productID)") // send to analytics } But nothing gets observed in the analytics. Does the StoreKit2 framework have an easy way to determine transactions that are made for paid-up-front apps?
1
0
1.1k
Mar ’22
DataScannerViewController in Objective-C
Hi, Is DataScannerViewController available to be called directly from Objective-C? I see the header file has an "objc" attribute on it, but trying to initialize it from an Objective-C file doesn't seem to be working for me. Maybe it's something I'm doing wrong, but I wanted to first clarify and confirm that if it indeed possible to use it directly in Objective-C, or not?
1
0
1k
Aug ’22
iPhone14 Pro and UserNotification limits
The iPhone 14 Pro has a A16 Bionic chip with 16 Billion transistors, two performance cores + 4 high-efficiency cores, a 5-core GPU and 16-core neural engine, and can perform 4 trillion OPS per photo. But sadly, we can only schedule up to 64 User Notifications on it (per app). This limitation has been there since iOS3 I believe, when UILocalNotifications were first introduced, along with the iPhone 3G. What gives? Why does this limit never seem to change? I would love to understand the reasons. I am trying to build a 'timer' app, and can't understand how to build one with this limitation in place (unless I use Remote Push notifications, which requires a lot of infrastructure outside the app). Btw, I filed a Radar for this 5 years ago, which was changed to this Feedback Request: FB5978935
1
1
1.4k
Sep ’22
StoreKit2: save currentEntitlements in keychain
Hi, With StoreKit2 giving us the up-to-date subscription status using Transaction.currentEntitlements, is there any value in storing the status separately in keychain as well? Or will that just add an unnecessary layer to manage (and possibly mess up)? I just want to subscription status to know if I need to unlock certain features in the app or not, and wondering if just looking at currentEntitlements and saving that in my Store object is enough. Thanks.
1
0
857
Oct ’22
StoreKit2: using AppTransaction.shared triggers user login
Hi, I plan to use the new AppTransaction.shared API in StoreKit2 to find the user's original purchase date and version for my macOS app. However, when testing this running in the debugger, the app shows up with an App Store login prompt, asking for my login and password, which is undesirable. I wanted to know if this is just a sandbox quirk, or is the "AppTransaction.shared" API supposed to trigger this prompt for all users, even in production? In that case, is it like the old "Refresh receipt" API where we shouldn't trigger this automatically when a user opens the app, and instead have a button somewhere that triggers the call? Thanks.
1
0
845
Mar ’23
Differences between .framework and .xcframework
Hi, I am developing a 'framework' for a client so they can embed some of my code into their own custom app. I'm confused a bit about the best option to distribute this. I have created an iOS 'framework' within my Xcode project and added all the necessary files there. Can I just build the framework and send them the build folder for the framework? Or is it better to generate an .xcframework that I read about somewhere? I'm just not completely sure about the benefits for distributing an .xcframework file (which there doesn't seem to be an option to generate from Xcode) over just the .framework folder from the built products? Thanks.
1
1
5.8k
May ’23
Removing dependencies for visionOS
Hi, My iOS app includes 4 dependencies added through SPM, and a xcframework file from an external source. When I build the iOS app for the visionOS simulator, it works fine, and it runs in the compatibility mode. When I try to build for the new visionOS SDK, I get build errors related to these external dependencies, like "When building for visionOS Simulator, no library for this platform was found ..." How do I remove these dependencies for just the visionOS SDK? Any help would be appreciated. Thanks.
1
1
2k
Jun ’23
Replacing [[UIScreen mainScreen] scale] for visionOS
The [[UIScreen mainScreen] scale] API is unavailable for visionOS, but I use it in various places to pass into Apple's drawing APIs ... for e.g.: UIGraphicsBeginImageContextWithOptions(self.size, NO, [[UIScreen mainScreen] scale]); and for generating thumbnails: QLThumbnailGenerationRequest *request = [[QLThumbnailGenerationRequest alloc] initWithFileAtURL:fileURL size:size scale:screenScale representationTypes:QLThumbnailGenerationRequestRepresentationTypeThumbnail]; What would be the best way to get the 'scale' factor in this case, when building for visionOS?
1
0
1.6k
Jul ’23