Closed cjohn001 closed 1 year ago
Have you got any worker running in your app? If so, are you terminating it before calling exit
?
@CatchABus : No I do not have any workers running. The logic is triggered when pressing a button
buttonPressed(){
setTimeout(() => {
if (global.isAndroid) {
android.os.Process.killProcess(android.os.Process.myPid());
} else {
exit(0);
}
},100);
}
@CatchABus : No I do not have any workers running. The logic is triggered when pressing a button
buttonPressed(){ setTimeout(() => { if (global.isAndroid) { android.os.Process.killProcess(android.os.Process.myPid()); } else { exit(0); } },100); }
I see. Thanks for clarification. Please post the error message when possible. There might be useful information in it.
@CatchABus : attached the error dialog
@CatchABus : attached the error dialog
Are you running app using ns run
or ns debug
? App will display additional trace if installed and ran with one of those.
Note that it is against App Store rules for iOS apps to force an exit. Regardless of whether NativeScript is exhibiting expected behaviour, it would be best to find another way to handle refreshing your state.
Oddly, macOS apps are allowed to do it, mainly just in relation to refreshing some state related to in-app-purchases handling, though.
@shirakaba : Thanks for pointing this out. My problem is that timezone changes seem to not be applied to the nativescript runtime.
So doing
new Date().getTimezoneOffset().toString();
before and after timezone change results in the same offset. Only after restart of the app the new timezone is correctly applied. Please note, when I say after timezone change I mean, that I have put a check on app reactivation where I test for time zone changes:
Application.on(Application.resumeEvent,...
Maybe I should add another bug report in regards to timezone changes?
@CatchABus : I am unfortunately only seeing the bug when running the release build. Both ns debug and ns run on device do not lead to the issue.
@CatchABus : Have you been able to recreate the issue?
I believe this is fixed by https://github.com/NativeScript/ios/commit/5a6c2ee5efa0c557c94ae56da0d3b3a31911d1b8
Can try with:
npm i --save-dev @nativescript/ios@8.5.3-next.2023-06-12-5243995962
ns clean
ns run ios
@rigor789 : Great job, version @nativescript/ios@8.5.3-next.2023-06-12-5243995962 indeed does fix the issue. Shall I keep the issue open till 8.5.3 was released?
Issue Description
I need to reconfigure and restart my app in certain situations, for example on timezone changes. So far I called exit(0) on IOS. However, since upgrading to
"@nativescript/core": "8.5.0",
This now results in the app crashing with the familiar ios dialog and error message "appname Crahsed Do you want to share additional information with the developer? "
Reproduction
call
exit(0)
Relevant log output (if applicable)
No response
Environment
Dependencies
Please accept these terms