iOS App home press reset screen

Hello Guys,

One question, I try to do an app and I need every time the app goes in standby or it exits the screen when I launch it again to show the login screen instead of the last screen.

Now, if I start the app and then I press the home button and then I select the app again it will show me the last state of the app, in my case I need to reset it and to send the user to the login screen again.

Is there a simple way to do that ? thanks.

For one thing, the standard Xojo App class doesn’t provide the events you need. I use Jason King’s ImprovediOSApplication class, which might be in the version of iOSKit on Github. If it is, what you need to do is add it to your project and change the super of your App to ImprovediOSApplication which will give you a DidBecomeActive event. You can call your login view from there.

And where exactly did you find that ? I just looked under that project and I did not found at all ImprovediOSApplication . Can you please be more specific .

Thanks .

As I said, it might be in the source in Github. But if it isn’t then searching is your friend. I just searched this forum and found this thread. The answer I gave there is still relevant. I suggest reaching out to Jason King and asking nicely if he will send you his class.

The project is still public on my dropbox almost 2 years later.

This thread has some info and my suggestions, as well as a link to the actual comment which has the dropbox link.
https://forum.xojo.com/34897-ios-events-for-going-to-and-returning-from-background

I still haven’t added it to github. Maybe one of these days…

[quote=361871:@Jason King]The project is still public on my dropbox almost 2 years later.

This thread has some info and my suggestions, as well as a link to the actual comment which has the dropbox link.
https://forum.xojo.com/34897-ios-events-for-going-to-and-returning-from-background

I still haven’t added it to github. Maybe one of these days…[/quote]
Thanks a lot Jason, that really helps a lot, I wish iOS could be more usable than what it is now but what to do we can still hope in one day will not need to shift between swift and Xojo.

Thanks again.

[quote=361871:@Jason King]The project is still public on my dropbox almost 2 years later.

This thread has some info and my suggestions, as well as a link to the actual comment which has the dropbox link.
https://forum.xojo.com/34897-ios-events-for-going-to-and-returning-from-background

I still haven’t added it to github. Maybe one of these days…[/quote]
Hi Jason,

I did try to run that project to see what is there and it seems that I cannot run it I get 7 errors with the error [quote]Foundation.NSArray.Constructor, line 19
Type mismatch error. Expected UInt32, but got Ptr
m.UInt32Value(i*SizeOfPointer) = UInt32(objects(i).id)[/quote] Is this a XOJO thing or some code error ?

Thanks

Please copy the improvedIOSApplication class from the project and into your own. The other code in that project is no longer valid in the current version of Xojo.

Hello Jason, it seems that I managed in a way to doit, I kind of played with the notification and now I always have 1 in the app , any idea how to remove that notification from the app icon ? thanks.

Use the Extensions.SetNumberOnIcon function in iOSKit.

Thanks , found it .