Page 1 of 2

Custom Push Notifications Window on Receive

Posted: Wed May 07, 2014 5:25 pm
by Gonçalo Miguel

Hi, i ́m current developing for android and iOS and i would like to know if at this moment is possible to make:

  • Receive data from notification when clicking on notification
    (if app is open , closed or running on background) , so i can open a new custom window with the text of the notification.

  • As iOS doesn ́t receive notifications on status bar when app is open, how i can get a event that notification received ?

    Thanks,
    Gonçalo


Custom Push Notifications Window on Receive

Posted: Wed May 07, 2014 6:56 pm
by Kateryna Grynko

Hi Gonçalo,

On Push notification event, you can process the data you get as you need (you can access the message using data.aps.alert variable).


Custom Push Notifications Window on Receive

Posted: Thu May 08, 2014 9:37 am
by Gonçalo Miguel

Thanks, it dit it :)


Custom Push Notifications Window on Receive

Posted: Thu May 08, 2014 9:39 am
by Evgene Karachevtsev

Hello Gonçalo

Thank you for the update. Do not hesitate to contact us if you need any further help.


Custom Push Notifications Window on Receive

Posted: Thu May 08, 2014 10:40 am
by Gonçalo Miguel

The only time it didn ́t was in iOS , when the app is closed.
I can get it with app foreground and backgroud, but no if app was closed.
Is there any alternative ?
( in other platforms is something like: invoke event, reason notification)


Custom Push Notifications Window on Receive

Posted: Thu May 08, 2014 7:04 pm
by Kateryna Grynko

Hi Gonçalo,

Take a look here please:
http://stackoverflow.com/questions/14...


Custom Push Notifications Window on Receive

Posted: Thu May 08, 2014 11:34 pm
by Gonçalo Miguel

Hi Katya, i don ́t think i need to add a service myself.

Phonegap PushNotification plug in should do it.

On Source Tab:

CordovaLibPlugins
org.apache.cordova.plugins.PushNotification

(void)getPendingNotifications:(CDVInvokedUrlCommand *)command;

I think i should on startPage.JS on "deviceready" event call something like this:

pushNotification.getPendingNotifications(function(notifications) {
//do something with the notifications
}

But i still don ́t get it working...

1 - What do you think about this aproach ?

2 - One other issue, this is only on iOS , since pending notifications are workin on android already. Since this is just an iOS function call, how can i write it on devicereadyEvent to do it only if device is iOS ?

Thank you for your feedback on this


Custom Push Notifications Window on Receive

Posted: Fri May 09, 2014 4:16 pm
by Gonçalo Miguel

Can you update this thread please ?


Custom Push Notifications Window on Receive

Posted: Fri May 09, 2014 4:30 pm
by Kateryna Grynko

Hi Gonçalo,

Sorry, we will need some time to find a solution. We'll post an update here.


Custom Push Notifications Window on Receive

Posted: Fri May 09, 2014 4:32 pm
by Gonçalo Miguel

Ok, i ́ll be waiting.
Thanks