ios - In App purchase restoration not working after releasing app to store -



ios - In App purchase restoration not working after releasing app to store -

i have unusual problem. have implemented in app purchase mechanism non-consumable app. works fine , passed of tests. after submitting app store , downloading it, it's restore mechanism doesn't work properly.

here scenario: downloading app store. create in app purchase apple id. removed app. reinstall it. inquire restore same apple id , got next error:"the apple id entered couldn't found or password incorrect. please seek again.". , it's started store kit process.

here comes codes:

skproductsrequest *productsrequest = [[skproductsrequest alloc] initwithproductidentifiers:[nsset setwitharray:productidentifiers]]; productsrequest.delegate = self; [productsrequest start];

============comes response

- (void)productsrequest:(skproductsrequest *)request didreceiveresponse:(skproductsresponse *)response { self.products = response.products; nsmutablearray * invalidproductidentifiersmutable = [nsmutablearray new]; (nsstring *invalididentifier in response.invalidproductidentifiers) { [invalidproductidentifiersmutable addobject:invalididentifier]; } self.invalidproductidentifiers = [[nsarray alloc] initwitharray:invalidproductidentifiersmutable]; if (self.products) { [self restorepurchase]; } }

============start

nsurl *receipturl = [[nsbundle mainbundle] appstorereceipturl]; nsdata *receipt = [nsdata datawithcontentsofurl:receipturl]; if (!receipt) { skreceiptrefreshrequest * request = [[skreceiptrefreshrequest alloc] init]; request.delegate = self; [request start]; } [self registeraspurchaseobserver]; [[skpaymentqueue defaultqueue] restorecompletedtransactions];

========result

-(void)paymentqueue:(skpaymentqueue *)queue restorecompletedtransactionsfailedwitherror:(nserror *)error { [delegate transactiondidfail]; } - (void)paymentqueuerestorecompletedtransactionsfinished:(skpaymentqueue *)queue { nsurl *receipturl = [[nsbundle mainbundle] appstorereceipturl]; nsdata *receipt = [nsdata datawithcontentsofurl:receipturl]; if (receipt) { [delegate transactiondidrestorepurchasesuccessfullywithreciept:receipt]; } else{ [delegate transactiondidfail]; } }

i emphasis works correctly under development , passed of tests several times. it's not working after downloading store , 1 time 1 time again restore not working. purchase working fine.

i had similar issue app. how got work to:

delete app download app app store launch app , click on restore purchase button calls: [[skpaymentqueue defaultqueue] restorecompletedtransactions]

the problem maybe you're launching app in xcode? anyway, give these steps shot.

ios iphone objective-c in-app-purchase storekit

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -