Skip to content

购买

购买

swift
DYMobileSDK.purchase(productId: productId) { receipt, purchaseResult, error in
    if error == nil {
        
    }
}
objective-c
[DYMobileSDK purchaseWithProductId:productId completion:^(NSString * receipt, NSArray<NSDictionary<NSString *,id> *> * results, DYMError * error) {
    
}];

恢复购买

swift
DYMobileSDK.restorePurchase { receipt, purchaseResult, error in
    if error == nil {
        // 恢复购买成功
    }
}
objective-c
[DYMobileSDK restorePurchaseWithCompletion:^(NSString * receipt, NSArray<NSDictionary<NSString *,id> *> * results, DYMError * error) {
    if (error == nil) {
        NSLog(@"(DingYueSDK): 恢复成功 产品信息:%@",results);
    }
}];