NativeScript / nativescript-facebook

NativeScript plugin, wrapper of native Facebook SDK for Android and iOS
Apache License 2.0
79 stars 52 forks source link

Given URL is not allowed Android #220

Closed darrenkhouston closed 4 years ago

darrenkhouston commented 4 years ago

Which platform(s) does your issue occur on?

Please, provide the following version numbers that your issue occurs with:

When I am logging into Facebook on iOS, the application takes me straight to Facebook, lets me login then sends me back to the app, no issues. On Android, when I click my button to login to Facebook, the form pulls up, I can enter my email and password, then on the next screen I get an error of "Given URL is not allowed by the Application Configuration: One or more of the given URLs is not allowed by the App's settings. To use this URL you must add a valid native platform to your App's settings."

My app is still in development mode with Facebook, and I have a place for a return URL, but since this is native to the Android system, I have no clue what the URL should be.

Error Screenshot from Android

Screen Shot 2019-11-11 at 3 29 48 PM

Works fine on iOS

Screen Shot 2019-11-11 at 3 29 48 PM
darrenkhouston commented 4 years ago

I fixed this issue. You are required to add the Android Platform to your Facebook App in order to get it to work. I just used my apps org.nativescript.whatever URL to get it to bypass the error. Would be good to know this in the documentation for testing purposes. My app is not live, so this would make sense to know while you are setting up the application.

This is where you add the Android Platform to your Facebook App

laylashams5 commented 1 year ago

I added this is AndroidMainfest.xml

    <activity android:name="com.facebook.CustomTabActivity" android:exported="true">
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="@string/fb_login_protocol_scheme" />
        </intent-filter>
    </activity> and then it's work!
moltedopablo commented 1 month ago

Hi, in my case I followed the instructions in "Use cases -> customize -> Quick Start" of Facebook dashboard, the problem was the key hash located in debug.keystore

After completing some steps in the wizard above and running the following, it worked:

keytool -exportcert -alias androiddebugkey -keystore android/app/debug.keystore | openssl sha1 -binary | openssl base64