[native] c++ interface to kill app on iOS and Android
Summary:
context: ENG-2158
This code will not generate crash reports, but simply exit the app.
It uses the same killing methods as already used react-native-exit-app but it's adapted to use this on c++ level and wrapped inside our logic.
Probably in the future, we can remove react-native-exit-app dependency and use this function exposed via CommCoreModule.
Test Plan:
- Expose terminate function via CommCoreModule and pin to eg. dev tools inside profile tab.
- Build this for both iOS and Android, check if it exits the app without any additional errors.
- Check if the crash report wasn't generated.
- Test on both physical devices.
Reviewers: marcin, jon, atul, tomek
Reviewed By: marcin, atul, tomek
Subscribers: ashoat, tomek, atul, abosh
Differential Revision: https://phab.comm.dev/D5618