Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

notification that will show a .js

$
0
0

I create notification that show a .js when the user click on the notification.

I used this code:

var notification = Titanium.Android.createNotification({
contentTitle: 'Notification 2',
contentText : 'Just another notification',
contentIntent: Ti.Android.createPendingIntent({intent: Ti.Android.createIntent({})}),
number: 5
});

var intent = Ti.Android.createServiceIntent({
     url : 'test.js'
 });

intent.flags |= Ti.Android.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED | Ti.Android.FLAG_ACTIVITY_SINGLE_TOP;
intent.addCategory(Ti.Android.CATEGORY_LAUNCHER);

notification.contentIntent = Ti.Android.createPendingIntent({intent: intent});

Ti.Android.NotificationManager.notify(1, notification);

when I tap a notification, it does nothing, test.js is not showed.

How can I show a .js ussing notification ?


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>