react-native-activity-view
react-native-activity-view copied to clipboard
Activity view can't open from modal
I was getting the following error when I was trying to show the activity view from within a modal.
Warning: Attempt to present <UIImagePickerController: 0x7f8cde1afc00> on <UIViewController: 0x7f8cded45ba0> whose view is not in the window hierarchy!
I found a similar issue with another react native module and tried the same solution which worked.
https://github.com/marcshilling/react-native-image-picker/pull/24
I modified ActivityView.m
changing line 125 (https://github.com/naoufal/react-native-activity-view/blob/master/ActivityView.m#L125) to the following:
[ctrl.presentedViewController presentViewController:activityView animated:YES completion:nil];
I have no ObjectiveC experience though so while this works for me, not sure if it's the right thing to do.
Thoughts?
Any thoughts on this? I'm happy to submit a PR for review.
I'm having the same issue. I tried @twalling and it works well for me, thanks for the tip! I submitted a pull request with @twalling code as well as file sharing support..
Thanks for the tip! Not in line 125 anymore but can be easily modded with latest release as well.
Any updates on this issue?
By the way @twalling's workaround worked for me, but I needed to add the line instead of replacing existing in order to make it working both in Modal and in common view.