Using expo with WebView Bridge(npm) in react native (QUESTION)

#1

Hi , I have been using expo for a while and I need to add a button on a webview , so found out we can use react native webview bridge (https://www.npmjs.com/package/react-native-webview-bridge) package for react native BUT can we use this with expo (when I tried to configure I could not find any JAVA files , in the project expo XDE created)
Thank you

#2

Hey there, we don’t have react-native-webview-bridge in our core API. If you need to add a package with custom native code (java or objective-c) then you would need to detach to ExpoKit. Just from looking at this, I’m not totally confident it will do what you want without quite a bit of extra work. Why can’t you use the onMessage API built into React Native’s web view?

1 Like
#3

@ben Thanks for the suggestion, May I have a link or some example code snippet of using onMessage API, if possible please… ?

#4

Hi @naveendk - here is some documentation and a test case from React Native:

Here is where it is called within React Native (Android and iOS):

#5

Hi @ide Thanks for the links !