gorush icon indicating copy to clipboard operation
gorush copied to clipboard

no body receive on ios if use "alert"

Open xnathanh opened this issue 8 years ago • 3 comments

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;
    };
}

xnathanh avatar Jan 02 '18 11:01 xnathanh

fixed by #324 Can you help to try it out? thanks.

appleboy avatar Jan 03 '18 09:01 appleboy

    let a = new messages.NotificationRequest.Alert();
    a.setBody("new_body");
    a.setTitle("new_message");

thanks

xnathanh avatar Jan 03 '18 17:01 xnathanh

so we closed issue.

appleboy avatar Jan 04 '18 02:01 appleboy