react-native-activity-view icon indicating copy to clipboard operation
react-native-activity-view copied to clipboard

Activity view can't open from modal

Open twalling opened this issue 9 years ago • 5 comments

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?

twalling avatar Jan 27 '16 01:01 twalling

Any thoughts on this? I'm happy to submit a PR for review.

twalling avatar Feb 03 '16 01:02 twalling

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..

wootwoot1234 avatar Feb 05 '16 07:02 wootwoot1234

Thanks for the tip! Not in line 125 anymore but can be easily modded with latest release as well.

unmec avatar Nov 09 '17 09:11 unmec

Any updates on this issue?

Andrfas avatar May 22 '18 13:05 Andrfas

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.

Andrfas avatar May 28 '18 14:05 Andrfas