PhoneGap Phone Page

I know that the index.html page (PhoneGap launch page) should be on the device. but if we want to create an application that uses third-party authentication before moving on to the main application, then what should we do?

Thank you in advance

+4
source share
3 answers

In android you can change the start page in the main action or redirect to index.html

+1
source

Well, you don’t say if you are platform specific. And there are many third-party authorization options.

But I can offer two solutions (true, my own code, etc.), both of them use PhoneGap for Android and PhoneGap plugins. The key code element for me was the onLocationChange callback function of the ChildBrowser plugin. Your application can take the user to other sites for authorization or something else, but still get control back.

Tutorial on using the Twitter REST API (OAuth 1, ChildBrowser, jsOAuth plugin)

Free Android app + Source on github : AppLaud App (OpenID, ChildBrowser, custom server)

+1
source

For authentication, you can have the form in your index.html (possibly under the login div) to make a message on the actual web server.

Then, retrieve the data returned from the web server to allow your user to access the features of your home phone application.

You can disable functionality until you receive a successful login from a web server. If you send a message via ajax, the webview will not even blink, but you will still receive a successful response to the login from the web server and just turn on the functionality in your application after that.

Let me know if this is confusing and I will try to explain more clearly and I hope this helps.

+1
source

Source: https://habr.com/ru/post/1389211/


All Articles