Android Event Listener, suspend and resume, UIApplicationWillResignActiveNotification

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
trevix
Posts: 1100
Joined: Sat Feb 24, 2007 11:25 pm
Contact:

Android Event Listener, suspend and resume, UIApplicationWillResignActiveNotification

Post by trevix » Thu Apr 16, 2026 11:20 am

My app runs on Android and iOS.
It also read NFC tags on Android and iOS.

I am a little confused on trying to handle what happens when the app goes to background or resumes.

What is available:
- "Suspend" and "Resume" commands (Android and iOS. added on LC 10) are "Sent to the current card when the application moves to the background."

- "StackPaused" and "StackResumed" (Android only - Android Event Listener library): "When your app goes into the background, the handler "StackPaused" will be executed, and when your app comes back the handler "StackResumed" will run."

- UIApplicationWillResignActiveNotification and UIApplicationDidBecomeActiveNotification (iOS only - mergNotify by Monte) "These notifications are send when the app is being opened and closed, the device is switched on or off with the app running or when some
other system notification is presented over the app."

How am I using them:
- "Suspend" and "Resume":
I need to stop NFC scanning and resume it when the App is backgrounded or resumed. The NFC reading should happen on the App only when the App is to the front.

- StackPaused" and "StackResumed" and UIApplicationWillResignActiveNotification and UIApplicationDidBecomeActiveNotification:
Used to send a local notification that advise the user that a certain time has passed in the App and it should take some actions.
Note: StackPaused" and "StackResumed" run the the iOS command, where the code is, in order to make it work for both platform.

What is my problem:
Everything is working fine but I recently found out that ,at every NFC scan in the app, a "StackPaused" and "StackResumed" are called. And should not.

Is this a bug?
Is there a way to avoid it?
Should I just use "Suspend" and "Resume" commands only?

Thanks for any help.
Trevix
Trevix
OSX 15.7 xCode 26.01 LC 10.0.3 RC1 iOS 15> Android 7>

Post Reply