Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(social_share): android facebook sdk initialize method is deprecated and causing invalid facebook app id #192

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

brams-9
Copy link

@brams-9 brams-9 commented Nov 29, 2023

Background

currently in packages/appinio_social_share/android/src/main/java/com/appinio/socialshare/appinio_social_share/utils/SocialShareUtil.java method shareToFacebook contain logic to trigger FacebookSdk.initialize() that automatically setup the facebook app id, but currently i encountered issue in android 11+ everytime shareToFacebook is triggered, it always return error valid facebook app id must be supplied and i already make sure i already setup my androidManifest.xml correctly.

as mentioned in this issues link #133

Root Cause

i've been tinkering for a while and found the root cause is in FacebookSdk.initialize() method, that method is already deprecated and failed to automatically set the facebook app id for android 11+

Solution

we need to set the facebook app id manually in order to fix this, so i omit FacebookSdk.initialize() and add FacebookSdk.setApplicationId(); to imperatively set facebook app id.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant