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

Alerts Not Working in Share Extension #99

Open
AndrewHenderson opened this issue May 8, 2018 · 4 comments · Fixed by RocketChat/rn-extensions-share#3
Open

Alerts Not Working in Share Extension #99

AndrewHenderson opened this issue May 8, 2018 · 4 comments · Fixed by RocketChat/rn-extensions-share#3

Comments

@AndrewHenderson
Copy link
Collaborator

Hopefully, I'm messing up something very simple, but I can't seem to get React Native Alert working in the share extension.

Alerts work fine in my main app, but calling Alert.alert has no effect in the extension. Perhaps the API is not accessible on iOS within extensions.

I can't seem to find anyone else discussing/reporting this issue.

@AndrewHenderson
Copy link
Collaborator Author

AndrewHenderson commented May 18, 2018

I'm also finding that NetInfo.getConnectionInfo returns "unknown" for the connection type.

And NetInfo.isConnected is false despite having Wi-Fi and successfully making HTTP requests from the extension.

@CGReinhold
Copy link

Hey, @AndrewHenderson, do you have any updates on this?

I'm having the same issue using a simple Alert.alert('Test', 'Test'); when the app is run from the share-extensions.

I also noticed that ActionSheetIOS has the same issue. This example simple won't work on the extensions but work properly on the main app:

ActionSheetIOS.showActionSheetWithOptions({
  options: ['Cancel', 'Remove'],
  destructiveButtonIndex: 1,
  cancelButtonIndex: 0,
}, () => {});

@AndrewHenderson
Copy link
Collaborator Author

@CGReinhold I chose to avoid certain unavailable APIs in favor of React UI.

I went to submit a bug on React Native's repo: https://github.com/facebook/react-native/issues/new?template=bug_report.md. They require an MCVE, so I'd have to write that.

I submitted a question on SO: https://stackoverflow.com/questions/52048505/react-native-apis-unavailable-in-share-extension. Maybe we'll get someone from the RN team to reply.

@djorkaeffalexandre
Copy link

@AndrewHenderson I think this PR can make this works.. facebook/react-native@2968450 :) I'll try soon on my fork of this library and can open a pull request here.
Thanks.

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 a pull request may close this issue.

3 participants