-
Notifications
You must be signed in to change notification settings - Fork 195
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
Disabling the Facebook App Events SDK for a specific build #930
Comments
Looks like this validation is happening in the FBSDK itself so it's not something we can control from our plugin. If it's the first one it might be an option in the native FB SDK to control this behavior: https://developers.facebook.com/docs/app-events/overview If it's fine with just disabling Segment from sending events to FB this one is easier, you can keep the plugin there and add a plugin that filters FB if your app is in debug mode: class FilterFBPlugin extends Plugin {
type = Plugin.before
execute(event: SegmentEvent) {
if (!Config.FACEBOOK_APP_ID || !Config.FACEBOOK_CLIENT_TOKEN) {
event.integrations['Facebook App Events'] = false;
}
return event;
}
} (If FB is automatically sending logs from your app outside of Segment this won't prevent those) |
@oscb Hey thanks for the response :) I have tried adding the meta properties from the FB documentation that I thought could be related to this to disable the auto-initialization, thinking that would fix the issue. But that didn't help unfortunately. Otherwise, with the second approach, we will need to provide some APP_IDs and CLIENT_TOKENs even for our builds where we don't necessarily want logging and I was concerned about possible side-effects of that (maybe we provide just some mock ones? but again, I assume that may have other side-effects like errors trying to connect to the Facebook SDK). I feel like at this point I've tried everything that I could think of to disable the initialisation from happening so I may just go with filtering out the events. Thank you for the suggestion! |
Didn't quite end-up disabling the SDK at all, but I was able to resolve my issue by passing some mock APP_IDs etc. and filtering out the events as suggested here so closing the issue to not crowd-up the issues |
Summary
We have set-up the facebook app events plugin as per the docs. For now we want to only enable it in our staging app and not in the actual production app, and not in the app instances we build for End-to-end testing. However, simply not adding the facebook app events plugin doesn't seem to work (at least for Android).
From what I understand, the FB SDK is automatically initialized for Android. I have tried adding the meta-data that is supposed to turn that off to
AndroidManifest
but that didn't help either.There is a closed issue about this here though the specific examples there are related to Expo which doesn't apply to us and honestly the issue was closed without a real conclusion :D
Is there a way to do this?
The text was updated successfully, but these errors were encountered: