6. Send emails and push notifications
Select the user's checkbox, click send a notification, and select email message/push notifiaction from the drop-down list to send emails or push notifications to the user.
In the mail body, you can use some special labels, such:
{$ {Name }}} indicates the name attribute in the user profile.
Click "continue" to allow you to choose the sending time, or specify the sending time immediately:
Note that there is no Beijing time in the time zone. You can select Shanghai time.
Select now and send this message. The email will be sent immediately.
In addition, there is also a way to send notifications, which can be scheduled for the time period of sending notifications.
To send a push notification to a user, you need to collect the device tokens of the User device in the application delegate and send them to the mixpanel using addpushdevicetoken:
-(Void) Application :( uiapplication *) applicationdidregisterforremotenotificationswithdevicetoken :( nsdata *) devicetoken {
Mixpanel * mixpanel = [mixpanel sharedinstance];
[Mixpanelidentify: @ "kmyhy"];
[Mixpanel. People addpushdevicetoken: devicetoken];
}
If you do this, you will see the device token (the iOS devices attribute) of the user in the user's profile ):
Then you can send a push notification to the user.
The message writing interface of mixpanel is quite interesting. It displays an image of push notification received when the iPhone lockscreen is locked. to edit the message content, edit the message content on the screen, as shown in:
It is worth noting that the prompt sound cannot be directly added to the Message editing interface. You must provide the prompt sound through payload in custom data. mixpanel will merge custom data into the editing result:
For example, write the following payload to play the default prompt sound and display the logo with a number 1 while the user receives the message:
{"APs": {"sound": "default", "badge": 1 }}
Mixpanel tutorial (2)