Android : When loading cordova.js from a remote server, prompt function in cordova.js is not able to communicate with native side

on Sunday, August 31, 2014


I have built a website in spring mvc framework. I want to deploy it to an android app using cordova. For that purpose I installed cordova and required plugins (contact plugin in this case). I took all the js files of cordova and put it on the server. I am including these files in a html file from the server.


Whenever any communication from Js to Native takes place it uses prompt function. Android function onJsPrompt is called whenever prompt function is invoked in javascript. Cordova overrides this android function to intercept messages from Js.


Now my problem is, if I am installing application on phone then it works fine. But if I load cordova.js from server it pops up user prompt and native side doesn't intercept. And hence, no js-native communication takes place.


0 comments:

Post a Comment