2023年12月16日发(作者:董彦红)
- ( void)viewDidLoad {
[ super viewDidLoad];
// 监听购买结果
[[ SKPaymentQueue defaultQueue] addTransactionObserver: self];
}
- ( void)viewDidUnload {
[ super viewDidUnload];
[[ SKPaymentQueue defaultQueue] removeTransactionObserver: self];
}
[ self completeTransaction:transaction];
break;
case
SKPaymentTransactionStateFailed: //交易失败
[ self failedTransaction:transaction];
break;
case
SKPaymentTransactionStateRestored: //已经购买过该商品
[ self restoreTransaction:transaction];
break;
case
SKPaymentTransactionStatePurchasing:
//商品添加进列表
NSLog( @"商品添加进列表");
break;
2023年12月16日发(作者:董彦红)
- ( void)viewDidLoad {
[ super viewDidLoad];
// 监听购买结果
[[ SKPaymentQueue defaultQueue] addTransactionObserver: self];
}
- ( void)viewDidUnload {
[ super viewDidUnload];
[[ SKPaymentQueue defaultQueue] removeTransactionObserver: self];
}
[ self completeTransaction:transaction];
break;
case
SKPaymentTransactionStateFailed: //交易失败
[ self failedTransaction:transaction];
break;
case
SKPaymentTransactionStateRestored: //已经购买过该商品
[ self restoreTransaction:transaction];
break;
case
SKPaymentTransactionStatePurchasing:
//商品添加进列表
NSLog( @"商品添加进列表");
break;