j3k0 / cordova-plugin-purchase

In-App Purchase for Cordova on iOS, Android and Windows
https://purchase.cordova.fovea.cc
1.3k stars 537 forks source link

plugin not working #346

Closed nnylip closed 6 years ago

nnylip commented 8 years ago

I'm attempting to use the cc.fovea.cordova.purchase plugin with cordova. Plugin installed using: cordova plugin add cc.fovea.cordova.purchase cordova version: 5.3.3 plugin version: cc.fovea.cordova.purchase 4.0.0 "Purchase" Using a slimmed down version of the example, code: $(document).ready(function() { document.addEventListener("deviceready", onDeviceReady, false);

function onDeviceReady() { initStore(); }

});

// cordova plugin add cc.fovea.cordova.purchase initStore = function() {

if (!window.store) {
    log('Store not available');
    return;
}

else console.log('store is running') var platform = device.platform.toLowerCase(); document.getElementsByTagName('body')[0].className = platform;

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

// Enable remote receipt validation
//store.validator = "https://api.fovea.cc:1982/check-purchase";

// Inform the store of your products
//console.log('registerProducts');

log('registering') store.register({ id: 'lplcoins', // id without package name! com.lpl.lplcoins alias: 'lplcoins', type: store.PAID_SUBSCRIPTION }); log('done registering')

// When any product gets updated, refresh the HTML.
store.when("lplcoins").updated(function (p) {
    app.renderIAP(p);
});

store.when("lplcoins").approved(function(p) {
    log("verify subscription");
    p.verify();
});
store.when("lplcoins").verified(function(p) {
    log("subscription verified");
    p.finish();
});
store.when("lplcoins").unverified(function(p) {
    log("subscription unverified");
});
store.when("lplcoins").updated(function(p) {
    //if (true) {
    if (p.owned) {
        document.getElementById('subscriber-info').innerHTML = 'You are a lucky subscriber!';
    }
    else {
        document.getElementById('subscriber-info').innerHTML = 'You are not subscribed';
    }
});

// Log all errors
store.error(function(error) {
    log('ERROR ' + error.code + ': ' + error.message);
});

// When purchase of an extra life is approved,
// deliver it... by displaying logs in the console.
store.when("lplcoins").approved(function (order) {
    log("You got an EXTRA LIFE!");
    order.finish();
});

// When purchase of the full version is approved,
// show some logs and finish the transaction.
store.when("lplcoins").approved(function (order) {
    log('You just unlocked the FULL VERSION!');
    order.finish();
});

// The play button can only be accessed when the user
// owns the full version.
store.when("lplcoins").updated(function (product) {
    document.getElementById("access-full-version-button").style.display =
        product.owned ? "block" : "none";
});

// When the store is ready (i.e. all products are loaded and in their "final"
// state), we hide the "loading" indicator.
//
// Note that the "ready" function will be called immediately if the store
// is already ready.
store.ready(function() {
    var el = document.getElementById("loading-indicator");
    if (el) el.style.display = 'none';
});

// When store is ready, activate the "refresh" button;
store.ready(function() {
        log('store is ready')
    var el = document.getElementById('refresh-button');
    if (el) {
        el.style.display = 'block';
        el.onclick = function(ev) {
                log('register pressed')
                store.refresh();
        };
    }
});
console.log('refresh');
store.refresh();

}; log = function(arg) { try { if (typeof arg !== 'string') arg = JSON.stringify(arg); console.log('

' + arg + '
');

    $("#talog").append( arg+'\n' );
    $("#talog").each(function () {
    this.style.height = (this.scrollHeight+10)+'px';
});
    //document.getElementById('log').innerHTML += '<div>' + arg + '</div>';
} catch (e) {}

};

I'm getting this output in xcode: 2015-11-20 09:31:48.179 lplcoins[5535:1825275] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///private/var/mobile/Containers/Data/Application/74E27E88-3756-424A-BB5B-D888C474FE3F/Library/Cookies/Cookies.binarycookies 2015-11-20 09:31:48.463 lplcoins[5535:1825275] Apache Cordova native platform version 3.9.2 is starting. 2015-11-20 09:31:48.466 lplcoins[5535:1825275] Multi-tasking -> Device: YES, App: YES 2015-11-20 09:31:48.475 lplcoins[5535:1825275] Unlimited access to network resources 2015-11-20 09:31:48.483 lplcoins[5535:1825275]

Started backup to iCloud! Please be careful. Your application might be rejected by Apple if you store too much data. For more information please read "iOS Data Storage Guidelines" at: https://developer.apple.com/icloud/documentation/data-storage/ To disable web storage backup to iCloud, set the BackupWebStorage preference to "local" in the Cordova config.xml file

2015-11-20 09:31:48.685 lplcoins[5535:1825275] [CDVTimer][file] 64.508021ms 2015-11-20 09:31:48.685 lplcoins[5535:1825275] [CDVTimer][TotalPluginStartup] 65.097988ms 2015-11-20 09:31:49.143 lplcoins[5535:1825275] Resetting plugins due to page load. 2015-11-20 09:31:49.697 lplcoins[5535:1825275] Finished load of: file:///private/var/mobile/Containers/Bundle/Application/25116158-BB61-4E20-BB5F-D97783C53A42/lplcoins.app/www/index.html 2015-11-20 09:31:49.961 lplcoins[5535:1825275] THREAD WARNING: ['InAppPurchase'] took '17.277832' ms. Plugin should use a background thread. 2015-11-20 09:31:49.963 lplcoins[5535:1825275] store is running 2015-11-20 09:31:49.963 lplcoins[5535:1825275]

registering
2015-11-20 09:31:49.964 lplcoins[5535:1825275] [store.js] DEBUG: store.queries !! 'lplcoins registered' 2015-11-20 09:31:49.964 lplcoins[5535:1825275] [store.js] DEBUG: store.queries !! 'paid subscription registered' 2015-11-20 09:31:49.964 lplcoins[5535:1825275] [store.js] DEBUG: store.queries !! 'subscription registered' 2015-11-20 09:31:49.965 lplcoins[5535:1825275] [store.js] DEBUG: store.queries !! 'registered' 2015-11-20 09:31:49.965 lplcoins[5535:1825275] [store.js] DEBUG: ios -> product lplcoins registered 2015-11-20 09:31:49.966 lplcoins[5535:1825275] [store.js] DEBUG: store.queries !! 'lplcoins updated' 2015-11-20 09:31:49.966 lplcoins[5535:1825275] [store.js] DEBUG: store.queries !! 'paid subscription updated' 2015-11-20 09:31:49.967 lplcoins[5535:1825275] [store.js] DEBUG: store.queries !! 'subscription updated' 2015-11-20 09:31:49.967 lplcoins[5535:1825275] [store.js] DEBUG: store.queries !! 'updated' 2015-11-20 09:31:49.968 lplcoins[5535:1825275]
done registering
2015-11-20 09:31:49.968 lplcoins[5535:1825275] [store.js] DEBUG: queries ++ 'lplcoins updated' 2015-11-20 09:31:49.969 lplcoins[5535:1825275] [store.js] DEBUG: queries ++ 'lplcoins approved' 2015-11-20 09:31:49.969 lplcoins[5535:1825275] [store.js] DEBUG: queries ++ 'lplcoins verified' 2015-11-20 09:31:49.970 lplcoins[5535:1825275] [store.js] DEBUG: queries ++ 'lplcoins unverified' 2015-11-20 09:31:49.970 lplcoins[5535:1825275] [store.js] DEBUG: queries ++ 'lplcoins updated' 2015-11-20 09:31:49.970 lplcoins[5535:1825275] [store.js] DEBUG: queries ++ 'lplcoins approved' 2015-11-20 09:31:49.971 lplcoins[5535:1825275] [store.js] DEBUG: queries ++ 'lplcoins approved' 2015-11-20 09:31:49.971 lplcoins[5535:1825275] [store.js] DEBUG: queries ++ 'lplcoins updated' 2015-11-20 09:31:49.972 lplcoins[5535:1825275] refresh 2015-11-20 09:31:49.972 lplcoins[5535:1825275] [store.js] DEBUG: store.trigger -> triggering action refreshed 2015-11-20 09:31:49.973 lplcoins[5535:1825275] [store.js] DEBUG: queries !! 'refreshed' 2015-11-20 09:31:49.973 lplcoins[5535:1825275] [store.js] DEBUG: ios -> initializing storekit 2015-11-20 09:31:49.974 lplcoins[5535:1825275] InAppPurchase[js]: setup ok 2015-11-20 09:31:49.975 lplcoins[5535:1825275] [store.js] INFO: ios -> storekit ready 2015-11-20 09:31:49.975 lplcoins[5535:1825275] [store.js] DEBUG: ios -> loading products 2015-11-20 09:31:49.977 lplcoins[5535:1825275] InAppPurchase[js]: load ["lplcoins"] 2015-11-20 09:31:49.978 lplcoins[5535:1825275] InAppPurchase[objc]: Getting products data 2015-11-20 09:31:49.979 lplcoins[5535:1825275] InAppPurchase[objc]: Set has 1 elements 2015-11-20 09:31:49.979 lplcoins[5535:1825275] InAppPurchase[objc]: - lplcoins 2015-11-20 09:31:49.980 lplcoins[5535:1825275] InAppPurchase[objc]: Starting product request... 2015-11-20 09:31:49.980 lplcoins[5535:1825275] InAppPurchase[objc]: Product request started 2015-11-20 09:31:50.945 lplcoins[5535:1825275] InAppPurchase[objc]: productsRequest: didReceiveResponse: 2015-11-20 09:31:50.945 lplcoins[5535:1825275] InAppPurchase[objc]: Has 0 validProducts 2015-11-20 09:31:50.946 lplcoins[5535:1825275] InAppPurchase[objc]: productsRequest: didReceiveResponse: sendPluginResult: ( ( ), ( lplcoins ) ) 2015-11-20 09:31:50.954 lplcoins[5535:1825275] InAppPurchase[js]: load ok: { valid:[] invalid:["lplcoins"] } 2015-11-20 09:31:50.954 lplcoins[5535:1825275] [store.js] DEBUG: ios -> products loaded 2015-11-20 09:31:50.955 lplcoins[5535:1825275] [store.js] DEBUG: store.queries !! 'lplcoins invalid' 2015-11-20 09:31:50.955 lplcoins[5535:1825275] [store.js] DEBUG: store.queries !! 'paid subscription invalid' 2015-11-20 09:31:50.956 lplcoins[5535:1825275] [store.js] DEBUG: store.queries !! 'subscription invalid' 2015-11-20 09:31:50.956 lplcoins[5535:1825275] [store.js] DEBUG: store.queries !! 'invalid invalid' 2015-11-20 09:31:50.957 lplcoins[5535:1825275] [store.js] DEBUG: store.queries !! 'invalid' 2015-11-20 09:31:50.958 lplcoins[5535:1825275] [store.js] DEBUG: store.queries !! 'lplcoins updated' 2015-11-20 09:31:50.958 lplcoins[5535:1825275] [store.js] WARNING: A callback in 'lplcoins updated' failed with an exception. 2015-11-20 09:31:50.959 lplcoins[5535:1825275] [store.js] WARNING: Can't find variable: app 2015-11-20 09:31:50.959 lplcoins[5535:1825275] [store.js] WARNING: file:///private/var/mobile/Containers/Bundle/Application/25116158-BB61-4E20-BB5F-D97783C53A42/lplcoins.app/www/js/index.js:41:12 triggerWhenProduct@file:///private/var/mobile/Containers/Bundle/Application/25116158-BB61-4E20-BB5F-D97783C53A42/lplcoins.app/www/plugins/cc.fovea.cordova.purchase/www/store-ios.js:600:44 triggerWhenProduct@file:///private/var/mobile/Containers/Bundle/Application/25116158-BB61-4E20-BB5F-D97783C53A42/lplcoins.app/www/plugins/cc.fovea.cordova.purchase/www/store-ios.js:609:84 trigger@file:///private/var/mobile/Containers/Bundle/Application/25116158-BB61-4E20-BB5F-D97783C53A42/lplcoins.app/www/plugins/cc.fovea.cordova.purchase/www/store-ios.js:640:42 trigger@file:///private/var/mobile/Containers/Bundle/Application/25116158-BB61-4E20-BB5F-D97783C53A42/lplcoins.app/www/plugins/cc.fovea.cordova.purchase/www/store-ios.js:529:22 stateChanged@file:///private/var/mobile/Containers/Bundle/Application/25116158-BB61-4E20-BB5F-D97783C53A42/lplcoins.app/www/plugins/cc.fovea.cordova.purchase/www/store-ios.js:517:37 set@file:///private/var/mobile/Containers/Bundle/Application/25116158-BB61-4E20-BB5F-D97783C53A42/lplcoins.app/www/plugins/cc.fovea.cordova.purchase/www/store-ios.js:500:51 storekitLoaded@file:///private/var/mobile/Containers/Bundle/Application/25116158-BB61-4E20-BB5F-D97783C53A42/lplcoins.app/www/plugins/cc.fovea.cordova.purchase/www/store-ios.js:1253:18 protectCall@file:///private/var/mobile/Containers/Bundle/Application/25116158-BB61-4E20-BB5F-D97783C53A42/lplcoins.app/www/plugins/cc.fovea.cordova.purchase/www/store-ios.js:743:27 loadOk@file:///private/var/mobile/Containers/Bundle/Application/25116158-BB61-4E20-BB5F-D97783C53A42/lplcoins.app/www/plugins/cc.fovea.cordova.purchase/www/store-ios.js:919:28 callbackFromNative@file:///private/var/mobile/Containers/Bundle/Application/25116158-BB61-4E20-BB5F-D97783C53A42/lplcoins.app/www/cordova.js:293:63 file:///private/var/mobile/Containers/Bundle/Application/25116158-BB61-4E20-BB5F-D97783C53A42/lplcoins.app/www/cordova.js:1109:35 nativeEvalAndFetch@file:///private/var/mobile/Containers/Bundle/Application/25116158-BB61-4E20-BB5F-D97783C53A42/lplcoins.app/www/cordova.js:1117:13 nativeCallback@file:///private/var/mobile/Containers/Bundle/Application/25116158-BB61-4E20-BB5F-D97783C53A42/lplcoins.app/www/cordova.js:1106:38 global code@file:///private/var/mobile/Containers/Bundle/Application/25116158-BB61-4E20-BB5F-D97783C53A42/lplcoins.app/www/index.html:1:47 2015-11-20 09:31:50.963 lplcoins[5535:1825275] [store.js] DEBUG: store.queries !! 'paid subscription updated' 2015-11-20 09:31:50.964 lplcoins[5535:1825275] [store.js] DEBUG: store.queries !! 'subscription updated' 2015-11-20 09:31:50.964 lplcoins[5535:1825275] [store.js] DEBUG: store.queries !! 'invalid updated' 2015-11-20 09:31:50.965 lplcoins[5535:1825275] [store.js] DEBUG: store.queries !! 'updated' 2015-11-20 09:31:50.965 lplcoins[5535:1825275] [store.js] WARNING: ios -> product lplcoins is NOT valid (lplcoins) 2015-11-20 09:31:50.966 lplcoins[5535:1825275] [store.js] DEBUG: store.queries !! 'lplcoins loaded' 2015-11-20 09:31:50.966 lplcoins[5535:1825275] [store.js] DEBUG: store.queries !! 'paid subscription loaded' 2015-11-20 09:31:50.967 lplcoins[5535:1825275] [store.js] DEBUG: store.queries !! 'subscription loaded' 2015-11-20 09:31:50.968 lplcoins[5535:1825275] [store.js] DEBUG: store.queries !! 'invalid loaded' 2015-11-20 09:31:50.969 lplcoins[5535:1825275] [store.js] DEBUG: store.queries !! 'loaded' 2015-11-20 09:31:50.972 lplcoins[5535:1825275] [store.js] DEBUG: store.queries !! 'lplcoins updated' 2015-11-20 09:31:50.973 lplcoins[5535:1825275] [store.js] WARNING: A callback in 'lplcoins updated' failed with an exception. 2015-11-20 09:31:50.973 lplcoins[5535:1825275] [store.js] WARNING: Can't find variable: app 2015-11-20 09:31:50.974 lplcoins[5535:1825275] [store.js] WARNING: file:///private/var/mobile/Containers/Bundle/Application/25116158-BB61-4E20-BB5F-D97783C53A42/lplcoins.app/www/js/index.js:41:12 triggerWhenProduct@file:///private/var/mobile/Containers/Bundle/Application/25116158-BB61-4E20-BB5F-D97783C53A42/lplcoins.app/www/plugins/cc.fovea.cordova.purchase/www/store-ios.js:600:44 triggerWhenProduct@file:///private/var/mobile/Containers/Bundle/Application/25116158-BB61-4E20-BB5F-D97783C53A42/lplcoins.app/www/plugins/cc.fovea.cordova.purchase/www/store-ios.js:609:84 trigger@file:///private/var/mobile/Containers/Bundle/Application/25116158-BB61-4E20-BB5F-D97783C53A42/lplcoins.app/www/plugins/cc.fovea.cordova.purchase/www/store-ios.js:640:42 trigger@file:///private/var/mobile/Containers/Bundle/Application/25116158-BB61-4E20-BB5F-D97783C53A42/lplcoins.app/www/plugins/cc.fovea.cordova.purchase/www/store-ios.js:529:22 storekitLoaded@file:///private/var/mobile/Containers/Bundle/Application/25116158-BB61-4E20-BB5F-D97783C53A42/lplcoins.app/www/plugins/cc.fovea.cordova.purchase/www/store-ios.js:1255:22 protectCall@file:///private/var/mobile/Containers/Bundle/Application/25116158-BB61-4E20-BB5F-D97783C53A42/lplcoins.app/www/plugins/cc.fovea.cordova.purchase/www/store-ios.js:743:27 loadOk@file:///private/var/mobile/Containers/Bundle/Application/25116158-BB61-4E20-BB5F-D97783C53A42/lplcoins.app/www/plugins/cc.fovea.cordova.purchase/www/store-ios.js:919:28 callbackFromNative@file:///private/var/mobile/Containers/Bundle/Application/25116158-BB61-4E20-BB5F-D97783C53A42/lplcoins.app/www/cordova.js:293:63 file:///private/var/mobile/Containers/Bundle/Application/25116158-BB61-4E20-BB5F-D97783C53A42/lplcoins.app/www/cordova.js:1109:35 nativeEvalAndFetch@file:///private/var/mobile/Containers/Bundle/Application/25116158-BB61-4E20-BB5F-D97783C53A42/lplcoins.app/www/cordova.js:1117:13 nativeCallback@file:///private/var/mobile/Containers/Bundle/Application/25116158-BB61-4E20-BB5F-D97783C53A42/lplcoins.app/www/cordova.js:1106:38 global code@file:///private/var/mobile/Containers/Bundle/Application/25116158-BB61-4E20-BB5F-D97783C53A42/lplcoins.app/www/index.html:1:47 2015-11-20 09:31:50.977 lplcoins[5535:1825275] [store.js] DEBUG: store.queries !! 'paid subscription updated' 2015-11-20 09:31:50.978 lplcoins[5535:1825275] [store.js] DEBUG: store.queries !! 'subscription updated' 2015-11-20 09:31:50.979 lplcoins[5535:1825275] [store.js] DEBUG: store.queries !! 'invalid updated' 2015-11-20 09:31:50.979 lplcoins[5535:1825275] [store.js] DEBUG: store.queries !! 'updated' 2015-11-20 09:31:51.009 lplcoins[5535:1825275]
store is ready

Any and all help appreciated, (been working on this for days!)

nnylip commented 8 years ago

I found an issue with my code, here is revised: $(document).ready(function() { document.addEventListener("deviceready", onDeviceReady, false);

function onDeviceReady() { initStore(); }

});

// cordova plugin add cc.fovea.cordova.purchase initStore = function() {

if (!window.store) {
    log('Store not available');
    return;
}

else console.log('store is running') var platform = device.platform.toLowerCase(); document.getElementsByTagName('body')[0].className = platform;

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

// Enable remote receipt validation
//store.validator = "https://api.fovea.cc:1982/check-purchase";

// Inform the store of your products
//console.log('registerProducts');

log('registering') store.register({ id: 'lplcoins', // id without package name! com.lpl.lplcoins alias: 'lplcoins', type: store.PAID_SUBSCRIPTION }); log('done registering')

// When any product gets updated, refresh the HTML.
store.when("lplcoins").updated(function (p) {
        log("updated subscription"+p.id);       
        log('updated: ' + p.price);
    //app.renderIAP(p);
});

store.when("lplcoins").approved(function(p) {
    log("approved subscription");
    p.verify();
});
store.when("lplcoins").verified(function(p) {
    log("subscription verified"+p.id);
    p.finish();
});
store.when("lplcoins").unverified(function(p) {
    log("subscription unverified"+p.id);
});
store.when("lplcoins").updated(function(p) {
    //if (true) {
    if (p.owned) {
        document.getElementById('subscriber-info').innerHTML = 'You are a lucky subscriber!';
    }
    else {
        document.getElementById('subscriber-info').innerHTML = 'You are not subscribed';
    }
});

// Log all errors
store.error(function(error) {
    log('ERROR ' + error.code + ': ' + error.message);
});

// When purchase of an extra life is approved,
// deliver it... by displaying logs in the console.
store.when("lplcoins").approved(function (order) {
    log("You got an EXTRA LIFE!");
    order.finish();
});

// When purchase of the full version is approved,
// show some logs and finish the transaction.
store.when("lplcoins").approved(function (order) {
    log('You just unlocked the FULL VERSION!');
    order.finish();
});

// The play button can only be accessed when the user
// owns the full version.
store.when("lplcoins").updated(function (product) {
    document.getElementById("access-full-version-button").style.display =
        product.owned ? "block" : "none";
});

// When the store is ready (i.e. all products are loaded and in their "final"
// state), we hide the "loading" indicator.
//
// Note that the "ready" function will be called immediately if the store
// is already ready.
store.ready(function() {
    var el = document.getElementById("loading-indicator");
    if (el) el.style.display = 'none';
});

// When store is ready, activate the "refresh" button;
store.ready(function() {
        log('store is ready')
    var el = document.getElementById('refresh-button');
    if (el) {
        el.style.display = 'block';
        el.onclick = function(ev) {
                log('register pressed')
             store.refresh();
        };
    }
});
console.log('refresh');
store.refresh();

}; log = function(arg) { try { if (typeof arg !== 'string') arg = JSON.stringify(arg); console.log('

' + arg + '
');

    $("#talog").append( arg+'\n' );
    $("#talog").each(function () {
    this.style.height = (this.scrollHeight+10)+'px';
});
    //document.getElementById('log').innerHTML += '<div>' + arg + '</div>';
} catch (e) {}

};

Now getting this output in xcode: 2015-11-20 13:11:00.383 lplcoins[5679:1858727] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///private/var/mobile/Containers/Data/Application/FA8F504F-8688-45A8-8E10-CF058258EA5C/Library/Cookies/Cookies.binarycookies 2015-11-20 13:11:00.669 lplcoins[5679:1858727] Apache Cordova native platform version 3.9.2 is starting. 2015-11-20 13:11:00.672 lplcoins[5679:1858727] Multi-tasking -> Device: YES, App: YES 2015-11-20 13:11:00.680 lplcoins[5679:1858727] Unlimited access to network resources 2015-11-20 13:11:00.689 lplcoins[5679:1858727]

Started backup to iCloud! Please be careful. Your application might be rejected by Apple if you store too much data. For more information please read "iOS Data Storage Guidelines" at: https://developer.apple.com/icloud/documentation/data-storage/ To disable web storage backup to iCloud, set the BackupWebStorage preference to "local" in the Cordova config.xml file

2015-11-20 13:11:00.895 lplcoins[5679:1858727] [CDVTimer][file] 66.745996ms 2015-11-20 13:11:00.896 lplcoins[5679:1858727] [CDVTimer][TotalPluginStartup] 67.312002ms 2015-11-20 13:11:01.340 lplcoins[5679:1858727] Resetting plugins due to page load. 2015-11-20 13:11:01.897 lplcoins[5679:1858727] Finished load of: file:///private/var/mobile/Containers/Bundle/Application/6B3A71E9-AC0A-40FC-86F1-78C8548606A4/lplcoins.app/www/index.html 2015-11-20 13:11:02.141 lplcoins[5679:1858727] THREAD WARNING: ['InAppPurchase'] took '15.644287' ms. Plugin should use a background thread. 2015-11-20 13:11:02.143 lplcoins[5679:1858727] store is running 2015-11-20 13:11:02.143 lplcoins[5679:1858727]

registering
2015-11-20 13:11:02.143 lplcoins[5679:1858727] [store.js] DEBUG: store.queries !! 'lplcoins registered' 2015-11-20 13:11:02.144 lplcoins[5679:1858727] [store.js] DEBUG: store.queries !! 'paid subscription registered' 2015-11-20 13:11:02.144 lplcoins[5679:1858727] [store.js] DEBUG: store.queries !! 'subscription registered' 2015-11-20 13:11:02.145 lplcoins[5679:1858727] [store.js] DEBUG: store.queries !! 'registered' 2015-11-20 13:11:02.145 lplcoins[5679:1858727] [store.js] DEBUG: ios -> product lplcoins registered 2015-11-20 13:11:02.146 lplcoins[5679:1858727] [store.js] DEBUG: store.queries !! 'lplcoins updated' 2015-11-20 13:11:02.146 lplcoins[5679:1858727] [store.js] DEBUG: store.queries !! 'paid subscription updated' 2015-11-20 13:11:02.147 lplcoins[5679:1858727] [store.js] DEBUG: store.queries !! 'subscription updated' 2015-11-20 13:11:02.147 lplcoins[5679:1858727] [store.js] DEBUG: store.queries !! 'updated' 2015-11-20 13:11:02.147 lplcoins[5679:1858727]
done registering
2015-11-20 13:11:02.148 lplcoins[5679:1858727] [store.js] DEBUG: queries ++ 'lplcoins updated' 2015-11-20 13:11:02.148 lplcoins[5679:1858727] [store.js] DEBUG: queries ++ 'lplcoins approved' 2015-11-20 13:11:02.149 lplcoins[5679:1858727] [store.js] DEBUG: queries ++ 'lplcoins verified' 2015-11-20 13:11:02.150 lplcoins[5679:1858727] [store.js] DEBUG: queries ++ 'lplcoins unverified' 2015-11-20 13:11:02.151 lplcoins[5679:1858727] [store.js] DEBUG: queries ++ 'lplcoins updated' 2015-11-20 13:11:02.152 lplcoins[5679:1858727] [store.js] DEBUG: queries ++ 'lplcoins approved' 2015-11-20 13:11:02.153 lplcoins[5679:1858727] [store.js] DEBUG: queries ++ 'lplcoins approved' 2015-11-20 13:11:02.153 lplcoins[5679:1858727] [store.js] DEBUG: queries ++ 'lplcoins updated' 2015-11-20 13:11:02.154 lplcoins[5679:1858727] refresh 2015-11-20 13:11:02.154 lplcoins[5679:1858727] [store.js] DEBUG: store.trigger -> triggering action refreshed 2015-11-20 13:11:02.155 lplcoins[5679:1858727] [store.js] DEBUG: queries !! 'refreshed' 2015-11-20 13:11:02.155 lplcoins[5679:1858727] [store.js] DEBUG: ios -> initializing storekit 2015-11-20 13:11:02.156 lplcoins[5679:1858727] InAppPurchase[js]: setup ok 2015-11-20 13:11:02.156 lplcoins[5679:1858727] [store.js] INFO: ios -> storekit ready 2015-11-20 13:11:02.157 lplcoins[5679:1858727] [store.js] DEBUG: ios -> loading products 2015-11-20 13:11:02.157 lplcoins[5679:1858727] InAppPurchase[js]: load ["lplcoins"] 2015-11-20 13:11:02.158 lplcoins[5679:1858727] InAppPurchase[objc]: Getting products data 2015-11-20 13:11:02.158 lplcoins[5679:1858727] InAppPurchase[objc]: Set has 1 elements 2015-11-20 13:11:02.161 lplcoins[5679:1858727] InAppPurchase[objc]: - lplcoins 2015-11-20 13:11:02.162 lplcoins[5679:1858727] InAppPurchase[objc]: Starting product request... 2015-11-20 13:11:02.162 lplcoins[5679:1858727] InAppPurchase[objc]: Product request started 2015-11-20 13:11:02.865 lplcoins[5679:1858727] InAppPurchase[objc]: productsRequest: didReceiveResponse: 2015-11-20 13:11:02.865 lplcoins[5679:1858727] InAppPurchase[objc]: Has 0 validProducts 2015-11-20 13:11:02.866 lplcoins[5679:1858727] InAppPurchase[objc]: productsRequest: didReceiveResponse: sendPluginResult: ( ( ), ( lplcoins ) ) 2015-11-20 13:11:02.880 lplcoins[5679:1858727] InAppPurchase[js]: load ok: { valid:[] invalid:["lplcoins"] } 2015-11-20 13:11:02.880 lplcoins[5679:1858727] [store.js] DEBUG: ios -> products loaded 2015-11-20 13:11:02.881 lplcoins[5679:1858727] [store.js] DEBUG: store.queries !! 'lplcoins invalid' 2015-11-20 13:11:02.881 lplcoins[5679:1858727] [store.js] DEBUG: store.queries !! 'paid subscription invalid' 2015-11-20 13:11:02.882 lplcoins[5679:1858727] [store.js] DEBUG: store.queries !! 'subscription invalid' 2015-11-20 13:11:02.882 lplcoins[5679:1858727] [store.js] DEBUG: store.queries !! 'invalid invalid' 2015-11-20 13:11:02.883 lplcoins[5679:1858727] [store.js] DEBUG: store.queries !! 'invalid' 2015-11-20 13:11:02.883 lplcoins[5679:1858727] [store.js] DEBUG: store.queries !! 'lplcoins updated' 2015-11-20 13:11:02.884 lplcoins[5679:1858727]
updated subscriptionlplcoins
2015-11-20 13:11:02.884 lplcoins[5679:1858727]
updated: null
2015-11-20 13:11:02.885 lplcoins[5679:1858727] [store.js] DEBUG: store.queries !! 'paid subscription updated' 2015-11-20 13:11:02.885 lplcoins[5679:1858727] [store.js] DEBUG: store.queries !! 'subscription updated' 2015-11-20 13:11:02.886 lplcoins[5679:1858727] [store.js] DEBUG: store.queries !! 'invalid updated' 2015-11-20 13:11:02.886 lplcoins[5679:1858727] [store.js] DEBUG: store.queries !! 'updated' 2015-11-20 13:11:02.887 lplcoins[5679:1858727] [store.js] WARNING: ios -> product lplcoins is NOT valid (lplcoins) 2015-11-20 13:11:02.887 lplcoins[5679:1858727] [store.js] DEBUG: store.queries !! 'lplcoins loaded' 2015-11-20 13:11:02.911 lplcoins[5679:1858727] [store.js] DEBUG: store.queries !! 'paid subscription loaded' 2015-11-20 13:11:02.912 lplcoins[5679:1858727] [store.js] DEBUG: store.queries !! 'subscription loaded' 2015-11-20 13:11:02.913 lplcoins[5679:1858727] [store.js] DEBUG: store.queries !! 'invalid loaded' 2015-11-20 13:11:02.914 lplcoins[5679:1858727] [store.js] DEBUG: store.queries !! 'loaded' 2015-11-20 13:11:02.914 lplcoins[5679:1858727] [store.js] DEBUG: store.queries !! 'lplcoins updated' 2015-11-20 13:11:02.915 lplcoins[5679:1858727]
updated subscriptionlplcoins
2015-11-20 13:11:02.916 lplcoins[5679:1858727]
updated: null
2015-11-20 13:11:02.916 lplcoins[5679:1858727] [store.js] DEBUG: store.queries !! 'paid subscription updated' 2015-11-20 13:11:02.919 lplcoins[5679:1858727] [store.js] DEBUG: store.queries !! 'subscription updated' 2015-11-20 13:11:02.920 lplcoins[5679:1858727] [store.js] DEBUG: store.queries !! 'invalid updated' 2015-11-20 13:11:02.921 lplcoins[5679:1858727] [store.js] DEBUG: store.queries !! 'updated' 2015-11-20 13:11:02.951 lplcoins[5679:1858727]
store is ready

Output is saying the product is invalid. QUESTION: is a completed contract required to be able to test the in-app purchase (to query a valid product)?

thedarkman123 commented 8 years ago

Did you find solution for product not valid?

nnylip commented 8 years ago

Thanks for the reply. This is currently still happening. However, it may be caused by the apple itunes connect agreements not being in place. I am waiting for apple to approve everything. If you are involved with the plugin dev or documentation it would be good to add something about the legal stuff being in place before the store responds correctly. Assuming this is true, it took a lot of digging to find this out. I will try again when it gets approved and let you know. - Lou

On 12/02/2015 05:38 AM, benny wrote:

Did you find solution for product not valid?

— Reply to this email directly or view it on GitHub https://github.com/j3k0/cordova-plugin-purchase/issues/346#issuecomment-161253919.

nnylip commented 8 years ago

Benny - I am receiving the following exception while testing with the plugin:

On AppDelegate line: Getting a Thread 1: EXC_BAD_ACCESS (code=1, address=...)

int main(int argc, char* argv[]) { @autoreleasepool { int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate"); return retVal; } }

Also, I am still confused about how the sequence of a non-renewing subscription works. This is my current understanding:

. user downloads in-app purchase enabled app

. user attempts to use the app, app detects it is not subscribed and opens a web view with apple url: https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/manageSubscriptions

(question, how does itunes know which app is be charged?)

. user pays and app is enabled.

. after some period of time (1 year in our case), app detects it is no longer subscribed and then opens the url mentioned above.

Thanks - Lou

On 12/02/2015 05:38 AM, benny wrote:

Did you find solution for product not valid?

— Reply to this email directly or view it on GitHub https://github.com/j3k0/cordova-plugin-purchase/issues/346#issuecomment-161253919.

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.