change sth
This commit is contained in:
parent
beedd5b8d7
commit
8b7fa5fe0b
@ -66,11 +66,11 @@ bool AppDelegate::applicationDidFinishLaunching()
|
|||||||
|
|
||||||
se->start();
|
se->start();
|
||||||
se::AutoHandleScope hs;
|
se::AutoHandleScope hs;
|
||||||
jsb_run_script("js/jsb-adapter/jsb-builtin.js");
|
jsb_run_script("luaframework/Data/js/jsb-adapter/jsb-builtin.js");
|
||||||
jsb_run_script("js/jcwallet.js");
|
jsb_run_script("luaframework/Data/js/jcwallet.js");
|
||||||
jsb_run_script("js/platform.js");
|
jsb_run_script("luaframework/Data/js/platform.js");
|
||||||
jsb_run_script("js/main.js");
|
jsb_run_script("luaframework/Data/js/main.js");
|
||||||
jsb_run_script("js/wallet.js");
|
jsb_run_script("luaframework/Data/js/wallet.js");
|
||||||
se->addAfterCleanupHook([]() {
|
se->addAfterCleanupHook([]() {
|
||||||
JSBClassType::destroy();
|
JSBClassType::destroy();
|
||||||
});
|
});
|
||||||
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -112,7 +112,7 @@
|
|||||||
endingColumnNumber = "9223372036854775807"
|
endingColumnNumber = "9223372036854775807"
|
||||||
startingLineNumber = "1177"
|
startingLineNumber = "1177"
|
||||||
endingLineNumber = "1177"
|
endingLineNumber = "1177"
|
||||||
landmarkName = "JSB_loadLocalStorage(s)"
|
landmarkName = "JSB_walletSecKey(s)"
|
||||||
landmarkType = "9">
|
landmarkType = "9">
|
||||||
</BreakpointContent>
|
</BreakpointContent>
|
||||||
</BreakpointProxy>
|
</BreakpointProxy>
|
||||||
@ -128,7 +128,7 @@
|
|||||||
endingColumnNumber = "9223372036854775807"
|
endingColumnNumber = "9223372036854775807"
|
||||||
startingLineNumber = "1178"
|
startingLineNumber = "1178"
|
||||||
endingLineNumber = "1178"
|
endingLineNumber = "1178"
|
||||||
landmarkName = "JSB_loadLocalStorage(s)"
|
landmarkName = "JSB_walletSecKey(s)"
|
||||||
landmarkType = "9">
|
landmarkType = "9">
|
||||||
</BreakpointContent>
|
</BreakpointContent>
|
||||||
</BreakpointProxy>
|
</BreakpointProxy>
|
||||||
|
18
js/main.js
18
js/main.js
@ -522,19 +522,31 @@ function buyTokenWithErc20(funId, currency, amount, gas, estimate) {
|
|||||||
}
|
}
|
||||||
// begin of token mall
|
// begin of token mall
|
||||||
|
|
||||||
// begin of google pay
|
// begin of in-app pay
|
||||||
function queryGoogleProducts(funId, productIds) {
|
function queryGoogleProducts(funId, productIds) {
|
||||||
let ids = JSON.parse(productIds);
|
let ids = JSON.parse(productIds);
|
||||||
console.log('queryAppleProducts:: ' + productIds);
|
console.log('queryGoogleProducts:: ' + productIds);
|
||||||
|
if (window.JavascriptJavaBridge) {
|
||||||
|
promiseCb(funId, jc.wallet.paySvr.queryGoogleProducts(ids));
|
||||||
|
} else {
|
||||||
promiseCb(funId, jc.wallet.paySvr.queryIOSProducts(ids));
|
promiseCb(funId, jc.wallet.paySvr.queryIOSProducts(ids));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function queryGooglePurchases(funId) {
|
function queryGooglePurchases(funId) {
|
||||||
|
if (window.JavascriptJavaBridge) {
|
||||||
|
promiseCb(funId, jc.wallet.paySvr.queryGooglePurchases());
|
||||||
|
} else {
|
||||||
promiseCb(funId, jc.wallet.paySvr.queryIOSPurchases());
|
promiseCb(funId, jc.wallet.paySvr.queryIOSPurchases());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function beginGoogleBuy(funId, productId, orderId) {
|
function beginGoogleBuy(funId, productId, orderId) {
|
||||||
|
if (window.JavascriptJavaBridge) {
|
||||||
|
promiseCb(funId, jc.wallet.paySvr.buyGoogleProduct(productId, orderId));
|
||||||
|
} else {
|
||||||
promiseCb(funId, jc.wallet.paySvr.beginIOSPurchase(productId, orderId));
|
promiseCb(funId, jc.wallet.paySvr.beginIOSPurchase(productId, orderId));
|
||||||
}
|
}
|
||||||
// end of google pay
|
}
|
||||||
|
// end of in-app pay
|
||||||
|
|
||||||
|
@ -6,12 +6,16 @@ if (window.JavascriptJavaBridge) {
|
|||||||
}
|
}
|
||||||
window.jumpToWallet = function(url) {
|
window.jumpToWallet = function(url) {
|
||||||
url = url || 'wc://';
|
url = url || 'wc://';
|
||||||
|
if (window.JavascriptJavaBridge) {
|
||||||
|
url = 'metamask://wc?uri=' + url;
|
||||||
|
} else {
|
||||||
url = `https://metamask.app.link/wc?uri=${encodeURIComponent(url)}`;
|
url = `https://metamask.app.link/wc?uri=${encodeURIComponent(url)}`;
|
||||||
|
}
|
||||||
console.log('open native: ' + url);
|
console.log('open native: ' + url);
|
||||||
jsb.toWallet(url);
|
jsb.toWallet(url);
|
||||||
// jsb.reflection.callStaticMethod(
|
}
|
||||||
// 'UnityAppController',
|
|
||||||
// 'toWallet:',
|
function nativeCallBack(...args) {
|
||||||
// url
|
console.log(`jniCallback: ${args[0]}`);
|
||||||
// )
|
jc.wallet.nativeSvr.handleNativeCallback(...args);
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
function nativeCallBack(...args) {
|
function jniCallback(...args) {
|
||||||
console.log(`jniCallback: ${args[0]}`)
|
console.log(`jniCallback: ${args[0]} | ${args[1]}`);
|
||||||
jc.wallet.nativeSvr.handleNativeCallback(...args);
|
jc.wallet.nativeSvr.handleNativeCallback(...args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user