Using ionic-native Facebook plugin in Browser - facebook

I have created a new Ionic (Capacitor) app and I want to use the native facebook plugin, The plugin documentation says that is supported in the Android, iOS and Browser platforms, but when I run the app in the browser I get a Native: tried calling Facebook.login, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator error.
How can I run the facebook plugin from the browser?

Related

Any cordova plugin to add WebAuthn API to Android WebView?

We've developed a cordova app that shows one of our websites (which is also accessible using a web browser).
Recently, FIDO2 authentication using WebAuthn has been added to that website. This works fine in the tested browsers (Chrome and Firefox), but not in our cordova application, as it uses Android WebView, which doesn't implement the WebAuthn API.
Does anybody know if there is any cordova plugin to add this API to Android WebView?
Is there any website with information about the Android WebView roadmap (bugs that will be fixed in next release, new features that will be added, ...)?
You're correct that Android WebView doesn't support WebAuthn in Android 13. We hope to address that in the Android 14 timeframe but, for now, you have to inject Javascript hooks and use a Javascript bridge to implement it. It's certainly possible to do but I'm not aware of any packaged solutions that do it.

How to integrate the Facebook login in progressive web application

I am building a Progressive web application with IONIC 3. I am following -
https://medium.com/#fraxool/add-facebook-login-to-your-ionic-3-app-the-step-by-step-guide-88879e391a3b
Now the problem is when I am using ionic serve then in the browser when I am clicking on Login with Facebook button,
then it is showing me an error on the console as
Native: tried calling Facebook.login, but Cordova is
not available. Make sure to include cordova.js or run in a
device/simulator cordovaWarn # vendor.js:60197 main.js:1058 Error
logging into Facebook cordova_not_available
I can understand that as I am using the browser, and Ionic serve will never generate Cordova files, so what is the right way to implement the Facebook login in an Ionic progressive web application.

Is there a way to integrate facebook & google login in ionic PWA

I developed an app in ionic 3. It's working fine for android & iOS. Then I added browser platform but fb & google login not working for it.
Ionic documentation http://ionicframework.com/docs/native/facebook/ says facebook plugin is supported in browser. But it's not working.
Google plus plugin only supports android & iOS.
So how to integrate fb & google login in PWA developed in ionic 3?
I have tried using angular4-social-login module but no luck. Also I tried using javascript sdk but no success.
Facebook with Browser:
After you add the browser platform:
ionic cordova platform add browser
ionic cordova build browser --prod
After that in your facebook develop website settings page, add your server's domain to app domain (or localhost for testing).
You can read more about it here: browser

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.

Incorporating ngcordova plugin results in errors

In order to incorporate the Toastr ngCordova plugin.. I followed the following steps
bower install ngCordova
include ngCordova in my app
angular.module('app', ['ionic', 'ngCordova'])
Install plugin
cordova plugin add https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin.git
Use the plugin
app.controller('myController', function($cordovaToast) {
});
This seems pretty straight forward. However I encounter the following errors:
ionic.bundle.js:21157 TypeError: Cannot read property 'toast' of undefined
at Object.show (http://localhost:8100/lib/ngCordova/dist/ng-cordova.min.js:9:20474)
I am running the app in chrome browser.
What am I missing here ?
ngCordova plugins won't work in the browser.
From documentation:
Only develop on your phone
Cordova plugins do not work while developing in your browser, because each plugin accesses a specific API (such as camera, microphone, accelerometer) which is not available in your browser. Additionally, some plugins don't work in the emulator, such as the Camera plugin, so development on your physical device is required.
In this case be sure that your application works on your device.