react-native-share-extension: Share extension app can not run twice in one app(ios).
In IOS, the share extension cannot run twice, because it does not exit in the close method.
RCT_EXPORT_METHOD(close) {
[extensionContext completeRequestReturningItems:nil
completionHandler:nil];
}
What should i do if i wanna run it twice in one app? Would it be possible to append “exit(0);” to the method?
About this issue
- Original URL
- State: open
- Created 6 years ago
- Reactions: 3
- Comments: 24
Commits related to this issue
- #100 - Fixes extension not exiting properly on close in iOS 11.3.1 — committed to alinz/react-native-share-extension by AndrewHenderson 6 years ago
Hi, I’m experiencing the same behaviour… at this moment only in the simulator. Any solution?
@AndrewHenderson @rbscott Thanks, your solution works for me, but I have my own approach.
RNExitApp.exitApp()
(from react-native-exit-app
) right after callShareExtension.close()
That solution works for me.
Be careful about using
exit(0);
in your code. It was causing the extension to close before the JavaScript code was run but only when the app was archived.