Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Trouble Sending Push Notifications

Eric,

First of all you should set up Push notifications, as told in tutorials, when you will receive one you should add this code and try to read message.
You should place this code on Load event,

EJLD
Posts: 0
Joined: Sun Jun 08, 2014 11:03 pm

Trouble Sending Push Notifications

Alena ... :) don't take it wrong but I know all that. I hv been using pushNotif at many occasions either one-to-one device or to all devices using filters. however, this reading message functionality, I cldn't make it work based on your tuto. I'll check again but may come back to you :)

EJLD
Posts: 0
Joined: Sun Jun 08, 2014 11:03 pm

Trouble Sending Push Notifications

i m back ... I do receive the notif as usual but when opening the page where I placed the code nothing happens ???

EJLD
Posts: 0
Joined: Sun Jun 08, 2014 11:03 pm

Trouble Sending Push Notifications

sorry but nothing work. my app is on share. name collect4good
may I ask you to check quickly what is going wrong ?
html asset is "Friend115msgTxto"
you can test it under your login
appery
appery
8
looking forward to hearing from you soon
Eric

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Trouble Sending Push Notifications

Actually it's supposed to act differently, message can be read on Push notification event, not just when page with code opened.

Try to add this code instead:
pre
$(document).on("push-notification", function(event, data) {
alert(JSON.stringify(data));
window.open(data.message, "_blank");
}); /pre

What do you get in alert message?

EJLD
Posts: 0
Joined: Sun Jun 08, 2014 11:03 pm

Trouble Sending Push Notifications

Alena, thks for your msg
understood how it works.
I had to change a little bit the code
the device reacts to

document.addEventListener("push-notification", function(event,data) {
alert(JSON.stringify(data));
});

how ever the alert message remains "undefined"

couldn't find how to retrieve the msg sent ?

any idea ?

best,
Eric

EJLD
Posts: 0
Joined: Sun Jun 08, 2014 11:03 pm

Trouble Sending Push Notifications

any advice to retrieve the message contents and read it ?
it would be help full to filter the incoming pushNotif message
thks in advance

EJLD
Posts: 0
Joined: Sun Jun 08, 2014 11:03 pm

Trouble Sending Push Notifications

hi there ? any advice? :)

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Trouble Sending Push Notifications

Hello,

Please add this line to the "push-notification" event listener:

alert(event.notification);

Kindly let us know the result.

EJLD
Posts: 0
Joined: Sun Jun 08, 2014 11:03 pm

Trouble Sending Push Notifications

Hi Sergiy, thks for your msg. I tried but still unproper.
this time I got = [object Object]
before with alert(data.message), I got = undefined
we are are getting closer :)
looking forward to receiving something new from you :)
thks for your time
best
Eric

Return to “Issues”