Y ykucuk Well-Known Member Licensed User Longtime User Oct 8, 2024 #1 Hello, I am developing an internal Android application for enterprise use that will not be uploaded to Google Play. The goal is to sequentially call third-party apps at specific intervals, keeping my app in the background. Here's the scenario: My app is active and in the foreground. I send an FCM notification to the app containing the package name of a third-party app, and then launch that app using an intent. After a certain period, I send another FCM notification with a new package name to open a different third-party app. The issue arises after launching the first third-party app: my app moves to the background, and even though it receives the next FCM notification, it is unable to bring the new app to the foreground. I understand that many actions like this have been restricted for security reasons in recent Android versions (as of 2024), but since this is for internal use, I am hoping there might be a workaround or best practice. Is there a way for my app to bring itself back to the foreground after receiving an FCM notification or to handle sequential app launching when it’s running in the background? How can I ensure that my app continues to launch third-party apps even when it’s not in the foreground? Any advice or best practices for handling this use case in an enterprise environment would be greatly appreciated.
Hello, I am developing an internal Android application for enterprise use that will not be uploaded to Google Play. The goal is to sequentially call third-party apps at specific intervals, keeping my app in the background. Here's the scenario: My app is active and in the foreground. I send an FCM notification to the app containing the package name of a third-party app, and then launch that app using an intent. After a certain period, I send another FCM notification with a new package name to open a different third-party app. The issue arises after launching the first third-party app: my app moves to the background, and even though it receives the next FCM notification, it is unable to bring the new app to the foreground. I understand that many actions like this have been restricted for security reasons in recent Android versions (as of 2024), but since this is for internal use, I am hoping there might be a workaround or best practice. Is there a way for my app to bring itself back to the foreground after receiving an FCM notification or to handle sequential app launching when it’s running in the background? How can I ensure that my app continues to launch third-party apps even when it’s not in the foreground? Any advice or best practices for handling this use case in an enterprise environment would be greatly appreciated.
Erel B4X founder Staff member Licensed User Longtime User Oct 8, 2024 #2 The solution is to gain the special "draw on top of apps" permission: https://www.b4x.com/android/forum/threads/draw-on-top-of-other-apps-permission.90513/#content It will allow you to start activities while the app is in the background. Upvote 0
The solution is to gain the special "draw on top of apps" permission: https://www.b4x.com/android/forum/threads/draw-on-top-of-other-apps-permission.90513/#content It will allow you to start activities while the app is in the background.
Y ykucuk Well-Known Member Licensed User Longtime User Oct 8, 2024 #3 Erel said: The solution is to gain the special "draw on top of apps" permission: https://www.b4x.com/android/forum/threads/draw-on-top-of-other-apps-permission.90513/#content It will allow you to start activities while the app is in the background. Click to expand... Erel, this solution worked perfectly. It was exactly what I needed. Is there a similar setup for B4i? Upvote 0
Erel said: The solution is to gain the special "draw on top of apps" permission: https://www.b4x.com/android/forum/threads/draw-on-top-of-other-apps-permission.90513/#content It will allow you to start activities while the app is in the background. Click to expand... Erel, this solution worked perfectly. It was exactly what I needed. Is there a similar setup for B4i?
Erel B4X founder Staff member Licensed User Longtime User Oct 9, 2024 #4 No. iOS doesn't allow you to do such thing. The best you can do is to show a notification and the app will start if the user clicks on it. Upvote 0
No. iOS doesn't allow you to do such thing. The best you can do is to show a notification and the app will start if the user clicks on it.
Y ykucuk Well-Known Member Licensed User Longtime User Oct 9, 2024 #5 Erel said: No. iOS doesn't allow you to do such thing. The best you can do is to show a notification and the app will start if the user clicks on it. Click to expand... It might be a bit of a stretch, but is it possible to automatically click on incoming notifications (iOS) using the accessibility service? According to the document found here (Building Accessible Apps: https://developer.apple.com/accessibility/), I would like to know if there’s any method for handling notifications in this way. Upvote 0
Erel said: No. iOS doesn't allow you to do such thing. The best you can do is to show a notification and the app will start if the user clicks on it. Click to expand... It might be a bit of a stretch, but is it possible to automatically click on incoming notifications (iOS) using the accessibility service? According to the document found here (Building Accessible Apps: https://developer.apple.com/accessibility/), I would like to know if there’s any method for handling notifications in this way.