Skip to content

Commit

Permalink
Updated package IDs for workingedge
Browse files Browse the repository at this point in the history
Added interrupt to allow remote debugger to be connected
  • Loading branch information
dpa99c committed Jul 4, 2015
1 parent dccad46 commit a3f9ad1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .gitignore
@@ -0,0 +1,3 @@

platforms/
plugins/
2 changes: 1 addition & 1 deletion config.xml
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="cc.fovea.purchase.demo" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="uk.co.workingedge.test.inapp" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>PurchaseDemo</name>
<description>
A sample Cordova application that demonstrates the use of the Purchase plugin
Expand Down
24 changes: 19 additions & 5 deletions www/js/index.js
Expand Up @@ -45,7 +45,11 @@ app.initialize = function() {
// will just initialize the Purchase plugin
app.onDeviceReady = function() {
log('onDeviceReady');
this.initStore();
alert("This alert interrupts the main JS thread so you can connect a remote debugger to the WebView...");
setTimeout(function(){
this.initStore();
}.bind(this), 2000);

};

// initialize the purchase plugin if available
Expand All @@ -56,6 +60,8 @@ app.initStore = function() {
return;
}

debugger;

// Enable maximum logging level
store.verbosity = store.DEBUG;

Expand All @@ -65,23 +71,30 @@ app.initStore = function() {
// Inform the store of your products
log('registerProducts');
store.register({
id: 'cc.fovea.purchase.consumable1',
id: 'uk.co.workingedge.test.inapp.consumable1',
alias: 'extra life',
type: store.CONSUMABLE
});

store.register({
id: 'cc.fovea.purchase.nonconsumable1',
id: 'uk.co.workingedge.test.inapp.nonconsumable1',
alias: 'full version',
type: store.NON_CONSUMABLE
});

store.register({
id: 'cc.fovea.purchase.subscription1',
id: 'uk.co.workingedge.test.inapp.subscription1',
alias: 'subscription1',
type: store.PAID_SUBSCRIPTION
});

store.register({
id: 'uk.co.workingedge.test.inapp.nonconsumablehosted1',
alias: 'hosted1',
type: store.NON_CONSUMABLE
});


// When any product gets updated, refresh the HTML.
store.when("product").updated(function (p) {
app.renderIAP(p);
Expand Down Expand Up @@ -187,7 +200,8 @@ app.initStore = function() {

app.renderIAP = function(p) {

var elId = p.id.split(".")[3];
var parts = p.id.split(".");
var elId = parts[parts.length-1];

var el = document.getElementById(elId + '-purchase');
if (!el) return;
Expand Down

0 comments on commit a3f9ad1

Please sign in to comment.