I'm using Pushwooosh Cordova Plugin. I'd like to keep track of important notifications received individually, but all received notifications get collapsed

I tried to use root_params : {collapse_key : "a_different_collapse_key_each_time"} but it didn't work. Any idea here

here is a log :

{"request":{"application":"xxxxxxx","auth":"xxxxxxxxx","notifications":[{"send_date":"now","ignore_user_timezone":true,"content":"coucou5","devices":["xxxxxxxxxxx"],"data":{"val":"a val"},"platforms":[3],"android_priority":1,"android_header":"a title5","android_sound":"flop","android_root_params":{"collapse_key":"req5"}}]}}

thanks

asked 15 Jan '16, 17:19
elpetro's gravatar image

elpetro
112

Hi, I expected a quick and easy reply for that one... Let me rephrase the question: Is anyone here using the Cordova plugin on Android and doesn't have any new notification erasing the previous one?

thanks!

(19 Jan '16, 16:00) elpetro elpetro's gravatar image

Mine don't collapse into one, I wish they did for some cases.

What do you do to make them?

Rob

permanent link
answered 19 Jan '16, 21:54
rwillett's gravatar image

rwillett
2015

Well, I'm using pushWoosh Cordova plugin v3.5.4 and the Web API. Works as expected for iPhone but not for android. I have attached above a trace of the object sent

(19 Jan '16, 22:14) elpetro elpetro's gravatar image

So what do you send to collapse them?

I'm still unclear.

Rob

permanent link
answered 20 Jan '16, 14:59
rwillett's gravatar image

rwillett
2015

I send this object though API

    var url_prefix = 'https://cp.pushwoosh.com/json/1.3';
    var pushData = {
        request: {
        application: config.pushNotif.pushWooshAppCode,
        auth: config.pushNotif.pushWooshApiToken,
        notifications: [{
            send_date: "now", // YYYY-MM-DD HH:mm  OR 'now'
            ignore_user_timezone: true, // or false             
            devices: regIds,            
            data : data.data
        }]
        }
    };
    var notifConf = pushData.request.notifications[0];
    switch (data.platform) {            
        case 'ANDROID' :
            logger.info('PushNotifMgr platform ANDROID data= '+JSON.stringify(data));
            notifConf.content = data.msg;
            notifConf.platforms = [3];
            notifConf.android_priority = 1;
            notifConf.android_vibration = 1;
            if (data.picture) notifConf.android_custom_icon = data.picture;
            if (data.banner) notifConf.android_banner = data.banner;
            if (data.title) notifConf.android_header = data.title;
            if (data.sound) notifConf.android_sound = data.sound;
            if (data.root_params) notifConf.android_root_params= data.root_params;
        case 'IOS' :
            if (data.title) notifConf.content = data.title+' ';
            else notifConf.content = '';
            notifConf.content += data.msg;
            break;
        default :               
            break;
    }

    logger.info('PushNotifMgr sendPushWooshMsg sending info: '+JSON.stringify(pushData));

    request({
        url: url_prefix+'/createMessage', //URL to hit
        method: 'POST',
        json: pushData
    }, function(error, response, body){
        if(error) {
        logger.warn('PushNotifMgr sendPushWooshMsg failed sending notification with err: '+error);
        if (cb) cb(error, null);
        } else {
        logger.info('sendPushWooshMsg successfully sent push notification response: '+JSON.stringify(response));
        if (cb) cb(null, response.statusCode);
        }
    });
permanent link
answered 20 Jan '16, 15:10
elpetro's gravatar image

elpetro
112

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×447
×190
×30

question asked: 15 Jan '16, 17:19

question was seen: 1,294 times

last updated: 20 Jan '16, 15:10