ios - inApp purchase, dowload free products -
i implementing inapp features download hosted content feature. products free unlimited time. each product have 1 download associated , audio file.
is possible start download without user see dialog buy free product. first user must give apple id password, see dialog buy free product , dialog product succesfully purchased.than download can requested. since products free can somehow download reuested without user see confiramtion dialogs , messages , start download imedietly.
if item purchased/downloaded user see message buy free item again. know restore functionalities, need track downloaded items , in case start download restore state.
thanks!
1) yes, can download without dialogs. product detail using store kit, , if product price free (0), download item without processing purchase request storekit.
code request product detail:
kproductsrequest *productsrequest = [[skproductsrequest alloc] initwithproductidentifiers: [nsset setwitharray:productidentifiers]]; // keep strong reference request. self.request = productsrequest; productsrequest.delegate = self; [productsrequest start];
// skproductsrequestdelegate protocol method
- (void)productsrequest:(skproductsrequest *)request didreceiveresponse:(skproductsresponse *)response { self.products = response.products; (nsstring *invalididentifier in response.invalidproductidentifiers) { // handle invalid product identifiers. or check product looking dozens has identifier here } (skproduct *product in self.products) { //for example, product looking has identifier "com.product.free" if([product.productidentifier isequaltostring:@"com.product.free"] && [product.price comparewithint:0]) { // startdownloading without purchase } } }
2) if have non-consumable inappt purchase, must provide option restore. downloading, can write own logic. check if item downloaded , re-download if not available.
Comments
Post a Comment