gorush icon indicating copy to clipboard operation
gorush copied to clipboard

[grpc] custom key on the payload does not work

Open xnathanh opened this issue 8 years ago • 7 comments

custom key and value on the payload does not work

and how to use "mutable-content"?

  ....
  request.setTokensList(["1234567890"]);
  request.setBadge(1);
  request.setSound("default")
  alert.setTitle("111");
  alert.setBody("123");
  request.setKey({"abc":"123","bcd":"234","sdf":54,"toy":true});
  request.setAlert(alert);
  client.send(request, function (err, response) {....
{  
   "aps":{  
      "alert":{  
         "title":"111",
         "body":"123"
      },
      "badge":1, 
      "sound":"default", 
      "APIKey":{
           "abc":"123",
           "bcd":"234",
           "sdf":54,
           "toy":true
      }
   }
}

ios side not receive "APIKey"

  "aps":{  
      "alert":{  
         "title":"111",
         "body":"123"
      },
      "badge":1, 
      "sound":"default", 
   }
}

xnathanh avatar Jan 10 '18 17:01 xnathanh

@appleboy

xnathanh avatar Jan 11 '18 04:01 xnathanh

@xnathanh Try:

request.setMutablecontent(false);

appleboy avatar Jan 16 '18 03:01 appleboy

@appleboy Mutablecontent is working but still can not get custom "key" request.setKey({"abc":"123","bcd":"234","sdf":54,"toy":true});

xnathanh avatar Jan 16 '18 08:01 xnathanh

setKey is for set Android API key, not ios custom data. I will take it.

appleboy avatar Jan 16 '18 09:01 appleboy

Was this ever fixed? @appleboy

jpeterson88 avatar Oct 03 '18 20:10 jpeterson88

@appleboy so how to send custom key-value arguments in push notification using gRPC?

belek avatar Jan 29 '19 15:01 belek

@belek @jpeterson88 @xnathanh Custom data has been implemented in https://github.com/appleboy/gorush/pull/412

appleboy avatar May 21 '19 06:05 appleboy