question

ignat-nee-1 avatar image
ignat-nee-1 asked

Schedule notifications

Greetings.
I tried to create local notifications for my unity android project. This is notification method copyed just from tutorial:

public void SchedulePush()
	{
		var sDate = DateTime.UtcNow;
		sDate = sDate.AddSeconds(5);
		var ScheduledNotification = new PlayFabNotificationPackage()
		{
			ScheduleType = ScheduleTypes.ScheduledDate,
			Message = "This is a Scheduled Message",
			Title = "Test Scheduled Push",
			Id = "TestScheduledPush",
			ScheduleDate = sDate,
		};
		var json = PlayFab.Json.JsonWrapper.SerializeObject(ScheduledNotification);
		PlayFabAndroidPlugin.ScheduleNotification(json, sDate);
	}

When i'm calling this method, i'm recieved only audio effect in my android. There is no image, title or description of my notification.
After that i added res/drawable folder in my project and put there app_icon and app_icon_transparent files.
After that, notifications start recieved on my phone, but without custom title and message - it's only name of project on title and empty block on message. Here is a screenshot how it's look:

Otherwise, on bluestacks emulator or Huawei mobile local notifications come immediately, without any delay.

Is there anny suggestions, where there may be a trouble? Push notification looks like receiving normal, if application is active.

Push Notifications
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
1807605288 avatar image
1807605288 answered

We recently begun an effort to improve our push notification plugin: https://blog.playfab.com/blog/push-upgrade-5-22

I'm happy to say that the issues with scheduled notifications are being addressed, and that will be ready for the next version of PlayFab UnitySDK (v2.22).

I too have noticed that the title doesn't display as selected, so I will investigate that as well, but I don't know for certain why that problem exists yet. Watch the blog post above, as I'll update it as I resolve things.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.