Closed totebo closed 4 years ago
Here's a PR that handles if value_to_sum is nil: https://github.com/defold/extension-fbinstant/pull/78
Please give it a try and let me know if it works as expected!
Both valueToSum
and parameters
can be omitted in the Facebook API. It looks like 0 is sent if valueToSum is nil now? Would be good to just be able to go:
fbinstant.log_event( "Kick" )
And the only thing sent is the "Kick" event id?
Back on this, and can confirm it still fails silently if "value_to_sum" or "parameters" are omitted:
fbinstant.log_event("event_name", 0, '{"parameter":0}') -- Works
fbinstant.log_event("event_name", 0, nil) -- Fails silently
fbinstant.log_event("event_name", nil, '{"parameter":0}') -- Fails silently
fbinstant.log_event("event_name", nil, nil) -- Fails silently
Expected behaviour: If one or both of the optional values are nil the call should not fail.
I've added a check if value_to_sum is a number or not. Anything other than a number will be treated as 0. Would you mind testing this branch:
https://github.com/defold/extension-fbinstant/archive/dev-valuetosum_nil.zip
All of the examples above now work. Great job, thanks!
If "value_to_sum" or "parameters" are omitted the operation fails.
These parameters are optional in the JavaScript version of the API: https://developers.facebook.com/docs/games/instant-games/sdk/fbinstant6.0