Facebook Sdk Has Not Been Initialized FacebookSdk.sdkInitialize()

前端 未结 8 1326
隐瞒了意图╮
隐瞒了意图╮ 2020-12-04 23:55

Hey I know this was asked before, but none of the solutions seem to help. I\'m using first time Facebook SDK in my application.

What I\'ve tried:

I had tried

8条回答
  •  萌比男神i
    2020-12-05 00:31

    Problem

    While integrating Android SDK for a react-native project, I had finished the Android with React Native v0.30+ Project Configuration guide, and ran react-native run-android and then got this screen:

    I learned that FacebookSdk.sdkInitialize is deprecated. see here

    After some searching, I realized that the guide did not contain the steps to add the Facebook App ID for my app.

    Solution

    1. Open android/app/src/main/AndroidManifest.xml file and look in the tag to confirm that this meta-data tag exists:

      
      
    2. Open android/app/src/main/res/values/strings.xml file and confirm that this there is a "facebook_app_id" string tag with your app id as the value:

      YOUR_APP_ID_HERE
      
    3. Run react-native run-android.

    These are the steps that worked for me.

提交回复
热议问题