Open exentrich opened 6 years ago
I concur, thanks for a great lib!
I'm experiencing the same issue.
I have followed the steps described in the README and created Separated bundles
.
The app is built with release config.
And after opening the share extension three or four times it crashes. Running on an iPhone 7 iOS 11.0.3
Please let us know if we can assist in any way.
I fixed this in weird way: Just call some failing function in js. It will crash silently extension and release memory 👍
So solution is to crash extension :)
@exentrich thanks for the idé 👍 I will implement this on my end until there is a patch for the memory issue
@exentrich @karlAlnebratt hysterical. For future comers, I wound up modifying the close method to both crash and add an animation.
Don't forget to add rootView
as a global variable (per the original comment in viewDidLoad
).
RCT_EXPORT_METHOD(close) {
dispatch_async(dispatch_get_main_queue(), ^{
[UIView animateWithDuration:0.3
animations:^(void){
CGRect rect = rootView.frame;
rect.origin.y = 2 * rect.size.height;
rootView.frame = rect;
}
completion:^(BOOL finished){
[extensionContext completeRequestReturningItems:nil
completionHandler:nil];
@throw NSInternalInconsistencyException;
}];
});
}
Why isn't https://github.com/alinz/react-native-share-extension/issues/64#issuecomment-371861215 in the repo? is there any proper way to close it without crashing it?
Just call some failing function in js. It will crash silently extension and release memory 👍
hey @exentrich, its been a while. do u recall what u meant with this?
When I called a non-existing function or a throw an Error the extension crashes, not silently.
How could I call a failing js function to release memory and not make the extension crash?
Thanks in advance
Thank you very much for this great library!
Right now i have only one issue. When i open and close extension, memory consumption only increase (double every time). After some reopens it crashes, because strict memory limits for extensions on iOS. It's looks like when extension is closed it not freeing memory.
Maybe you have some ideas, how to force free memory?