【发布时间】:2016-03-04 02:24:43
【问题描述】:
我可以使用 Parse.com Unity 插件在操作完成后安排向用户推送通知吗?
即)在 1 小时内通知用户他的建筑物已经建成。(如 coc 示例)
【问题讨论】:
标签: parse-platform unity3d push schedule
我可以使用 Parse.com Unity 插件在操作完成后安排向用户推送通知吗?
即)在 1 小时内通知用户他的建筑物已经建成。(如 coc 示例)
【问题讨论】:
标签: parse-platform unity3d push schedule
我不认为推送通知是您在这里寻找的东西,而是我认为您想要Local Notifications。使用本地通知,您可以安排在指定时间显示通知(您通常会在玩家离开应用时安排通知,因为您通常不希望通知在他们播放时显示)。
例如,您将执行以下操作(未经测试):
public void OnApplicationPause(bool isPaused)
{
// If paused, then in background
if (isPaused)
{
LocalNotification notification = new LocalNotification();
notification.alertAction = "App Name";
notification.alertBody = "The building is complete";
notification.hasAction = true;
notification.applicationIconBadgeNumber = 1; // Set's the badge count
notification.fireDate = dateBuildingWillBeFinished;
NotificationServices.ScheduleLocalNotification(notification);
}
else // Entered the app
{
// Clear notifications
NotificationServices.CancelAllLocalNotifications();
NotificationServices.ClearLocalNotifications();
}
}
推送通知通常用于向所有玩家或一组玩家(例如英国玩家)发送消息,以通知他们某事,例如正在进行的应用内购买促销。本地通知是特定于用户的,并且可以起到更多提醒的作用,例如您的建筑已经完工或您一周内没有访问过您的城镇等。
【讨论】: