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 | *** | 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
Post
Replies
Boosts
Views
Activity
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.
I have been using the Offer Codes that can be generated in App Store Connect (up to 25k per quarter).
They had worked before, but at some point of time they just stopped working.
My production device (iPhone 13 Pro) doesn't even render the redemption screen properly and says the code expired, even if it didn't. (already submitted a bug report, sadly without answer till this day: https://feedbackassistant.apple.com/feedback/12261784)
Apart from that, I asked some friends to try to redeem a test offer code for me and surprisingly, the native redemption screen is rendered properly, but the code cannot be redeemed. (Clicking "Redeem" doesn't show the payment sheet)
Any idea what the cause can be and how to fix it?
To me it looks like it is a problem with StoreKit API, because I followed the documentation on how to use the native iOS offer code redemption sheet and I don't even receive an app store notification. Looks like there is a problem between the device and Apple's API.
I need to add frames to auto-generated screenshots for multiple devices and multiple languages so that I can display these on my app's landing page. I guess it must be quite a standard task so my question is:
Is there anything that can be reused to get this job done?
All screenshot file names contain:
language
device name
generation
I would prefer not to have to manually add frames to 10 screenshots * number_of_devices * number_of_languages.
Right now I actually only need iPhone Pro (not Max) and iPad Pro 12.9 (newest gen), but in the future I might need it for other devices too.
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!
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
My language learning app needs to support a lot of languages and text paragraphs containing 2 different languages are not uncommon. (e.g. German grammar explained in Arabic)
Now, I want to integrate a custom font to make the design unique and consistent across multiple platforms (iOS, Android, Web), but there is basically no single Font that supports all languages.
The question is:
What is the recommended way of implementing that on the code level in SwiftUI?
If I just hardcode:
.font(Font.custom("myFont", size: 16))
then I guess it is not gonna work if the text contains a language not supported by my custom font.
The Apple's default font seems to handle all languages perfectly, even if they are mixed together and I'd like to have something like that, but with a custom font.
Specifically, I'd like to integrate FF Din font:
https://www.myfonts.com/fonts/fontfont/ff-din/
with supported Languages: Western Europe, Vietnamese, Central/Eastern Europe, Baltic, Turkish, Romanian, Cyrillic, Greek
So I am wondering what I would do about Chinese, Arabic, etc.
Thanks
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.
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
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
Let's say I want to create an introductory offer starting from the 1st of November till the end of the year. (it should begin at 01-11-2021 00:00:00 and expire at 31-12-2021 23:59:59)
Which of the options below is correct in that case?
Option 1
Start date: 1 November
End Date: 31 December
Option 2
Start date: 1 November
End Date: 1st of January
I store the information whether the user has premium subscription in the KeyChain.
I just have a global function called doesUserHavePremium that reads a value from the KeyChain.
It appears that sometimes that value is read from the KeyChain incorrectly—even though I am 100% sure it is set, it returns nil. This happens only when the app was launched, then left for some time (probably screen got locked), and then I reentered the app again without relaunching it from scratch.
I tried the following things:
loosening the KeyChain access the the least restrictive
the following piece of code to notify UI elements whenfalse/trueis read for that value after previously not being able to access it
let protectedDataAvailabilityNotificationName = UIApplication.protectedDataDidBecomeAvailableNotification
func observeProtectedDataAvailability() {
let selector = #selector(Self.protectedDataAvailableNotification)
switch UIApplication.shared.isProtectedDataAvailable {
case true: break
case false:
NotificationCenter.default.addObserver(self,
selector: selector,
name: protectedDataAvailabilityNotificationName,
object: nil)
}
}
@objc func protectedDataAvailableNotification(notification: NSNotification) {
NotificationCenter.default.removeObserver(self, name: protectedDataAvailabilityNotificationName, object: nil)
dataDidBecomeAvailable()
}
func dataDidBecomeAvailable() {
refreshSubscriptionStatusSubscribers()
}
But it doesn't seem to work. The problem is that I cannot debug it, because the app has to enter background in order for this problem to manifest itself.
I have read several threads related to this issue here and on GitHub and it seems like there isn't any great solution. I am looking for some workarounds. Any hints are welcome. I will try the following now:
Try to store that value in UserDefaults instead—it is not really a secret like a password/token, but I need to be sure it cannot be tampered with. Not sure if UserDefaults suffer from the same problem.
Try to refactor to code to wrap the doesUserHavePremium and cache its return value in a property. That seems promising, because it never happens during fresh start thus I could always set that property on the app startup.
I have been following these resources to set up auto-renewable subscriptions in my app written in SwiftUI:
What's new in StoreKit (WWDC17)
Advanced StoreKit (WWDC17)
https://blckbirds.com/post/how-to-use-in-app-purchases-in-swiftui-apps/
I basically have a class that implements SKProductsRequestDelegate instantiated in SubscribeView that processes the transactions. I was able to complete the entire flow in Sandbox (got the receipt and the server notification, created a corresponding subscription entry in my database).
The response coming from the verifyReceipt endpoint is quite complex and I am not sure if I understand it correctly. I am looking for an easy solution to get the latest subscription state. I don't want to focus on churn rate or anything else now.
Questions:
Does on-device receipt get automatically modified when the user cancels or modifies the subscriptions or when the trial period ends? If yes, can I rely on resubmitting the latest receipt from the device to my backend in order to keep track of the latest subscription state? I could resubmit the latest receipt on app startup, the server would verify and possibly update the subscription.
In the Advanced StoreKit (WWDC17) talk, it is mentioned to implement SKProductsRequestDelegate as soon as possible (e.g. in the AppDelegate). Do I even need that if I already have that delegate implemented in the SubscribeView? If I understood correctly, the purpose of that would be to be notified of the transactions done after some time (subscription change, cancellation, entering grace period, etc.). I'd prefer to ignore these for now and just rely on resubmitting the latest receipt to check the current subscription.
I am following "What's New in StoreKit" from WWDC17 to set up payment for subscriptions in my app and the author of the talk recommends to set applicationUsername to an opaque user ID.
When I tried to set it, it turned out it is readonly. (iOS 15)
Is this still a recommended practice, to set that property on SKPayment?
Thanks
I am slowly distributing my app to Beta testers via TestFlight. A few of them have already reported that the app showed “No Internet connection” while on WiFi. As soon as they switched to cellular everything started to work. But the WiFi worked for them for everything else.
One of the testers installed the app today for the first time. Still no Internet connection after switching back to WiFi from cellular.
I use Alamofire as a framework to make HTTPRequests and when these requests fail, “No Internet connection” error is displayed.
My backend service is hosted on Google Cloud, my domain is registered using AWS Route 53. I use SSL certificates managed by Google.
All HTTPRequests are sent to https://api.myapp.com (where myapp.com is hosted on AWS).
All of the testers have Automatic DNS resolution set in Settings -> WiFi -> (i) -> DNS
So far it occurred on iPhone XR and iPhone 12.
iOS versions 14.X
Any ideas how I can further investigate this issue?
Thanks