Start a new topic

sendMessage Question


In another thread somebody suggest I change sendPayload to sendmessage.  I did and not the pushes go to both Android and iOS. 

Now my question is: how do I set the iOS badge count with sendMessage?

Did anybody else have this problem?  How did you get around it?

function onRequest(request, response, modules){
    var push = modules.push, collectionAccess = modules.collectionAccess;
    var logger = modules.logger;
    var iOSAps = { alert: request.body.message, badge: parseInt(request.body.count), sound: "default.wav" };
    var iOSExtras = '';
    var androidPayload = {message: request.body.message };
    collectionAccess.collection('user').findOne({ "_id": collectionAccess.objectID(request.body.KinveyID) }, function(err, user) {
      if (user)
//    		push.sendPayload(user, iOSAps, iOSExtras, androidPayload, function(err, result) {
        push.sendMessage(user, request.body.message, function(err, result) { 


Login or Signup to post a comment