Skip to content
This repository has been archived by the owner on Oct 24, 2022. It is now read-only.

App ID not found. Add a string value with your app ID for the key FacebookAppID to the Info.plist or call [FBSDKSettings setAppID:] #817

Closed
andyts93 opened this issue Oct 15, 2019 · 8 comments

Comments

@andyts93
Copy link

I get this error in an Ionic application when I call the login function. I've tried to remove and re-create the iOS platform but it doesn't solve the problem.

Cordova 9.0.0
Cordova-iOS 5.0.1
Plugin version 6.2.0

Here's my package.json cordova array

"cordova": {
    "plugins": {
      "cordova-plugin-camera": {},
      "cordova-plugin-whitelist": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-sqlite-storage": {},
      "cordova-plugin-x-socialsharing": {
        "ANDROID_SUPPORT_V4_VERSION": "24.1.1+"
      },
      "cordova-plugin-file": {},
      "cordova-plugin-ionic-webview": {
        "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
      },
      "cordova-plugin-qrscanner": {},
      "cordova-plugin-ionic-keyboard": {},
      "cordova-plugin-file-opener2": {
        "ANDROID_SUPPORT_V4_VERSION": "27.+"
      },
      "cordova-plugin-file-transfer": {},
      "cordova-plugin-inappbrowser": {},
      "com-sarriaroman-photoviewer": {},
      "cordova-plugin-badge": {},
      "cordova-plugin-firebasex": {
        "FIREBASE_ANALYTICS_COLLECTION_ENABLED": "true",
        "FIREBASE_PERFORMANCE_COLLECTION_ENABLED": "true",
        "FIREBASE_CRASHLYTICS_COLLECTION_ENABLED": "true"
      },
      "cordova-plugin-facebook4": {
        "APP_ID": "XXXXXXXXX",
        "APP_NAME": "XXXXXXX",
        "FACEBOOK_HYBRID_APP_EVENTS": "false",
        "FACEBOOK_ANDROID_SDK_VERSION": "5.5.2"
      }
    },
@uklawitter
Copy link

Same here...

@peterpeterparker
Copy link
Collaborator

peterpeterparker commented Oct 26, 2019

Could u provide a repo to reproduce the problem?

Also double check that you opened the .xcworkspace file as described in the doc https://github.com/jeduan/cordova-plugin-facebook4/tree/master/docs/ios

@andyts93
Copy link
Author

@peterpeterparker Yes I'm using the .xcworkspace file. I've found out that it was a problem of incompatibility with the plugin cordova-plugin-firebasex, I've replaced it with cordova-plugin-fcm-with-dependecy-updated to solve it

@peterpeterparker
Copy link
Collaborator

Cool happy to hear you resolved your issue 👍

@iconio
Copy link

iconio commented Jan 11, 2020

Any chance to re-open this issue? I'm having the same problem and can't find any solutions. In my case I'm not using firebasex.

Thanks

@ehdez82
Copy link

ehdez82 commented Feb 7, 2020

Same error, without using cordova-plugin-firebasex.

@ryaa
Copy link

ryaa commented May 8, 2020

The problem seems to be caused by the fact that some params (FacebookAppID etc.) are not added to the appropriate plist file and not available when the app is running. For example, these must be present in <YOUR_APP_DIRECTORY>/platforms/ios/<APP_NAME>/<APP_NAME>-Info.plist

The problem is that some cordova plugins (for example, cordova-plugin-facebook4, cordova-plugin-googleplus etc.) use config-file tag in plugin.xml to update your *-Info.plist file and due to the bug in cordova (see apache/cordova-common#88) those changes are applied to the wrong plist file and not working.

The dirty and quick fix is to change the below line at 179 in <YOUR_APP_DIRECTORY>/node_modules/cordova-common/src/ConfigChanges/ConfigFile.js file from

var plistName = getIOSProjectname(project_dir) + '-Info.plist';

to

var plistName = '/' + getIOSProjectname(project_dir) + '-Info.plist';

For more details about the fix please see apache/cordova-common#88 (comment)

IMPORTANT: it must be done before restoring/adding platforms and plugins or remove and restore platforms/plugins after this change is made.

@sahyun1
Copy link

sahyun1 commented Oct 4, 2020

The file @ryaa refers to seems to changed a bit, there's no matching line nor variable names.

What I did was in xCode, open info tab and add
FacebookAppID : id
FacebookDisplayName : app package name

also on the bottom, add url type with fb*****(your id)
image

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

No branches or pull requests

7 participants