Gonçalo Miguel
Posts: 0
Joined: Tue May 06, 2014 10:09 am

Custom Push Notifications Window on Receive

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

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Custom Push Notifications Window on Receive

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).

Gonçalo Miguel
Posts: 0
Joined: Tue May 06, 2014 10:09 am

Custom Push Notifications Window on Receive

Thanks, it dit it :)

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Custom Push Notifications Window on Receive

Hello Gonçalo

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

Gonçalo Miguel
Posts: 0
Joined: Tue May 06, 2014 10:09 am

Custom Push Notifications Window on Receive

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)

Gonçalo Miguel
Posts: 0
Joined: Tue May 06, 2014 10:09 am

Custom Push Notifications Window on Receive

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

Gonçalo Miguel
Posts: 0
Joined: Tue May 06, 2014 10:09 am

Custom Push Notifications Window on Receive

Can you update this thread please ?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Custom Push Notifications Window on Receive

Hi Gonçalo,

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

Gonçalo Miguel
Posts: 0
Joined: Tue May 06, 2014 10:09 am

Custom Push Notifications Window on Receive

Ok, i ́ll be waiting.
Thanks

Return to “Issues”