Skip to content
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

Fix React Native events that override the apiKey #1592

Merged
merged 1 commit into from
Jan 31, 2022

Conversation

lemnik
Copy link
Contributor

@lemnik lemnik commented Jan 31, 2022

Goal

Allow React Native applications to override the Event.apiKey in their callbacks.

Changeset

If the apiKey field is present and not empty, override it in the Event before delivery to the Android layer

Testing

Additional unit tests added, and manually tested with the example React Native app.

@lemnik lemnik force-pushed the PLAT-7916/deserialize-reactnative-apikey branch from 3a953cb to 6cf9afd Compare January 31, 2022 11:40
@lemnik lemnik force-pushed the PLAT-7916/deserialize-reactnative-apikey branch from 6cf9afd to d819810 Compare January 31, 2022 11:46
)

val event = EventDeserializer(client, emptyList()).deserialize(map)
assertEquals("abc123", event.apiKey)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems worth adding an assertion when there is no API key in the map (presumably it's null in that case?)

@lemnik lemnik force-pushed the PLAT-7916/deserialize-reactnative-apikey branch from d819810 to d88a237 Compare January 31, 2022 12:11
@lemnik lemnik merged commit 11a7dae into next Jan 31, 2022
@lemnik lemnik deleted the PLAT-7916/deserialize-reactnative-apikey branch January 31, 2022 13:24
@lemnik lemnik mentioned this pull request Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants