Background Application Notification

Excuse me for my English, I'm French.

My problem is:

I want to detect if my application is in the background (with the home button for example)
If it is in the background, I want to create a notification in the notification bar. And if you click on it you returns to the application without relaunched the application, just put in the foreground.

My code (for notification) :

//some other code

var notification = Titanium.Android.createNotification(
            contentTitle: 'Skool Radio',
            contentText: 'Application en tâche de fond',
            tickerText: 'Application en tâche de fond'

tabGroup.addEventListener('paused', function() {
Ti.Android.NotificationManager.notify(1, notification);

//some other code;

(All my variables work fine (tabGroup….) just the notification and backgroud detection not work)

Thank you for your help.


1 Answer

  • Hi Philip, background detection is not supported in android as per titanium documentation. and for notification you have to create intent to invoke the application. link and description here.