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

[mobile] webview: Enable debugging on browser. #2586

Merged

Conversation

ishammahajan
Copy link
Contributor

Enables debugging for the android plugin which
react-native-webview uses. This method is mentioned in their guide
for the same.
https://github.com/react-native-community/react-native-webview/blob/master/docs/Debugging.md

Unfortunately the call requires API version >= 19 (After Kitkat),
which is fine because our testing may occur at a higher API level.

@ishammahajan
Copy link
Contributor Author

I used this in order to debug an issue. I think it'll be helpful if everyone can benefit from it!
image

Also, @PackElend label me -- if this qualifies as a valid PR! :)

@laurent22
Copy link
Owner

This is useful but we can't enable this in production. Best would be to leave it commented out by default, and people can uncomment it if they need. Also in the comments, please add a link to the rn-webview doc.

@ishammahajan
Copy link
Contributor Author

We can also add a BuildConfig.DEBUG flag to the if condition, which is what I have done with the new push.

Enables debugging for the android plugin which
`react-native-webview` uses. This method is mentioned in their guide
for the same.
https://github.com/react-native-community/react-native-webview/blob/master/docs/Debugging.md

Unfortunately the call requires API version >= 19 (After Kitkat),
which is fine because this will be disabled in production builds
anyways.
@laurent22
Copy link
Owner

Sorry but now you've converted the whole file to a different indentation (and to space, while we use tabs). Please only change what you need to change and don't modify the rest of the file.

@ishammahajan
Copy link
Contributor Author

Ah. Sorry. I've changed this based on Android Studio's auto formatter. I think this is a good way to go, because then we can enforce a consistent style on the file. The file currently doesn't have any consistent style, where some parts use tabs and some use spaces.

If this isn't acceptable, I think it's okay to merge only the first commit :) (I'm not near a computer at the moment, can't push an updated version)

@PackElend
Copy link
Collaborator

I've changed this based on Android Studio's auto formatter. I think this is a good way to go, because then we can enforce a consistent style on the file. The file currently doesn't have any consistent style, where some parts use tabs and some use spaces.

that is good point but should be discussed in the forum

@ishammahajan
Copy link
Contributor Author

ishammahajan commented Feb 27, 2020 via email

@ishammahajan
Copy link
Contributor Author

Ping. Kind reminder :)

@laurent22
Copy link
Owner

Looks good, thanks for the update @ishammahajan!

@laurent22 laurent22 merged commit 95eb302 into laurent22:master Mar 6, 2020
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.

3 participants