Post

Replies

Boosts

Views

Activity

SwiftUI - geometry inconsistent on iPad simulator and real device
After running automated UI tests it turned out that my app looks quite different on iPad simulator than on real iPad. I have my iPad Pro 12,9" right next to me and the app looks completely fine, but on Simulator (same device model on Simulator) the geometry is simply wrong. I use SwiftUI's GeometryReader to properly place elements, add horizontal padding if the screen width is wide and in landscape orientation. It is not the worst case, because on real device everything looks fine, but I wanted to use screenshots generated by these tests and the ones taken on iPad Simulators are simply useless. iPhone Simulator is totally fine. Am I doing something wrong? Has anybody encountered this? I run the tests in the following way: projectName="./MyProject.xcodeproj" schemeName="MyProject" simulators=( ...    "iPhone 12 Pro Max" ...    "iPad Pro (12.9-inch) (5th generation)" ... ) languages=(   "en" ... ) appearances=(   "light"   "dark" ) xcrun simctl boot "$simulator" xcrun simctl ui "$simulator" appearance $appearance xcodebuild -testLanguage $language -scheme $schemeName -project $projectName -derivedDataPath '/tmp/MyProjectDerivedData/' -destination "platform=iOS
1
0
2.0k
Dec ’21
What are the results of changing the deployment target?
Hi, I have launched an app built with SwiftUI for iOS 14+. It turned out that SwiftUI for iOS 15+ introduced some quite important changes for my app (most of all better support for NavigationLinks and managing keyboard with FocusState). From now on, I'd like to only release updates for iOS 15+, but I don't want to lose any users and any ratings/reviews on the App Store. Could someone please let me know what the exact outcomes of setting the deployment target to a newer iOS are? Is it that the users with iOS older than iOS 15, will simply not see/receive updates? Will all the ratings and reviews be intact? Thank you
0
0
900
Nov ’21
Provisional Notifications - no device token
I have been following the official Apple documentation on how to set up notifications in my app: https://developer.apple.com/documentation/usernotifications/asking_permission_to_use_notifications I noticed there is this option .provisional, which doesn't ask the user for authorization, but instead it is granted right away and then notifications are delivered quietly to the notification center's history. So far so good, but once I am granted authorization for sending .provisional notifications, the callback with the DeviceToken does not fire. I have this method in my AppDelegate:    func application(     _ application: UIApplication,     didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data   ) {     let tokenParts = deviceToken.map { data in String(format: "%02.2hhx", data) }     let token = tokenParts.joined()     ManagementService.sharedInstance().storeDeviceToken(token: token)   } And it fires when authorization for normal notifications is granted, but it doesn't for the provisional notifications. So the question is—how can I deliver the provisional notifications if I don't have the device token? My plan was to do the following: ask for authorization to send provisional notifications on first app launch and send the device token to my server ask for authorization to send normal notifications some time later (let's say after a week or after completing some action in the app) EDIT: Found the problem—I was calling the same method to register for remote notification after being granted authorization for both provisional and normal notifications:    func getNotificationSettings() {    UNUserNotificationCenter.current().getNotificationSettings { settings in      guard settings.authorizationStatus == .authorized else { return }             DispatchQueue.main.async {       UIApplication.shared.registerForRemoteNotifications()      }           }   } In this case settings.authorizationStatus == .authorized is false for provisional notifications (even though they are always authorized...). So I just omitted checking of settings.authorizationStatus for provisional notifications and the device token is there.
2
0
1.5k
Jan ’22
Introductory offer - Trial + Reduced Price
Hi, I would like to create an introductory offer that includes a 1-week trial period and a reduced price for the initial period. But it seems that with the Introductory offers it is either or. Apple's documentation says that I should be using "Introductory offers to attract new customers" so I don't want to use Promotional offers for that. Also, I'd like to have the benefit of Introductory offers, which allows them to be claimed only once and not be available after that anymore. Any advice how I can implement this? Thanks
1
0
2.7k
Apr ’22
Where can I get used Offer Codes from?
I would like to programmatically keep track of offer codes that have been used. I just configured a Test Offer Code (Reference name), which contains 500 codes (Offer Codes) to buy a 1-month subscription for 0,49€. I was able to redeem the code and everything works, but I was expecting to receive the used code. Instead I received the Reference name in the payload from the App Store Server Notification in the field offer_code_ref_name="Test Offer Code". (expected was sth like offer_code_ref_name="JFFDS61SBJDBJ5BXJS4BX") I would be able to identify the Reference name by the code, if it was provided, because I have the following table in my app's backend: reference_name | code | url | expires_at | used | reserved Test Offer Code | xadz | zzz | 31-07-2022 | t | f Test Offer Code | asdf | xxx | 31-07-2022 | f | f The used code doesn't seem to be included in the latest receipt. How can I obtain it? Can I somehow call App Store Connect API? Thanks
5
0
2.7k
Apr ’24
Apple Email Relay
Hi, I am receiving some bug reports from the users of my app and I would like to either thank you or ask for details via email. The use the "hide my email" option, which makes it harder for me to just directly write them an email. I have configured SendGrid to support Apple Email Relay when sending emails programmatically, but I'd like to have a quick and easy way to just write a single email or two sometimes. What would be the easiest way to be able to send an email from Gmail to someone using Apple Email Relay? Thank you!
0
0
1k
Dec ’22
Present Offer Code Price Programmatically
Hi, I have a 12 months subscription which I generated some offer codes for. I generated 25000 of them manually in App Store Connect (One-Time Use Codes). I want to send those codes to users by push notifications and I need to show the final price when the code will be applied. The problem is that I use the native sheet, which only shows the price after the user entered the code. Is there an API that I can hook into to retrieve that price? Otherwise, the best I could do would be to calculate ActualPrice * Discount (because I know the discount since I created the codes), but I am afraid it will not be accurate enough, because it is not possible to select price for offer codes with that precision.
0
0
713
Apr ’24