Skip to content

Add support for react native webview events#20

Open
andregoncalvesdev wants to merge 1 commit into
masterfrom
feature/add-support-for-react-native-webview-events
Open

Add support for react native webview events#20
andregoncalvesdev wants to merge 1 commit into
masterfrom
feature/add-support-for-react-native-webview-events

Conversation

@andregoncalvesdev
Copy link
Copy Markdown
Contributor

@andregoncalvesdev andregoncalvesdev commented Dec 29, 2024

Add support for react native webview events.

https://uphold.atlassian.net/browse/SWY-2585

Comment thread src/topper-web-sdk.ts
source: TOPPER_WEB_SDK_EVENT_SOURCE
};

targets.forEach(target => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

np

Suggested change
targets.forEach(target => {
targets.forEach(({ type, value }) => {

or even for this for (arguably) slighter more explicit

Suggested change
targets.forEach(target => {
targets.forEach(({ type, value }) => {
const payload = type === Targets.REACT_NATIVE_WEBVIEW
? JSON.stringify(message)
: message;
const targetOrigin = type === Targets.REACT_NATIVE_WEBVIEW
? undefined
: '*';
value.postMessage(payload, targetOrigin);
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants