-
Notifications
You must be signed in to change notification settings - Fork 166
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
App Events with null-value params silently do not get sent to Facebook #36
Comments
Is there any Javascript API to reference off of for apis and type references ? Just curious |
@mikehardy I'm sorry, I'm afraid I don't understand your question. Can you elaborate on your question? |
Sorry I wasn't clear - we are a "downstream" sdk wrapping native libraries with a javascript interface. But there may be an "upstream" (official, direct from Facebook) JS SDK. I don't know if there is or not, but you might or could check. Assuming there is one, it probably has a similar API, and if it does - for general portability of code between native SDK wrappers (us) and pure-JS code (always an option, maybe needed for react-native-web) if there is an upstream API or way they handle this, we should try to harmonize? So stated more clearly:
https://developers.facebook.com/docs/reference/javascript/FB.AppEvents.LogEvent - it is deprecated unfortunately but there is also https://developers.facebook.com/docs/facebook-pixel/reference
The deprecated version has the same API, and it enforces this, not sure how it enforces it though? Does it throw? More concretely for the Java SDK: https://developers.facebook.com/docs/unity/reference/current/FB.LogAppEvent#logpurchase
So we should definitely check input params and reject (or if we are swallowing error we should instead propagate them, are we? Can verify maybe via adb logcat or code inspection) For future thinking: how does the new "Pixel" SDK behave when you feed it's methods bad data? quietly log? cleaning? a throw? So a few questions just to help this library stay in harmony with the way the rest of the FB SDK ecosystem works with regard to invalid input In the end it will probably boil down to code inspection here to make sure we are not swallowing native exceptions but are bubbling them up when/if they happen, and maybe JS code that validates input |
Everyone should re-try with v6 of this library to see if it affects things, it has the up to date native libraries. |
Sure, that makes sense. Thanks @mikehardy |
馃悰 Bug Report
In idiomatic JavaScript, it is common to generate objects like:
However, passing this object to
logPurchase
as the third parameter,params
whenexampleParam
is null results in the event silently not propagating to Facebook Events.To Reproduce
Issue the following event:
AppEventsLogger.logPurchase(15, "USD", { exampleParam: "hello", exampleParam2: null });
This event will never show up under the "Test Your Events in Real Time" pane at https://www.facebook.com/events_manager2/
Expected Behavior
One of the following, in order of ideal behavior:
react-native-fbsdk-next
cleans out null object properties and sends the event to Facebooklogcat
Code Example
Issue the event under "To Reproduce" while looking at the "Test Your Events in Real Time" pane at https://www.facebook.com/events_manager2/
Environment
The specific react native environment should not affect this issue.
The text was updated successfully, but these errors were encountered: