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

does not create the notification bar #821

Closed
diegoherrera opened this issue Apr 21, 2016 · 1 comment
Closed

does not create the notification bar #821

diegoherrera opened this issue Apr 21, 2016 · 1 comment

Comments

@diegoherrera
Copy link

Expected Behaviour

today the objetive is create a notification from 'nodejs' and receive in my phone 'android' in notificacition metod. this should create notification in state bar.

Actual Behaviour

not create notification in state bar.
this is my response in notification metod

{"count":"3","title":"Push Notification Sample","message":"u270C Peace, Love u2764 and PhoneGap u2706!","additionalData":{"from":"39337343579","collapse_key":"do_not_collapse","foreground":true}}

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

android 5.1.1

(Android) What device vendor (e.g. Samsung, HTC, Sony...)

samsung galaxy note 2

Cordova CLI version and cordova platform version

cordova 6.1.0

Sample Push Data Payload

var registrationIds = [];
var sender = new gcm.Sender('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
var message = new gcm.Message();
message.addData('message',"u270C Peace, Love u2764 and PhoneGap u2706!");
message.addData('title','Push Notification Sample' );
message.addData('msgcnt','3');
message.timeToLive = 3000;
registrationIds.push('APA91bFIVdHIMOgr3d3FtzS79bc9lHa-SgJpE1roEIhAg8hsi4X1ErBMnPTTIBlhnfBwDn0zf2awJqbRMeMyXQ1yUjylITB4ueeNTkskFgjFfDvGB3sLAd_u6QoHeP2u7Cj12ycuwRmN');
sender.send(message, registrationIds, 4, function (err,response) {
if(err) {
console.log("error " + err);
} else {
console.log(response);
}
});

####### code de app

var push = PushNotification.init({
"android": {
"senderID": "xxxxxxx"
},
"ios": {"alert": "true", "badge": "true", "sound": "true"},
"windows": {}
});

     push.on('registration', function(data) {
        console.log("registration event");
        //document.getElementById("regId").innerHTML = data.registrationId;
        console.log(JSON.stringify(data));
        app.gcm = data.registrationId; //resguardo el gcm del device
    });

     push.on('notification', function(data) {
        console.log("notification event");
        console.log(JSON.stringify(data));            
        /*
        push.finish(function () {
            console.log('finish successfully called');
        });*/
    });

     push.on('error', function(e) {
        console.log("push error");
    });
@lock
Copy link

lock bot commented Jun 4, 2018

This thread has been automatically locked.

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

No branches or pull requests

1 participant