In-app Purchases from iMessage app extension

北慕城南 提交于 2020-01-23 10:56:11

问题


I created an app that uses in-app purchases, I already have set up the in-app purchases on iTunes and I even tested it using a sandbox user and all of this is working perfectly.

now that I included an iMessage app extension, the same in-app purchase products return invalidProduct Id, but continues working well inside the main app.

could be because the bundle id?

mainapp: com.whatever.bundleid
app iMessage: com.whatever.bundleid.iMessage
iMessage extension: com.whatever.bundleid.iMessage.MessagesExtension

btw, i'm using the SwiftyStoreKit pod.

if let inappIndentifier = stickerPackage.inAppPurchaseId {
        SwiftyStoreKit.retrieveProductsInfo([inappIndentifier]) { result in
            if let product = result.retrievedProducts.first {
                let priceString = product.localizedPrice!
                completion(true, priceString)
            } else if let _ = result.invalidProductIDs.first {
                completion(false, nil)
            } else {
                print("Error: \(result.error)")
                completion(false, nil)
            }
        }
    }


回答1:


I made a huge mistake, instead of creating an iMessage extension, I've created an iMessage app extension. Once I removed the "iMessage app" the in-app purchases started working correctly.



来源:https://stackoverflow.com/questions/43499184/in-app-purchases-from-imessage-app-extension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!