Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

WP 8.1 : clear notification and fire event when clicking on toast or tile notification message #541

Closed
charpin opened this issue Jan 25, 2016 · 3 comments
Assignees

Comments

@charpin
Copy link

charpin commented Jan 25, 2016

I'm currently developping an mobile application based on Cordova (version 4.0.0) for Windows Phone 8.1. I'm using the cordova plugin "phonegap-plugin-push" (version 1.5.2).

I finished to implement the windows phone notifications on server and front side. It's works like a charm. I'm using WNS platform to send notifications windows from my server.

I encounter two problems about the interaction between fire event notification and mobile application.

For example, I send a tile and badge notification and I receive them on the start screen of windows phone . When I click on it, I'll go to inside in my mobile application. When I go back to my start screen, I always see the tile and badge notification.

How can I clear this tile and badge notification windows ? This is possible with your plugin ?

My second problem is about the click event on notification message. When I click on toast or tile notification, my app, running in background, opens and the notification callback is not triggered and I can't display a specific badge on start screen from my app.

If I'm not mistaken, the following method to fire this event is :

  push.on('notification', function(data) {
    console.log("notification event");
    console.log(JSON.stringify(data));
    //I would like display a specific badge
    push.finish(function () {
        console.log('finish successfully called');
    });
 });

This event method only works when I'm inside on my app (running in foreground).

Do you have an idea about how to fix it ?

Be careful, unlike the issue #526, my windows phone app is deploy as Windows Phone Universal and not as Windows Phone 8.

@charpin charpin changed the title WP 8.1 : clear notification and fire event when clicking on notification message WP 8.1 : clear notification and fire event when clicking on toast notification message Jan 25, 2016
@charpin charpin changed the title WP 8.1 : clear notification and fire event when clicking on toast notification message WP 8.1 : clear notification and fire event when clicking on toast and tile notification message Jan 26, 2016
@charpin charpin changed the title WP 8.1 : clear notification and fire event when clicking on toast and tile notification message WP 8.1 : clear notification and fire event when clicking on toast or tile notification message Jan 26, 2016
@rakatyal
Copy link
Collaborator

@charpin: Presently the notification event is only fired when the app is in the foreground. This issue is already created to integrate the support for background notifications for windows, but it is yet to be worked on.
To answer your first question, the notification which appears in the notification shade is triggered by the OS, and the display in the app is handled by the user. Clicking on the notification fires a launch event which can be handled by your application. You could look at this for more details.

@charpin
Copy link
Author

charpin commented Jan 29, 2016

I'm sorry not to have been able to get back to you sooner. Firstly, thank you for your useful answer.

Secondly, about the background notifications for Windows Phone, I have seen this issue after your answer but now, I know that you're working on it. I'm eager to get the next version of this plugin !

At least, about your answer to handle notifications, your link helped me a lot. However, I can handle a tile notification fired but not a toast notification, it's weird for now. But it's not your problem and it's not about this plugin, so you did well to close this issue.

@lock
Copy link

lock bot commented Jun 5, 2018

This thread has been automatically locked.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

3 participants