4. In-App Purchase
Apple In-App Purchase
FID offers server-side verification for orders, which is user-friendly and straightforward. FID also supports order verification retries in the event of errors such as crashes or internet connectivity issues.
4.1 Get Available Products
FID retrieves all products from Funzy's CMS and subsequently updates the prices of these products from AppStore.
[[FTSDKPurchase instance] getListPackagesOnSuccess:^(FTSDKListPackageData * _Nonnull listProducts) {
} onFailure:^(FTSDKError * _Nonnull error) {
}];4.2 Make a Purchase
Before make Purchase, you must implement FTSDKPurchaseDelegate to handle result
// MARK: FTSDKPurchaseDelegate
- (void)didPurchaseSuccessWithTransacion:(FTSDKTransaction *)transacion {
// Purchase success, add item for user
}
- (void)didPurchaseFailedWithError:(FTSDKError *)error {
// Purchase failed
}
// Rember to assign delegate
[FTSDKPurchase instance].delegate = self;To make a Purchase, you need:
FTSDKListPackageDatafetch from4.1FTSDKFunzyOrderInfowith randomcooOrderSerial
FID provides a sample UI for testing purposes. To access it, you can make a call to:
4.3 Retry Verify Pending Transactions
To verify pending or failed transactions, it is advisable to make a call each time the user accesses the app/game, following a successful initialization of FID.
Last updated