-
Notifications
You must be signed in to change notification settings - Fork 172
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
Error with FacebookSdk Initialize [SOLUTION: read v8 release notes: need client access token configured now] #236
Comments
Same here |
Our example app is literally built by a script, fully automated Check it out: https://github.com/thebergamo/react-native-fbsdk-next/blob/master/refresh-example.sh Run that, compare output to your project, you're missing a step somewhere, somehow. It's not a module problem though, and support questions are best on stackoverflow or similar until you can demonstrate a bug with steps to reproduce |
Same here |
Same answer 🤷 - put some effort in please |
I'm not trying to be flippant either: I literally provide a fully automated scripted build to create an example, and last I checked (before last release), it worked. I really don't know what more I can do |
Before my project was working properly. But I saw this issue yesterday. I can't run the project right now. |
Providing exactly as much information as you have provided, I run my project just fine. Who is right? Neither of us without a reproduction. Behold: https://github.com/thebergamo/react-native-fbsdk-next/blob/master/refresh-example.sh a reproduction How's it go when you run it? |
I just followed the README in the example, it works clone the repo No reproduction, no more comments from me. You will have to dig in on your projects and determine what happened, sorry If anyone learns anything useful please make a PR to the docs, or if there really is a bug a PR to the module and/or the example to actually demonstrate it would be great. Statements of "it doesn't work" lack substance and do not help unfortunately. Neither does visual evidence (screenshots) of same, as I can just post a screenshot of it working and it's equally pointless I repeat for context:Our example app is literally built by a script, fully automated Check it out: https://github.com/thebergamo/react-native-fbsdk-next/blob/master/refresh-example.sh Run that, compare output to your project, you're missing a step somewhere, somehow. It's not a module problem though, and support questions are best on stackoverflow or similar until you can demonstrate a bug with steps to reproduce |
Thanks for your reply. I ran my project on iOS and it works. But when I ran my project on Android, it doesn't work. Before reviewing the application and Facebook documentation, we found the solution. The client token had to be added to string.xml:
Next add the meta-data in the application element, in the AndroidManifest.xml:
After that, the application works again. |
same for me all of a sudden I'm getting this error. above solution from @arkkosoftMiKolbi fixed my issue. thanks |
Glad you found the solution! Please pay very very careful attention to release notes on breaking change release notes, if you see a breaking change expect your app to break unless you update it somehow https://github.com/thebergamo/react-native-fbsdk-next/releases
Also from our example script: react-native-fbsdk-next/refresh-example.sh Lines 88 to 89 in caf9c0a
|
One other thing I'll mention: if this happened without you knowing, you should examine your dependency management. Are you depending on this module with a We do our best not to issue breaking changes without release notes indicating the exact changes required, but you have to use semantic versioning appropriately for that to work for you |
Hey guys, I had to create a token on the Meta for Developers website. It is now working for me ! Thanks 🙏🏻
|
@mikehardy thanks for detailed information. We are still using the version
For more information, https://github.com/facebook/facebook-android-sdk/blob/main/CHANGELOG.md#1320 |
That + in the dependencies there is what let the breaking change in the underlying SDK slip through i think 🤔 [EDIT: turns out we have a |
This worked for me. Thanks. |
See: https://github.com/facebook/facebook-android-sdk/blob/main/CHANGELOG.md#1320
|
fixed my issue. thanks |
Hey guys, I tried to integrate FB SDK with my app. Everything runs perfectly on emulator but when I push it on TestFlight my app crashed. Is anyone facing this issue like me? |
Nope, if you ran the app on a device plugged in to your development machine and opened the log in Console.app you could post useful information to troubleshoot. |
Okay, it turns out the FBAudienceNetwork 6.10 is having a bug which made my app keep crashing. Downgraded to 6.9 and hope FB's team will release a new version to fix this bug soon. Thanks for your help tho |
@dtthanh1 oh my! That's new information, had not heard of this yet. Do you have any links to upstream issues that people could subscribe to, or related release notes? Have you logged the issue upstream yourself or collaborated with upstream repo to characterize + fix the issue? Otherwise no one else may be aware of it |
After hours of debugging and researching on Google and I came up to this. |
Fantastic work pushing that through to acknowledgement / "scheduled for fix in next release". Sounds like 6.11 of FBAudienceNetwork will fix it, while 6.10 is busted. What is strange is that when I scan for that pod here in our example - https://github.com/thebergamo/react-native-fbsdk-next/blob/master/RNFBSDKExample/ios/Podfile.lock - I don't see it. Is this part of a regular facebook sdk integration or something extra? Stated differently, with the goal in mind: will this affect many of the users here or only users doing XYZ (unspecified) ? Seems like it's "only users doing XYZ" and the XYZ is ... ads? This is mostly out of curiosity but might help others' set expections. Either way, thanks a bunch for sharing the link |
This error persists for me. I confirmed that the |
It's possible they will start denying API requests without them or with the old SDK, so careful with that - you might be able to just configure it directly in the AndroidManifest if you want? I think that would work? I don't think they validate it on startup but I'm sure they'll validate it when you use the API, so if you put a random string in there your app will at least boot but it won't work for API calls to facebook. I actually prefer an SDK that fails fast. Can you imagine if they made it a requirement but then you didn't find out until you tried a non-login API or something and just got an error? Much better as you update the SDK to just have it work or not on your first test IMHO |
Good point but maybe done at compile time is better? Anyways, are they doing any validation of the token or appid right now? Could that be causing this? |
Welp I figured it out. One more build clean and it actually worked to put dummy values into AndroidManifest. What was happening was I had dynamic gradle values: |
manifestPlaceholders have always worked for me in the past, and I have not tried dynamic values as you indicate @shamilovtim - you may have found the critical reproduction, since I was not able to reproduce this. Everyone else having this problem, does an AndroidManifest with variables seem like it's your case? As for verification at compile time, not sure how you verify a configuration string at compile time when the config files can be so widely varied. And a crash right at startup is really just about the same, the delay is only marginally longer but the signal is just as absolute. Perhaps the error would be better ? As for them verifying the ID, how did it go when you sent in a fake ID? I'm guessing the API calls failed. I've never tried to subvert their app auth token system by feeding it unexpected data so I can't say. |
@mehraj43 - this is a poor question --> https://stackoverflow.com/help/how-to-ask -- also, what you displayed in a very difficult to read image (vs formatted text) is simply a warning. Not an error. You have not actually shown the error. This module currently has no compilation errors that I know of, your problem is elsewhere |
Thanks but i was able to resolve the error sorry for not posting question in a proper format after reinstalling fbsdk issue got resolved |
Any fix for expo users? |
@kesylo of course. You have to read documentation though: https://github.com/thebergamo/react-native-fbsdk-next#expo-installation (note the access token is one of the mandatory config elements for the config plugin....) |
@mikehardy thanks for your quick response. So I have already installed the package and the plugin. It worked fine before on both android and IOS. but now when I do a new build on android (without changing anything) it does not work. But IOS still work. the error is: SDK has not been initialized facebookSDK.sdkInitialize() |
You have a project-specific problem and I won't be able to help, sorry. It's important to know that this is used by lots of Expo people though, so it's possible to work if you keep digging. |
@mikehardy I really do need help. I have everything configured as in the docs. I use the latest version of the package "react-native-fbsdk-next": "^11.0.1". |
For those EXPO guys out there who needs this. I fixed my issues by creating config plugins to add the values mentioned https://github.com/thebergamo/react-native-fbsdk-next/issues/236#issuecomment-1111744717 to strings.xml and adndroiManifest.xml (with-android-add-metadata-in-application.js)
(with-android-strings-xml.js)
then in your app.js or app.config.js use the plugin like this:
@mikehardy this is a real issue. please if possible, apply the fix directly in the library plugin. |
@kesylo I won't be doing that, Expo support is provided by the community and the Expo plugin will be updated via PRs provided by the community. That said, I think this is unnecessary. I believe Expo already has built in config plugin features that allow you to add things to strings.xml and AndroidManifest.xml without any additional logic in this module's config plugin. I will repeat that there are lots of Expo folks using this module already, successfully, so I think you need to look in your project and your project's use of Expo. I think you'll find that there are ways to do what you need already, and if anything the item of work here would be a documentation update (for which a PR would be happily accepted) |
ok @mikehardy . please can you link me to expo plugins that add values to those files? I could find them that's why I created those. thanks |
Turns out they are all just in the existing plugin here already. No idea what's going on with your project. https://github.com/thebergamo/react-native-fbsdk-next/blob/master/plugin/src/withFacebookAndroid.ts It's the weekend here and I don't use Expo. My support here is done, I won't respond further, I'm unsubscribing from this issue. |
🐛 Bug Report
I keep having the error : The SDK has not been initialized, make sure to call FacebookSdk.sdkInitialize() first.
To Reproduce
Install the package
Fill the AndroidManifest and strings.xml files with facebook-app-id as in the docs.
Run
npx react-native run-android
or launch the app through Android Studio on the emulator.I also tried with a brand new app and another computer. I still have the same issue.
Expected Behavior
The SDK should be auto-initialized at the launch of the app.
Code Example
Environment
The text was updated successfully, but these errors were encountered: