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

Don't ask for overlay permissions, fix displaying errors on splashscreen. RN >= 0.52 #2801

Closed

Conversation

krystofcelba
Copy link
Contributor

@krystofcelba krystofcelba commented Mar 1, 2018

  1. Don't ask for overlay permissions on RN >= 0.52 as it is not needed according to this commit.
  2. Fix that redbox with error don't get displayed if there isn't yet any react activity, instead use the SplashActivity.

In RN >= 0.52 the current activity is used to
display redbox and other dev things instead of
SYSTEM_ALERT_WINDOW so it's not needed to ask permission there.
Return SplashActivity If there is not yet any react activity
so the redbox gets displayed if error occurs.
@yershalom
Copy link
Contributor

Can one of the admins verify this patch?

@sonnysantino
Copy link

I can confirm that this patch fixes the dev menu overlay on Android 8

@yershalom yershalom requested a review from guyca March 21, 2018 11:51
@Crash--
Copy link
Contributor

Crash-- commented Apr 9, 2018

Thank you for this fix @krystofcelba ! Works well :)

@dannysood
Copy link

Any update on this?

@maxlavax
Copy link

Any updates? +1
I'm facing this issue as well.

@zedtux
Copy link

zedtux commented May 28, 2018

Any updates on this please ?

@91ranjan
Copy link

How can I pull your fix for now? I am stuck on this.

@sampettersson
Copy link

@91ranjan A bit hacky but we added this to our postinstall:

git apply < android/patches/react-native-navigation.patch --directory=$PWD/node_modules/react-native-navigation --unsafe-paths || true

And just get the patch from here https://github.com/wix/react-native-navigation/pull/2801.patch

@91ranjan
Copy link

91ranjan commented Jun 7, 2018

@Iamsamwhoami Thanks for the response. This fixed the issue for the red screen to appear. But still, there is an issue with "react-native-gesture-handler" which is where I came from.

Since for react-native-navigation, I have to extend SplashActivity. The function in gesture library that we have to override doesn't work.

This is specified in 'https://kmagiera.github.io/react-native-gesture-handler/docs/getting-started.html'

@Override protected ReactActivityDelegate createReactActivityDelegate()

Some error like
ERROR: Overriding a function not declared in the superclass.

Please let me know how can I resolve this issue.

I have raised the concern with react-native-gesture-handler as well:-

software-mansion/react-native-gesture-handler#128

UPDATE
As per the react-native-gesture team since the splash activity does not extends ReactActivity the override cannot happen.

Is there a work around for this?

@jpate148
Copy link

@guyca Any update?

@mths0x5f
Copy link
Contributor

instered in not asking overlay api for v2 aswell

@stale
Copy link

stale bot commented Sep 5, 2018

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the 🏚 stale label Sep 5, 2018
@zedtux
Copy link

zedtux commented Sep 6, 2018

Let us alone stupid bot !

@stale stale bot removed the 🏚 stale label Sep 6, 2018
@stale
Copy link

stale bot commented Oct 21, 2018

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the 🏚 stale label Oct 21, 2018
@zedtux
Copy link

zedtux commented Oct 22, 2018

Any update here before this stupid bot close the PR?

@stale stale bot removed the 🏚 stale label Oct 22, 2018
@guyca
Copy link
Collaborator

guyca commented Oct 28, 2018

Will address this soon.

@guyca guyca closed this Oct 28, 2018
@guyca guyca removed their request for review October 28, 2018 14:57
@jneuendorf
Copy link

jneuendorf commented Nov 12, 2018

@Iamsamwhoami I can't get your command to work. I've googled and tried everything but when I run the command with --verbose it says Skipped patch ... for all 3 files.
I've also tried the --no-index option because I thought the commit hashes might differ...

Only patch -p1 --directory=$PWD/node_modules/react-native-navigation < android/patches/react-native-navigation.patch worked for me so far.

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.

None yet