I'm currently doing InApp purchase in an app, currently I'm following raywenderlich tutorial http://www.raywenderlich.com/21081/introduction-to-in-app-purchases-in-ios-6-tutorial and so far everythings working well. Now the problem is I'm required to do some points calculation based on the product.price from the below function based on dollars. Currently this will work for account based on US market but for other currencies the below log for My point will show a different value. In androids InApp purchase api they also return a microunits apart from price so we can convert into dollar using that microunits, I was wondering if there is any similar thing that is returned in iOS. Is there any workaround for this issue?
- (void)productPurchased:(NSNotification *)notification { SKPaymentTransaction *transaction=notification.object; NSString * productIdentifier = transaction.payment.productIdentifier; [products enumerateObjectsUsingBlock:^(SKProduct * product, NSUInteger idx, BOOL *stop) { if ([product.productIdentifier isEqualToString:productIdentifier]) { NSLog(@"Current Rate:%@",product.price); NSlog(@"My Points:%f" [product.price floatValue]*myPointsFactor); } }];}
ليست هناك تعليقات:
إرسال تعليق