通过iOS上的节点js在推送通知中发送表情符号

我正在使用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); 

如果我发送来自表单字段的内容,我会在电话中看到\ ud3d。 如果我从服务器发送\ ud83d,我会看到表情符号在电话上。 如何从手机上获取emojis。

使用iOS表情符号代码 。

例如:对于节点js中的胜利手表情符号:

 notification.alert = 'This is a test notification \u270C';