简体   繁体   中英

JXCore Cordova => Native Cordova Plugin (can't reach cordova.exec(…))

I'm using the JXCore Cordova Plugin to get my Node.js Application running on mobile devices. I also wrote a native cordova plugin, to process some tasks in native part of the application.

But I can't reach the native cordova plugin. Is this the right approach to do this?

1. Register method from UI to jxcore instance ( index.js ):
jxcore('someNativeExtension').register(someTriggerMethod);
(where the trigger does something like cordova.exec(...);)

2. Start Node ( index.js ):
jxcore('app.js').loadMainFile(callback);
(after this step I move to another index.html, that is served by express.js:
=> window.open(' http://localhost:8080/apps/backend/index.html ','_blank');)

3. Call method from Node ( app.js ):
Mobile('someNativeExtension').call();

But this snippet doesn't work, because it seems, that cordova.js isn't present, after I receive another html file. Do you have Any Idea, how to fix this?

When you browse another URL, cordova client side files are not loaded with that URL. Since you have the control for the loaded HTML page, that page can load cordova + jxcore JS files

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM