payments icon indicating copy to clipboard operation
payments copied to clipboard

`transactionReceipt` in `Order` on iOS deprecated

Open benedictstrube opened this issue 3 years ago • 3 comments

I think the plugin uses the long ago deprecated transactionReceipt property on SKPaymentTransaction. It is actually deprecated since iOS 7.0 and can not be validated trough Apple Servers anymore for newer OS versions. I suggest the following implementation to obtain the receipt on iOS:

get transactionReceipt(): string {
  const receiptData = NSData.dataWithContentsOfURL(NSBundle.mainBundle.appStoreReceiptURL);
  if (receiptData) {
    return receiptData.base64EncodedStringWithOptions(0);
  }
  
  return null;
}

benedictstrube avatar Dec 09 '21 14:12 benedictstrube

Thanks for sharing this! If I saved the apple store receipt ID when someone subscribes, can I still access that somewhere in a way similar to this?

jchavezberkeley avatar Dec 21 '21 15:12 jchavezberkeley

Hey, we have the same problem which keeps us using a different plugin instead of this one. Sadly, this is a deal-breaker for our company when iOS is not supported..

PhilippS93 avatar Jan 07 '22 11:01 PhilippS93

I submitted a PR for this issue, can be tracked here: https://github.com/NativeScript/payments/pull/38

davecoffin avatar Nov 30 '24 18:11 davecoffin