flutter_inapp_purchase-iap-how-to-restore-purchases 苹果恢复购买

According to the Plugin documentation you can use the API

getAvailablePurchases

That looking at the library native code, this method is link to

// getAvailablePurchases
- (void)getAvailableItems:(FlutterResult)result {
    [[SKPaymentQueue defaultQueue] restoreCompletedTransactions];
    flutterResult = result;
}

 

And from Apple docs:

Declaration

func restoreCompletedTransactions()

Discussion

Use this method to restore finished transactions—that is, transactions for which you have already called finishTransaction(_:). You call this method in one of the following situations: To install purchases on additional devices To restore purchases for an application that the user deleted and reinstalled

So adding a Widget Button (the one you like most) is up to you, and you can put it wherever you want.

Then in the onClick event call getAvailableItems and manage the previously bought purchases of the users and reinstall them in the user's device.

 

https://stackoverflow.com/questions/53776179/flutter-iap-how-to-restore-purchases

你可能感兴趣的:(Flutter)