You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to get Promo Codes Redeemed from the app store to work inside my iOS app. Please note that these are different from offer codes - which are used for subscriptions and work with presenting an UI.
After I generate a promo code from appstoreconnect the flow from a user perspective is:
Go to App Store -> Profile
Go to Redeem Gift Card or Code
Input code
Tap Open App
My app opens but no IAP is triggered by SwiftyStoreKit.completeTransactions .
I'm using SwiftyStoreKit and in applicationDidFinishLaunching I've put the code:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// see notes below for the meaning of Atomic / Non-Atomic
SwiftyStoreKit.completeTransactions(atomically: true) { purchases in
for purchase in purchases {
switch purchase.transaction.transactionState {
case .purchased, .restored:
if purchase.needsFinishTransaction {
// Deliver content from server, then:
SwiftyStoreKit.finishTransaction(purchase.transaction)
}
// Unlock content
case .failed, .purchasing, .deferred:
break // do nothing
}
}
}
return true
}
and handle the delivering functionality of the IAP before calling :
Question
I'm trying to get Promo Codes Redeemed from the app store to work inside my iOS app. Please note that these are different from offer codes - which are used for subscriptions and work with presenting an UI.
After I generate a promo code from appstoreconnect the flow from a user perspective is:
SwiftyStoreKit.completeTransactions
.I'm using SwiftyStoreKit and in applicationDidFinishLaunching I've put the code:
and handle the delivering functionality of the IAP before calling :
But there seems there is no call to the SwiftyStoreKit.completeTransactions callback.
Isn't this the method that should get called to make redeeming promo codes work ?
The text was updated successfully, but these errors were encountered: