I have problems trying to make a dynamic list of products. I do get this error.
Cannot convert value of type ‘[String]’ to specified type ‘Set’ (aka Set')
What can I do?
public static let Products = ProductList.Products //output is array of String
fileprivate static let productIdentifiers: Set = Products
public static let store = IAPHelper(productIds: RageProducts.productIdentifiers)
Ok we save locally the purchase in purchasedProductIdentifiers to avoir reasking each time apple server. But how to reset purchasedProductIdentifiers when for the user logout from its App Store user account and an other account is used ?
In the example project, the initial value of GirlfriendOfDrummerRage variable in RageProducts.swift is: GirlfriendOfDrummerRage
but in the iTunes Connect, we create it as: GirlFriendOfDrummerRage
That is, the ‘F’ of “Girlfriend” is upper case in iTunes Connect, but lower case in RageProducts.swift.
This discrepancy got me initially. Please fix the starter project.
Hey, great tutorial, helped me a lot with my first 2 iOS apps. But I have a huge problem with in app promo codes restore. If user buys the in app purchase, everything works great - first buy, restore and all. Same in case of sandbox. But in case user redeems the promo code for in app, nothing happens when tapping on restore button. Moreover when user clicks on “buy” button, there’s an alert that this item was already bought (via code) and will be restored. But as mentioned before, restore callback is never called. Please advice. Thanks.
No, I haven’t. I have no idea how to debug promo codes in sandbox environment.
As a workaround I’ve set a price of in app purchase to free for first 2 weeks, so everyone can test the full possibilities of the app.
I’ve created IAPHelper object in AppDelegate’s didFinishLaunchingWithOptions method and added it as an observer. So as Apple’s best practice suggests, that will keep you up to date with any transactions your observer class couldn’t handle if it’s already deallocated. So, i hope that will help. Will come back for further news.
This tutorial is more than six months old so questions are no longer supported at the moment for it. We will update it as soon as possible. Thank you! :]