nativescript-oauth2 icon indicating copy to clipboard operation
nativescript-oauth2 copied to clipboard

Login to Facebook is closed on Android embedded browsers

Open Przemase opened this issue 4 years ago • 9 comments

FB Login authentication is deprecated and close by FB on Android embedded browsers.

Updated on August 27, 2021: We will continue to support FB Login authentication on Android embedded browsers until October 5, 2021. Based on developer feedback, we are providing additional time for developers to plan for the deprecation of FB Login authentication on Android embedded browsers. Also note that the Passwordless flow referenced below is no longer an available option for developers. Please review the detailed documentation here.

https://developers.facebook.com/blog/post/2021/06/28/deprecating-support-fb-login-authentication-android-embedded-browsers/

I'm using [email protected] in native 6.x but I think the same problem will be on latest 3.0.7 in native 7.x

Przemase avatar Oct 14 '21 15:10 Przemase

My team and I are also affected by this issue while using this plugin...

ScottAtRedHawk avatar Oct 18 '21 15:10 ScottAtRedHawk

My team is also facing the same issue. We use nativescript 6.x . Any updates on this?

gerardim90 avatar Nov 14 '21 17:11 gerardim90

@gerardim90 My team switched to https://github.com/NativeScript/plugins/tree/main/packages/facebook. We used conditional imports (or require(...) would work too) in code to target Android only for now.

ScottAtRedHawk avatar Nov 15 '21 15:11 ScottAtRedHawk

@ScottAtRedHawk , I tried installing that plugin and doing LoginManager.init(); in main.ts and using it on my login component. But I started getting JS: Facebook login error: Error: The SDK has not been initialized, make sure to call FacebookSdk.sdkInitialize() first. Did you do anything extra other than what the usage section mentions here https://github.com/NativeScript/plugins/tree/main/packages/facebook . Thank you so much for your help

gerardim90 avatar Nov 15 '21 19:11 gerardim90

@gerardim90 Did you call the code below somewhere in your app.js or app.ts? And follow the directions for setting up the native stuff on Android and iOS?

import { LoginManager } from '@nativescript/facebook';

LoginManager.init();

ScottAtRedHawk avatar Nov 15 '21 19:11 ScottAtRedHawk

Yes, I put that code in my main.ts and I already had the native stuff setup when I first set it up for using this plugin and it was working fine until the android webview deprecation broke it

gerardim90 avatar Nov 15 '21 19:11 gerardim90

@gerardim90 We're actually still using nativescript-oauth2 for iOS and @nativescript/facebook for Android if that helps?

ScottAtRedHawk avatar Nov 15 '21 20:11 ScottAtRedHawk

Yep, same here... I am actually using nativescript-oauth2 for Android for doing google sign in as well, which actually works fine.

gerardim90 avatar Nov 15 '21 20:11 gerardim90

@gerardim90

I tried installing that plugin and doing LoginManager.init(); in main.ts and using it on my login component. But I started getting JS: Facebook login error: Error: The SDK has not been initialized, make sure to call FacebookSdk.sdkInitialize() first. Did you do anything extra other than what the usage section mentions here https://github.com/NativeScript/plugins/tree/main/packages/facebook . Thank you so much for your help

I had the same problem and found out that I put the meta data inside <application> <activity> instead of putting it just inside <application> (so before the <activity> tag).

<application>
    <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>
    <meta-data android:name="com.facebook.sdk.ClientToken" android:value="@string/facebook_client_token"/>
    <activity> </activity>
</application>

It fixed it for me

agardes avatar Feb 15 '22 08:02 agardes