lodash | title | name | alias | language | framework | hybrid | image | tags | snippets | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
true |
Phonegap Tutorial |
Phonegap |
|
|
|
true |
//auth0.com/lib/platforms-collection/img/phonegap.png |
|
|
In order to run the project, you need to have `node`, `cordova` and `ios-sim` installed. Once you have that, just clone the project and run the following:
cordova build ios
cordova emulate ios
<% if (configuration.api && configuration.thirdParty) { %>
<% } else { %>
<% } %>
Otherwise, if you already have an existing application, please follow the steps below.
Go to the Application Settings section in the Auth0 dashboard and make sure that Allowed Callback URLs contains the following value:
https://@@account.namespace@@/mobile
Also, if you are testing your application locally, make sure to add your local URL as an Allowed Callback URL and the following as an Allowed Origin (CORS):
file://\*
You must install the InAppBrowser
plugin from Cordova to be able to show the Login popup. For that, just run the following command:
@@snippet(meta.snippets.dependencies)@@
Note: If you're using Phonegap Build service, you need to add the plugin using
<gap:plugin
. Please check this phonegap guide for more information
Now, you can just follow the tutorial for the FrontEnd technology that you're using. We currently support applications using jQuery, AngularJS and Vanilla JS.
Warning: Phonegap doesn't support getting dependencies from a CDN, so you're going to have to download the JS and CSS dependencies locally and then point to the downloaded files.
Warning: You must use
popup
mode when configuring an application with Phonegap. (All available guides currently do that by default)
Now it's time to sit back, relax and open a beer. You've implemented Login and Signup with Auth0 and Cordova.
This means that the InAppBrowser
plugin wasn't installed successfully by Cordova. Try any of the followings to fix this.
- Reinstall the
InAppBrowser
plugin
ionic plugin remove org.apache.cordova.inappbrowser
ionic plugin add org.apache.cordova.inappbrowser
- Remove the platform and re add it
ionic platform remove ios
ionic platform add ios
- Copy the contents from the plugin to the platform plugins
cp plugins/org.apache.cordova.inappbrowser/src/ios/* platforms/ios/[yourAppName]/Plugins/org.apache.cordova.inappbrowser/
This could mean that the InAppBrowser
plugin wasn't installed successfully by Cordova. If you are seeing this error only when viewing your app in the ionic viewer app, this article suggests that InAppBrowser
is not yet supported. You can verify this by running the app in your emulator or in the browser. See the previous section to learn how to solve this.