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

[Question] Modify exitApp method or add new one to gracefully close the app #62

Open
juanchoperezj opened this issue May 11, 2023 · 1 comment

Comments

@juanchoperezj
Copy link

I was investigating when I came across this library and saw this answer, outdated, but I also saw other comments on an Apple Developer forum stating that there are discussions about the AppStore rejecting application with this feature.

So, doing some tests with the current exitApp method by adding the following:

RCT_EXPORT_METHOD(exitApp)
{
    dispatch_async(dispatch_get_main_queue(), ^{
        [[UIApplication sharedApplication] performSelector:@selector(suspend)];
    });
};

The app is not killed instead, is close gracefully doing the animation to the home screen, like in the video below:

Simulator.Screen.Recording.-.iPhone.14.Pro.-.2023-05-11.at.14.38.53.mp4

I want to know what could make more sense in order to have another way to close the app without killing it.
Would be good to have this feature at all? Of course, a different method to keep the other for those who seek close entirely the app.

I'm eager to work on this for both platforms.

@wumke
Copy link
Owner

wumke commented Jun 23, 2023

Hi @juanchoperezj ,

This could indeed be a 'suspendApp' function within this library...
If you also look for the correct Android counterpart, you can add a pull request if you want. (I will never implement functionality that is not available for both platforms.)

Apple does not refuse apps based on the code itself, only on abuse of functionality. Clarify your intentions and need to kill/close the app in your specific use case to Apple if they make a problem of it.

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

No branches or pull requests

2 participants