ios - In-App should ask credential whenever i logout from store -
ios - In-App should ask credential whenever i logout from store -
i have query regarding in-app credential. have created 2 sandbox business relationship eg accounta & accountb , 1 package. have video require subscription watch. if click on video opens subscription page have 'buy now' button. on click on purchase bundle using accounta , store bundle id in nsuserdefaults.
there 2 scenario now:
first:
if accounta logout itunes store (settings->itunes store) , open app , click on video should inquire credential watch video. (currently video playing because storing bundle id in nsuserdefaults irrespective of user. guess wrong approach). want test if itunes logged in user has purchased bundle should not open subscription page. he/she should straight send watch video.
second:
if accountb logged in itunes store , open app. he/she should not able watch video until unless not purchase bundle accountb. or else has login accounta watch video he/she has purchased.
so question how check whether accounta or accountb has purchase package. thought create restoretransaction request on every time if he/she clicks on video. if every time opens dialog sign-in itunes store or alert comes have bought bundle , not want show user if he/she has purchased.
i not want utilize nsuserdefault check bundle has been purchase boolean value. want check signed-in user.
in addition: can purchase bundle same installed app 2 different account?
in case, have method called "- (void)applicationwillenterforeground:(uiapplication *)application" in appdelegate. write "restoring functionality" here. check whether current user( logged itunes ) has purchased subscription or not. if user has purchased subscription, phone call "skpaymenttransactionobserver" delegate method - "(void)paymentqueuerestorecompletedtransactionsfinished:(skpaymentqueue *)queue" set subscription boolean variable "yes". if user has not purchase subscription, calls "- (void)paymentqueue:(skpaymentqueue *)queue restorecompletedtransactionsfailedwitherror:(nserror *)error" delegate method, set subscription boolean variable "no". based on write delegate methods (or) utilize nsnotificationcenter phone call appropriate method i.e if subscritpion == yes allow user play video else don't allow user , show purchasing subscription options.
ios iphone in-app-purchase itunes in-app-billing
Comments
Post a Comment