Skip to content

Commit

Permalink
Merge pull request #1360 from j3k0/patch-13.1.6
Browse files Browse the repository at this point in the history
Fix no appStoreReceipt on iOS App first launch
  • Loading branch information
j3k0 authored Jan 1, 2023
2 parents 544e99a + b70ffa7 commit 7a7d0ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/ts/platforms/apple-appstore/appstore-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,10 @@ namespace CdvPurchase {
private async loadAppStoreReceipt(): Promise<undefined | ApplicationReceipt> {
let resolved = false;
return new Promise(resolve => {
this.log.debug('using cached appstore receipt');
if (this.bridge.appStoreReceipt) return resolve(this.bridge.appStoreReceipt);
if (this.bridge.appStoreReceipt?.appStoreReceipt) {
this.log.debug('using cached appstore receipt');
return resolve(this.bridge.appStoreReceipt);
}
this.log.debug('loading appstore receipt...');
this.bridge.loadReceipts(receipt => {
this.log.debug('appstore receipt loaded');
Expand Down
6 changes: 4 additions & 2 deletions www/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -2333,9 +2333,11 @@ var CdvPurchase;
async loadAppStoreReceipt() {
let resolved = false;
return new Promise(resolve => {
this.log.debug('using cached appstore receipt');
if (this.bridge.appStoreReceipt)
var _a;
if ((_a = this.bridge.appStoreReceipt) === null || _a === void 0 ? void 0 : _a.appStoreReceipt) {
this.log.debug('using cached appstore receipt');
return resolve(this.bridge.appStoreReceipt);
}
this.log.debug('loading appstore receipt...');
this.bridge.loadReceipts(receipt => {
this.log.debug('appstore receipt loaded');
Expand Down

0 comments on commit 7a7d0ba

Please sign in to comment.