objective c - Having problems with auto renewable subscription in app purchase in ios -
i having app in implementing auto renewable subscription in app purchase.
i following link link
with that, getting alert purchase when press again, asks me every time purchase.
there 2 methods mentioned in checking expiration date , if product expired.
but unable found proper solution that.
can please me???
any appreciated.
thanks in advance.
check link
apple suggests receipt validation should done @ server side.
the status code received if subscription has expired 21006.
for restoring purchases
- (ibaction)retoreinapp:(id)sender { [[skpaymentqueue defaultqueue] addtransactionobserver:self]; [[skpaymentqueue defaultqueue] restorecompletedtransactions]; self.restoringinappstatuslabel.hidden = no; } it call method after getting restore details :
- (void)paymentqueuerestorecompletedtransactionsfinished:(skpaymentqueue *)queue { uialertview *alert ; if(queue.transactions.count >0) { (skpaymenttransaction *transaction in queue.transactions) { nsstring *temp = transaction.payment.productidentifier; nslog(@"product identifier string %@",temp); } alert = [[uialertview alloc ] initwithtitle:@"restore transactions" message:@"all previous transactions restored successfully." delegate:nil cancelbuttontitle:@"ok" otherbuttontitles:nil, nil]; } else { alert = [[uialertview alloc ] initwithtitle:@"restore transactions" message:@"no transactions in account restored." delegate:nil cancelbuttontitle:@"ok" otherbuttontitles:nil, nil]; } [alert show]; }
Comments
Post a Comment