How to properly implement Facebook login for ionic 'desktop' build?

I want to build a PWA that runs on both mobile and desktop browser. However, it seems like there is only official solution for native Facebook login via the ionic native. But there is no suggestion for the desktop.

1 Like

Following this as well

How is this usually done in desktop application?

Well… there is best practices for Facebook JS SDK for AngularJS
https://developers.facebook.com/docs/javascript/howto/angularjs

However, I just wonder how to robustly integrate it for ionic3 i.e. being able to conditionally and automatically build for iOS, Android versus Desktop using the same code and fallback mechanism between native cordova plugin and the web integration.

Any recommendation?

have you tried using facebook sdk on mobile? i think it should work. at least google maps sdk and stripe sdk works in my app, thinking about the same implementation of facebook/googlePlus login

1 Like

Interesting problem, I don’t know if there is a solution for this already.

Using the AngularJS lib probably won’t be very helpful as Ionic (2, 3) is based on Angular which is quite different from AngulgarJS - but maybe this is still possible.

But: Ionic Native 3 added simple mocking mechanisms for the browser platform: https://ionicframework.com/docs/native/browser.html This could be the base for the [quote=“nicknet360, post:4, topic:88443”]
being able to conditionally and automatically build for iOS, Android versus Desktop using the same code and fallback mechanism between native cordova plugin and the web integration
[/quote]

you mentioned. You “just” have to implement these mocks with one of the libraries Facebook offers.

@nicknet360 have you integrated fb login with pwa? I want to do same but finding no way.

Refer above sample