プッシュ通知を送信するサーバー コードをいくつか作成します。メッセージと呼ばれるフォームフィールドがあります。私が必要としているのは、メッセージにいくつかの絵文字を入れることです。
雲のキャラクターを \ue48d と書くと、サーバーは文字列 '\ue48d' として認識します。
プッシュ通知で使用できるようにデコードするにはどうすればよいですか?
更新: これが私のサーバー コードです。フォームのメッセージ フィールドに \exxx を書き込み、このコードでエンコードして Apple に送信したいと考えています。
exports.create = function(req, res){
var devices = req.body.devices;
var message = req.body.message;
var note = new apn.Notification();
note.expiry = Math.floor(Date.now() / 1000) + 3600; // Expires 1 hour from now.
note.badge = 3;
note.sound = "ping.aiff";
note.alert = message;
note.payload = {'messageFrom': 'Burak'};
for (var i in devices) {
device = new apn.Device(devices[i]);
apnConnection.pushNotification(note, device);
}
res.send(200,'Successfull')
}