iOS: A default alert will be showed after purchasing a product in-app purchase

只谈情不闲聊 提交于 2020-07-21 07:06:29

问题


I am struggling with a problem that after purchasing a product successfully and a system alert ("You're all set, Your purchase was successful") will be showed as well. The problem is that I am not able to get a callback or any event to know the system alert was dismissed in order to display a custom popup

func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {
    for transaction:AnyObject in transactions {
        if let trans = transaction as? SKPaymentTransaction {
            switch trans.transactionState {
            case .purchased:
                // the default alert will be showed after purchasing a product successfully
                break
            case .failed:
                break
            case .restored:
                break
            default:
                break
        }
    }
}                         

Note that: the system has prompted won't get a callback

I wanna show the below photo after users tapped the "Ok" button from the default alert. I am not able to get a callback or any event to know the default alert was dismissed in order to display my custom popup

Thank you so much for helping me

来源:https://stackoverflow.com/questions/62336577/ios-a-default-alert-will-be-showed-after-purchasing-a-product-in-app-purchase

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