apn モジュールを使用して iOS にプッシュを送信しています。正常に動作しています。しかし、プッシュ通知で絵文字を送信したいと思います。
var apns = require('apn');
var options = {
cert: 'abc.pem',
certData: null,
key: 'abc.pem',
keyData: null,
passphrase: 'xyz',
ca: null,
pfx: null,
pfxData: null,
gateway: 'gateway.push.apple.com',
port: 2195,
rejectUnauthorized: true,
enhanced: true,
cacheLength: 100,
autoAdjustCache: true,
connectionTimeout: 0,
ssl: true
}
var message=req.body.post; // if I give a static value like message=\ud83d, it works fine
var deviceToken = new apns.Device(iosDeviceToken);
var apnsConnection = new apns.Connection(options);
var note = new apns.Notification();
note.expiry = Math.floor(Date.now() / 1000) + 3600;
note.badge = 1;
note.sound = 'ping.aiff';
note.alert = message;
apnsConnection.pushNotification(note, deviceToken);
フォーム フィールドから送信すると、電話に \ud83d が表示されます。サーバーから \ud83d を送信すると、電話に絵文字が表示されます。フォームから取得して電話で絵文字を取得するにはどうすればよいですか。