This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'cordova-plugin-purchase'; | |
document.addEventListener('deviceready', onDeviceReady); | |
let log: CdvPurchase.Logger; | |
let statusMessage: null | string = null; | |
function setStatusMessage(value: null | string) { | |
if (statusMessage !== value) { | |
statusMessage = value; | |
renderStatusUI(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; media-src *; img-src 'self' data: content:;"> | |
<meta name="format-detection" content="telephone=no"> | |
<meta name="msapplication-tap-highlight" content="no"> | |
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width"> | |
<title>Hello World</title> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener('deviceready', onDeviceReady); | |
function onDeviceReady() { | |
const store = CdvPurchase.store; | |
const { ProductType, Platform, LogLevel, Product, VerifiedReceipt } = CdvPurchase; // shortcuts | |
// We should first register all our products or we cannot use them in the app. | |
store.register([{ | |
id: 'demo_monthly_basic', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function customTimeoutFunction(audioContext) { | |
let tasks = []; | |
let nextTaskId = 1; | |
function now() { | |
return audioContext.currentTime * 1000; | |
} | |
function scheduler() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sync() { | |
$scope.ready = store.ready(); | |
$scope.product = Object.assign({}, store.get("my_product_id")); | |
} | |
const dsync = window.debounce(sync, 50); | |
$scope.$on("$ionicView.beforeEnter", function () { | |
dsync(); | |
store.when("my_product_id").updated(dsync); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"ok": false, | |
"route": "/v1/validate", | |
"status": 419, | |
"code": 6778003, | |
"message": "Transaction has expired 2020-03-09 10:24:06 Etc/GMT", | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"ok": true, | |
"data": { | |
"ineligible_for_intro_price": [ | |
"my_subscription" | |
], | |
"transaction": { "platform-specific transaction data": "can be ignored" }, | |
"collection": [ | |
{ | |
"id": "my_subscription", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": "com.example.app", | |
"type": "application", | |
"transaction": { | |
"id": "com.example.app", | |
"type": "ios-appstore", | |
"appStoreReceipt": "MIIabcdefgh...xyz==" | |
}, | |
"additionalData": { | |
"applicationUsername": "james_bond_007" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "purchases.updated", | |
"applicationUsername": "my_username", | |
"purchases": { | |
"apple:cc.fovea.purchase.subscription1sx": { | |
"productId": "apple:cc.fovea.purchase.subscription1sx", | |
"platform": "apple", | |
"sandbox": true, | |
"purchaseId": "apple:1000000573800707", | |
"purchaseDate": "2019-09-29T14:15:44.000Z", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"applicationUsername":"1E6676C70C123AA18222EF001120CAE1", | |
"purchases": { | |
"apple:monthly_subcscription": { | |
"productId":"apple:monthly_subcscription", | |
"platform":"apple", | |
"sandbox":true, | |
"purchaseId":"apple:1000000532000112", | |
"purchaseDate":"2019-07-29T17:14:00.000Z", | |
"expirationDate":"2019-07-29T17:19:00.000Z", |
NewerOlder