cordova-plugin-facebook-connect / cordova-plugin-facebook-connect

Use the latest Facebook SDK in your Cordova and Ionic projects
Other
63 stars 90 forks source link

Android runtime error: cannot call Facebook native apps unless the package visibility needs are declared #139

Open SailingSteve opened 6 months ago

SailingSteve commented 6 months ago

Updated note Nov 16, 2023: This is a warning only, and at this point does not stop the plugin from working:

This plugin worked correctly for me a year ago with the libraries and Android Studio that were current at the time, it still works on iOS, but on Android in logcat I get: 2023-11-13 11:36:15.369 6386-6386 com.facebo...veProtocol org.wevote.cordova W Apps that target Android API 30+ (Android 11+) cannot call Facebook native apps unless the package visibility needs are declared. Please follow https://developers.facebook.com/docs/android/troubleshooting/#faq_267321845055988 to make the declaration.

And an Error screen at m.facebook.com:

Screenshot_20231113_124218

My config.xml includes: <config-file parent="/manifest" target="AndroidManifest.xml"> <queries> <provider android:authorities="com.facebook.katana.provider.PlatformProvider" /> <provider android:authorities="com.facebook.orca.provider.PlatformProvider" /> <package android:name="com.facebook.katana" /> <intent> <action android:name="android.intent.action.SENDTO" /> <data android:scheme="mailto" /> </intent> </queries> </config-file>

My platforms/android/app/src/main/AndroidManifest.xml includes: <queries> <provider android:authorities="com.facebook.katana.provider.PlatformProvider" /> <provider android:authorities="com.facebook.orca.provider.PlatformProvider" /> <package android:name="com.facebook.katana" /> <intent> <action android:name="android.intent.action.SENDTO" /> <data android:scheme="mailto" /> </intent> </queries>

When I run % ~/Library/Android/sdk/platform-tools/adb shell dumpsys package queries | grep facebook there is no return, which I think means that the queries I need to add have not succeeded.

This problem shows cordova-plugin-facebook-connect install as described in the README.md

I tried upgrading to the latest FB SDK by adding "cordova-plugin-facebook-connect": { "FACEBOOK_ANDROID_SDK_VERSION": "16.0.0", and had the same results.

Has anyone run into or solved this problem?

SailingSteve commented 6 months ago

I found out today that this is a very minor problem -- the warning does not stop the plugin from working correctly. My problem was that Facebook was newly requiring a "Business Verification" (for a 4+ year old app) and once that verification was made and approved by FB, our use of this plugin was successful again.