Ionic Auth0 error: "Cannot read property 'isAvailable' of undefined" - ionic-framework

I downloaded the example project from Auth0's website. When I run the project with the ionic serve command the main page pulls up fine, but when I press login it throws the error Cannot read property 'isAvailable' of undefined. I have tried running this app on an Android device and it does work. Any ideas on how to fix this error? Thanks.

#cyberabis is correct in his comment.
ionic serve does not load cordova plugins.
Auth0 uses auth0-cordova plugin which in turn requires:
cordova-plugin-safariviewcontroller
cordova-plugin-customurlscheme
All these require you to run the ionic app in your device or emulator if you want to test the login functionality.

Related

g-places-autocomplete not working on android build

I am creating app on ionic and used g-places-autocomplete for google place auto complete.
It works well on browser, but not working on app after I built it on android app via ionic build android command.
After debug with android test app, i got error that i have not add Referrer URL as per android strucuture which is "file_url//android_asset/XXXXX".
After i added above type of URL, it start working.

Ionic 2 Emulator

I am trying to launch my app in an emulator but Im getting lots of generic console errors as if it were in a browser... anyone got any clue why this is this is one of the errors
console.warn: Native: tried calling Facebook.login, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator
and this is the command I am using, the desired outcome is having livereload in the device and also having it emulated.. at the moment it acts as though it is in a browser and outputs the above error when I try to use facebook authentication
ionic emulate ios "--port" "8000" "--address" "192.168.56.1" "--liveReloadPort" "8000" "--nobrowser" "--consolelogs" "--serverlogs" -l
Any changes to plugins will require a full rebuild. So if you have added Facebook plugin after live reload try rebuilding.

Ionic missing InAppBrowser plugin error When doing custom authentication

I've created an Ionic app and I'm trying to use the Custom Authentication option eg. Ionic.Auth.login('custom', authOptions, data).then(success, failure); However, I get an error message in the failure saying "Missing InAppBrowser plugin".
The plugin is installed and I've tried to uninstall and reinstall the plugin with no luck. When I use 'basic' the request goes through fine.
How do I fix this or get around it?
Plugins only work when running in native devices. You can't use them on browser with ionic serve.
You may want to start testing on a real android device or emulator.
Alternatively, there's a chrome plugin called Ripple that emulate an real devices with native-like features, allowing you to use some plugins on browser.

My Ionic app works fine on browser but does not open in my phone

my ionic project works fine with ionic serve --lab ,but while copied the.apk file in build folder to my phone and install the app but blank screen appears ,
Please can anyone suggest what might be my problem
my app is using google maps,key is provieded for both app and browser in index.html
Have you tried running it in the emulator ? Since its much easier to see the error logs . Try ionic emulate android -l or ios -l (whichever OS you are building for) and then once the execution starts run the command consolelogs it will log all the activity and you will have a better understanding about why its not working.
+1 for using Chrome Remote Debugging feature. It give you the same output as you would receive from running you app in the browser.
Additionally, I have found that sometimes if your app is already compiled, the ionic CLI doesnt always copy your current files into the APK, and uses the older cached files instead. If you are banging your head against the wall, run the following commands to make sure you have your latest code in your APK.
ionic platform remove android
ionic platform add android
ionic run android
I suggest you use the Chrome Remote Debugging feature. I encountered the same, and looked for answers to my symptom for hours. Once I connected to the chrome remote debugger, I got the console.log back, and noticed there was a problem in my routing setup.
It was a problem with ionic CLI. I've updated it to the latest and reinstalled all dependencies.

how to add facebook login in phonegap using android studio

i am just begginer in phonegap
i have to integrate facebook login in my phonegap app which fetches all the information of user and and his friends
after a hours of search on google i am unable to find a proper documented example
i meet with lots of plugin and example but unable to understand or getting error when executing so, can any one provide me the link or explain me for this
i am using android studio
i have installed ant, node.js , phonegap, android studio java.
for creating new phonegap project
i have done following steps
open node.js and type following commands
1. phonegap create example
2. cd example
3. phonegap build android
this creates a project folder example in my c drive with some folders named "hooks","paltform","plugins","www" and config.xml with package name"com.phonegap.example"
then i try to install facebook plugin by typing this cordova plugin add https //github.com/phonegap/phonegap-facebook-plugin --variable APP_ID="12344" --variable APP_NAME="xyz"
after this my system goes for a long batch process and comes with some error after 30-40 minutes i have attached a image of error
in facebook developer i have done following steps to make a new app registered app
1. add new app
2. then select platform android
3. skip and craete app id
4. enter captcha
5. add a display name
![error on command line][2]i didn't understand where i am doing wrong
i have found my mistake
it was in command line --
"cordova plugin add https //github.com/phonegap/phonegap-facebook-plugin --variable APP_ID="12344" --variable APP_NAME="xyz" "
**so i rectified it and change it to
cd myprojectfolder
and then
cordova plugin add https://github.com/phonegap/phonegap/phonegap-facebook-plugin --variable APP_ID="123456789" --variable APP_NAME="myFacebookApplication"**
it solves my problem
this tutorial help me a lot http://www.phonegaptutorial.com/integrate-facebook-into-your-phonegap-app/