One of the most common forms of creating a notification is asking players to come back and play the game at a later time. This encourages users to continue playing our game and to come back multiple times. We can do this by setting a delivery time in the future using the following steps:
- Open up the NotificationsController script and add the following function to it:
public void ShowNotification(string title, string body,
DateTime deliveryTime)
{
IGameNotification notification =
notificationsManager.CreateNotification();
if (notification != null)
{
notification.Title = title;
notification.Body = body;
notification.DeliveryTime = deliveryTime;
notificationsManager.ScheduleNotification(notification);
}
}
This function takes in three parameters – the title, the body, and the time at which to send the notification.
- This function requires the use of the System...