feat(grcp): support MutableContent for ios (#332)

This commit is contained in:
Bo-Yi Wu
2018-01-16 11:26:45 +08:00
committed by GitHub
parent 4c203c9829
commit b0260af17b
6 changed files with 77 additions and 35 deletions

View File

@@ -19,6 +19,7 @@ function main() {
request.setAlert(alert);
request.setThreadid("threadID");
request.setContentavailable(false);
request.setMutablecontent(false);
client.send(request, function (err, response) {
if(err) {
console.log(err);

View File

@@ -501,7 +501,8 @@ proto.proto.NotificationRequest.toObject = function(includeInstance, msg) {
alert: (f = msg.getAlert()) && proto.proto.Alert.toObject(includeInstance, f),
sound: jspb.Message.getFieldWithDefault(msg, 10, ""),
contentavailable: jspb.Message.getFieldWithDefault(msg, 11, false),
threadid: jspb.Message.getFieldWithDefault(msg, 12, "")
threadid: jspb.Message.getFieldWithDefault(msg, 12, ""),
mutablecontent: jspb.Message.getFieldWithDefault(msg, 13, false)
};
if (includeInstance) {
@@ -587,6 +588,10 @@ proto.proto.NotificationRequest.deserializeBinaryFromReader = function(msg, read
var value = /** @type {string} */ (reader.readString());
msg.setThreadid(value);
break;
case 13:
var value = /** @type {boolean} */ (reader.readBool());
msg.setMutablecontent(value);
break;
default:
reader.skipField();
break;
@@ -700,6 +705,13 @@ proto.proto.NotificationRequest.serializeBinaryToWriter = function(message, writ
f
);
}
f = message.getMutablecontent();
if (f) {
writer.writeBool(
13,
f
);
}
};
@@ -916,6 +928,23 @@ proto.proto.NotificationRequest.prototype.setThreadid = function(value) {
};
/**
* optional bool mutableContent = 13;
* Note that Boolean fields may be set to 0/1 when serialized from a Java server.
* You should avoid comparisons like {@code val === true/false} in those cases.
* @return {boolean}
*/
proto.proto.NotificationRequest.prototype.getMutablecontent = function() {
return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 13, false));
};
/** @param {boolean} value */
proto.proto.NotificationRequest.prototype.setMutablecontent = function(value) {
jspb.Message.setField(this, 13, value);
};
/**
* Generated by JsPbCodeGenerator.