You can purchase a store item defined in the Economy system.
1
2
3
4
5
// Get a store itemvarstoreItem=economySystem.StoreItems.First();varpurchaseEventArgs=awaitpurchasingSystem.BuyProductAsync(storeItem);Debug.Log($"Receipt: {purchaseEventArgs.purchasedProduct.receipt}");
You can let the user rate your application using the NakamaSystem’s RateAppAsync function which will trigger a feedback email to whichever email address is configured on the server.
1
2
3
varscore=5;varmessage="I love this game!";awaitnakamaSystem.RateAppAsync(score,message);
varunlockablesSystem=this.GetSystem<UnlockablesSystem>();varunityMobileNotificationsSystem=this.GetSystem<UnityMobileNotificationsSystem>();varmessages=newUnlockablesNotificationMessages{ClaimAvailableFunc=unlockable=>newNotificationMessage{Title="Unlockable reward available!",Body=$"The reward for the unlockable '{unlockable.Name}' is available to claim."}};unityMobileNotificationsSystem.ObserveSystem(unlockablesSystem,messages);
varenergiesSystem=this.GetSystem<EnergiesSystem>();varunityMobileNotificationsSystem=this.GetSystem<UnityMobileNotificationsSystem>();varmessages=newEnergiesNotificationMessages{EnergyAccumulatedFunc=energy=>newNotificationMessage{Title="Energy available!",Body=$"You have new '{energy.Id}' available!"},EnergyMaxFunc=energy=>newNotificationMessage{Title="Energy is full!",Body=$"'{energy.Id}' is full, spend it now!"},EnergyRewardAccumulatedFunc=energy=>newNotificationMessage{Title="Reward Energy available!",Body=$"You have new '{energy.Id}' available!"},EnergyRewardMaxFunc=energy=>newNotificationMessage{Title="Reward Energy is full!",Body=$"'{energy.Id}' is full, claim your reward!"}};unityMobileNotificationsSystem.ObserveSystem(energiesSystem,messages);
To manually schedule a notification with custom properties, you can use ScheduleAdhocNotification.
1
2
3
4
5
vartitle="Notification Title";varbody="The description of the notification";varscheduledDateTime=DateTime.Today.AddHours(1);varidentifier=unityMobileNotificationsSystem.ScheduleAdhocNotification(title,body,scheduledDateTime);
To cancel a scheduled notification you can use CancelNotification, passing in the notification’s identifier.