Push notifications with Emojis

26 views
Skip to first unread message

fernando.jmnz...@gmail.com

unread,
Jan 18, 2018, 12:38:27 PM1/18/18
to Back4App
Hi, I need to know how can I send Emojis through Back4App push notifications?

Is there a way to send texts that include unicode values, hexadecimal values or something similar for that purpose?

cha...@back4app.com

unread,
Jan 19, 2018, 2:27:10 PM1/19/18
to Back4App
Hi Fernando,

Yes, it's possible! (:

You only need to follow these steps below:

1 - Install this module in your cloud code. Regarding to the module installation, this link can help you about it.

2 - Then, you'll only need to edit your cloud code, like this example:

var emoji = require('node-emoji');

Parse.Cloud.define("pushsample", function (request, response) {
var message = emoji.emojify('I :pizza: you!'); //edit your push notification here
Parse.Push.send({
        channels: ["PushEmoji"], //add your channel name here
        data: {
	    alert: message,
        }
   }, {
        success: function () {
            // Push was successful
            response.success("push sent");
        },
        error: function (error) {
        // Push was unsucessful
        response.error("error with push: " + error);
        },
        useMasterKey: true
   });
});

Regards,
Charles Ramos
Reply all
Reply to author
Forward
0 new messages