How do I pass some JSON data to my cordova app from another app (Say chrome for example).
Suppose I have a website that is being displayed in chrome. And I have a widget on the webpage, which when clicked will open the cordova app installed on the phone(doable). But how do I pass JSON data from the webpage (running in chrome or any other browser) into the cordova app?
In my web page (Being rendered in chrome) I have a link like this:
<a href="intent://myApp/#Intent;scheme=myapp;package=com.my.app;S.name=Mark;I.age=18;end">Open the App</a>
So this will open my cordova app, so after I do open my cordova app I need the data which is name and age. How do I do it?
I tried to access extras
inside the onCreate
method like :
Bundle appData = getIntent().getExtras();
But it crashes. Even if I somehow do, how do I get the appData
into the webview?