You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Turbo iOS and Turbo Android supports communication between native app and JavaScript (the visited page). This is very useful for eg. programatically doing something natively, triggered from the website or for programatically doing something on the website, triggered natively.
Examples of this could be prompting for Push Permissions and upon acceptance returning the push token back to the visited website, or reloading the web page when a native push notification is received.
It would be very useful to be able to register a handler for messages being passed from the website to native, eg:
// In React Native<VisitableViewonMessage={alert}/>// In website:website.messageHandlers["someName"].postMessage("Hi from website!")
And vice-versa being able to send messages back to the web page:
// In React NativevisitableViewRef.injectJavaScript("alert('Hello from native!');")
Simply having these low-level methods of passing data back and forth and could be extended with eg. JSON serialization, async callbacks etc. with a bit of JS code on React Native side and website.
Turbo iOS and Turbo Android supports communication between native app and JavaScript (the visited page). This is very useful for eg. programatically doing something natively, triggered from the website or for programatically doing something on the website, triggered natively.
Examples of this could be prompting for Push Permissions and upon acceptance returning the push token back to the visited website, or reloading the web page when a native push notification is received.
It would be very useful to be able to register a handler for messages being passed from the website to native, eg:
And vice-versa being able to send messages back to the web page:
Simply having these low-level methods of passing data back and forth and could be extended with eg. JSON serialization, async callbacks etc. with a bit of JS code on React Native side and website.
Prior art:
react-native-webview
: https://github.com/react-native-webview/react-native-webview/blob/master/docs/Guide.md#communicating-between-js-and-nativeturbo-ios
: https://github.com/hotwired/turbo-ios/blob/main/Docs/Advanced.md#native---javascript-integrationturbo-android
: https://github.com/hotwired/turbo-android/blob/main/docs/ADVANCED-OPTIONS.md#native---javascript-integrationThe text was updated successfully, but these errors were encountered: