Software Archive
Read-only legacy content
17061 Discussions

inAppBrowser get a value from a site

luis_v_
Beginner
682 Views

hi
i have an app that opens a website with inAppBrowser and i need to get a value from that site
how can i achive that?

0 Kudos
1 Solution
PaulF_IntelCorp
Employee
682 Views

You cannot access Cordova plugin APIs from within the inAppBrowser. Please see the plugin documentation > https://github.com/apache/cordova-plugin-inappbrowser#cordova-plugin-inappbrowser <

Since your mobile app is not part of your website (it is not a page served up by your website), you have to treat access to data on your website as if you were coming from another domain. So you may have to use an oauth technique or an API published by your web server to do what you want. There is not way to encapsulate all the things you can do on a website into a mobile app, they are two independent entities.

To learn how to do what you want to do I recommend you seach StackOverflow for solutions, search under the PhoneGap and Cordova tags. The XDK creates a standard Cordova app.

View solution in original post

0 Kudos
3 Replies
PaulF_IntelCorp
Employee
682 Views

Sorry, but your question is too vague. Try to be more specific.

0 Kudos
luis_v_
Beginner
682 Views

Paul F. (Intel) wrote:

Sorry, but your question is too vague. Try to be more specific.

 

so i opened my website in my app with inappbrowser and i logged in, when the login is done i want to get a value (id) from the website to the app because i need to identify the user. i need this identification because im trying to implement push notifications that are different depending on the user

this line of code: 

window.plugins.OneSignal.sendTag(key, value);
is were i will put the id to send it to one signal

 

0 Kudos
PaulF_IntelCorp
Employee
683 Views

You cannot access Cordova plugin APIs from within the inAppBrowser. Please see the plugin documentation > https://github.com/apache/cordova-plugin-inappbrowser#cordova-plugin-inappbrowser <

Since your mobile app is not part of your website (it is not a page served up by your website), you have to treat access to data on your website as if you were coming from another domain. So you may have to use an oauth technique or an API published by your web server to do what you want. There is not way to encapsulate all the things you can do on a website into a mobile app, they are two independent entities.

To learn how to do what you want to do I recommend you seach StackOverflow for solutions, search under the PhoneGap and Cordova tags. The XDK creates a standard Cordova app.

0 Kudos
Reply