Androidアプリで定期購読の状態を取得できない
cordovaを使用し、Androidアプリを作成しています。
定期購読機能を追加したのですが、購読手続きは出来たのですが、
その後、定期購読の状態を取得する事が出来ない状態です。
以下のようなログが出ています。
質問自体初めてなので、見づらくて申し訳ないのですが
ご教授お願い致します。
該当のソースコード
ソースコード(javascript)
var listArray;
const constUrl = "url";
const constUserID = "subscription@domain";
const constPassword = "password";
const constSampleUrl = "url"
const constSampleUserID = "sample@domain"
const constSamplePassword = "password"
const store_id = "store_id_00001";
var strSendUrl;
var strUserId;
var strPassword;
var strSelectId;
var isFirst = true;
const headUrl = "https://"
const apiUrl = "/api"
const searchUrl = apiUrl + "/search/"
//初期化処理
ons.ready(function () {
console.log("onsen start");
$('#btnSetting').on('click', function (e) {
console.log('click setting');
document.querySelector('#navigator').pushPage('setting.html');
});
onload();
});
document.addEventListener('init', function (event) {
console.log("init event start=" + event.target.id);
if (event.target.id == "mainPage") {
loadSettings();
}
}, false);
function onload() {
console.log("onload start");
document.addEventListener("deviceready", onDeviceReady, false);
}
function onDeviceReady() {
console.log("onDeviceReady start");
navigator.splashscreen.hide();
listArray = new Array(); window.sessionStorage.setItem("listArraySession", JSON.stringify(listArray)); initializeStore(); store_show(true);
}
// アプリ内課金
function initializeStore() {
console.log('start initializeStore');
store.verbosity = store.DEBUG; // 購入登録 store.register({ id:store_id, alias:store_id, type:store.PAID_SUBSCRIPTION }); store.when(store_id).approved(function(p) { log("verify subscription"); p.verify(); }); store.when(store_id).verified(function(p) { log("subscription verified"); p.finish(); }); store.when(store_id).unverified(function(p) { log("subscription unverified"); }); store.when(store_id).updated(function(p) { if (p.owned) { console.log('owned'); strSendUrl = constUrl; strUserId = constUserID; strPassword = constPassword; } else { console.log('not owned'); strSendUrl = constSampleUrl; strUserId = constSampleUserID; strPassword = constSamplePassword; } }); store.error(function(error) { log('error:' + error.code + ':' + error.message); }); store.ready(); store.refresh();
}
function check_notad(product) {
if (product.owned) {
strSendUrl = constUrl;
strUserId = constUserID;
strPassword = constPassword;
} else {
strSendUrl = constSampleUrl;
strUserId = constSampleUserID;
strPassword = constSamplePassword;
}
}
/* 購入ダイアログ表示 */
function store_show(first = false){
if (first == false) {
store.order(store_id);
}
strSendUrl = constSampleUrl; strUserId = constSampleUserID; strPassword = constSamplePassword; store.when(store_id).approved(function(product) { strSendUrl = constUrl; strUserId = constUserID; strPassword = constPassword; if (first == false) { product.finish(); } }); store.when(store_id).updated(check_notad);
}
function loadSettings() {
console.log("loadSettings start");
if (listArray == null) { listArray = new Array(); window.sessionStorage.setItem("listArraySession", JSON.stringify(listArray)); }
}
### 試したこと iOSアプリでは、購読状態を取得できたのですが Androidアプリでは、取得できない状態です。 ### 補足情報(FW/ツールのバージョンなど) 開発環境macOS(version:1.13.6) cordova(version:9.0.0) 使用プラグイン cc.fovea.cordova.purchase(version:8.1.1) node(version:8.12.0) android studio(version:3.5.3)
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/03/09 01:44
2020/03/10 23:07
2020/04/02 02:22