gorush
gorush copied to clipboard
no body receive on ios if use "alert"
var messages = require('./gorush_pb');
var services = require('./gorush_grpc_pb');
var grpc = require('grpc');
exports.send = (platform, tokensList, message) => {
let client = new services.GorushClient('xxxxx.xx.xx.xx:xxxx',
grpc.credentials.createInsecure());
let request = new messages.NotificationRequest();
request.setPlatform(platform);
request.setTokensList(tokensList);
let a = new proto.proto.NotificationRequest.Alert();
a.body = "abcdefg12345678";
a.title = "new_message";
request.setAlert(a);
request.setBadge(2);
request.setCategory("red");
client.send(request, function(err, response) {
if (response) {
return response.getSuccess();
}
return false;
});
};
ios logs:
function:-[AppDelegate application:didReceiveRemoteNotification:fetchCompletionHandler:] line:543 content:[XGDemo] receive slient Notification
function:-[AppDelegate application:didReceiveRemoteNotification:fetchCompletionHandler:] line:544 content:[XGDemo] userinfo {
aps = {
badge = 2;
category = red;
};
}
fixed by #324 Can you help to try it out? thanks.
let a = new messages.NotificationRequest.Alert();
a.setBody("new_body");
a.setTitle("new_message");
thanks
so we closed issue.