ios - How to get Price Tier for InApp Purchase dynamically? -


i having app in using 5 consumable in app purchases.

there inapp price on buttons.

- don't want set value of in app (e.g. $0.99,$1.99 , on...) statically.

- want price on buttons dynamically on itunes store.

is possible price tier itunes's inapp , display that?

you request list of available skproducts with:

[[skproductsrequest alloc] initwithproductidentifiers:self.productidentifiers]; 

then you'll have method this:

- (nsstring*)localizedformattedprice:(skproduct*)product {     nsstring*          formattedstring;     nsnumberformatter* numberformatter;      numberformatter = [[nsnumberformatter alloc] init];     [numberformatter setformatterbehavior:nsnumberformatterbehavior10_4];     [numberformatter setnumberstyle:nsnumberformattercurrencystyle];     [numberformatter setlocale:product.pricelocale];      formattedstring = [numberformatter stringfromnumber:@(product.price)];      return formattedstring; } 

Comments