Software Archive
Read-only legacy content
17061 Discussions

Where to put on notification function of cordova push plugin

Joko_P_
Beginner
295 Views

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.

0 Kudos
2 Replies
PaulF_IntelCorp
Employee
295 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
Joko_P_
Beginner
295 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
Reply