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

Webview 'injectJavascript' method not responding on iOS. #3628

Closed
mackbrowne opened this issue Mar 1, 2019 · 3 comments
Closed

Webview 'injectJavascript' method not responding on iOS. #3628

mackbrowne opened this issue Mar 1, 2019 · 3 comments

Comments

@mackbrowne
Copy link

Environment

Expo CLI 2.6.14 environment info:
System:
OS: macOS 10.14.3
Shell: 5.3 - /bin/zsh
Binaries:
Node: 10.15.0 - /usr/local/bin/node
Yarn: 1.12.3 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
IDEs:
Android Studio: 3.2 AI-181.5540.7.32.5056338
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.1 => 16.8.1
npmGlobalPackages:
expo-cli: 2.6.14

Building for both Android and iOS. But the problem only occurs on iOS.

Steps to Reproduce

https://snack.expo.io/@mackbrowne.prodigy/webview-injectjavascript

  1. Run this snack either in the browser on on an iOS device. If running inside snack, make sure you pick iOS.
  2. Tap the "broken" and "works" button see nothing happens.
  3. Now reload snack / device in android instead and see the buttons working.

Expected Behavior

I was hoping I could get access to globally exposed methods on the webview in both iOS and Android.

Actual Behavior

From my investigation it seems all javascript commands are being ignored on iOS which the snack I linked also shows this behavior. You can change the js to anything and it just doesn't respond. Android works exactly as expected.

Perhaps I'm doing something wrong, but the fact that it works on Android makes me think it's a bug in the Webview component itself.

Reproducible Demo

https://snack.expo.io/@mackbrowne.prodigy/webview-injectjavascript

instructions above.

@AdamJNavarro
Copy link
Contributor

Hey @mackbrowne,

Are you able to reproduce this in a vanilla React-Native project running the same RN version corresponding to the SDK version's fork? If so, it would indicate that it's actually an RN issue rather than an Expo one and should be filed here. If it's only occurring in an Expo project, we'll be happy to investigate.

Cheers,
Adam

@mackbrowne
Copy link
Author

@AdamJNavarro Thanks for the reply. I'll re-post in React native

@nickjuntilla
Copy link

@AdamJNavarro This is still an issue for me expo 32.0.0

@lock lock bot added the outdated label Nov 27, 2019
@lock lock bot locked and limited conversation to collaborators Nov 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants