Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
11 Views

Where to put on notification function of cordova push plugin

Hello,

I have no idea where to put push.on('notification', function(data) in my project. Should it be inside index.html or index_user_scripts.js? Somebody please help...

Thanks,

Joko.

Tags (2)
0 Kudos
2 Replies
Highlighted
11 Views

There are no push notification sample apps, but I recommend you study the "hello cordova" and "barcode scanner" and "audio app" samples in order to get familiar with how to write a Cordova app using the XDK. Once you understand how those apps work it should become more clear how to work with other plugin APIs.

0 Kudos
Highlighted
Beginner
11 Views

Dear Paul,

Thanks for your response, actually I have a problem that my app not showing alert as I expected when it receive notifications. Here is my code :

push.on('notification', function(data) {

                    alert(data.title+" Pesan: " +data.message);
                    update_badge_pengumuman(data.count);
                    update_badge_absensi('out');

                });

 

0 Kudos