0

My app provides an in-app purchase to get some news alerts as push notifications. Push notifications should be delivered to all devices associated with the same Apple ID that is used to purchase.

Currently I thought of putting a button on the "settings" screen to restore in-app purchases to check if the feature is purchased in another device.

Is there any better way to handle this task? If so, any tips/suggestions would be highly appreciated!

Maduranga E
  • 1,679
  • 5
  • 23
  • 37

3 Answers3

1

The restore purchases option is the correct choice, and probably ought to be there in case the user deletes and reinstalls the application.

David Berry
  • 40,941
  • 12
  • 84
  • 95
0

You should use the restore purchase feature:

[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];

It will restore all purchases that the user has made on that account, weather on the same ios device, or a different one.

Also, as a side note, if you implement In-app purchases without including the restore feature, your ios app will not be accepted by Apple

Jojodmo
  • 23,357
  • 13
  • 65
  • 107
0

Or in iOS7, use SKReceiptRefreshRequest.

self.refreshRequest = [[SKReceiptRefreshRequest alloc] init];
self.refreshRequest.delegate = self;
[self.refreshRequest start];

Also note that this straightforward restore procedure doesn't necessarily work for all types of products. E.g., at least on iOS6, restoreCompletedTransactions will not restore non-renewable subscriptions. But the situation seems more complicated in iOS7 (see Non-renewing Subscriptions: Removed From Receipt?).

Community
  • 1
  • 1
Chris Prince
  • 7,288
  • 2
  • 48
  • 66