I've implemented everything in this article. However, I'm facing some issues.
Issue 1. In the below event,
Push.PushNotificationReceived += (sender, e)
if (e.CustomData != null)
{
summary += "\n\tCustom data:\n";
foreach (var key in e.CustomData.Keys)
{
summary += $"\t\t{key} : {e.CustomData[key]}\n";
}
}
e.CustomData is ALWAYS NOT null.
I always get this custom data key/value pair:
"google.ttl", "2419200"
Issue 2. This method never gets called, even though I use LaunchMode = LaunchMode.SingleTop
protected override void OnNewIntent(Intent intent)
{
base.OnNewIntent(intent);
Push.CheckLaunchedFromNotification(this, intent);
}
Third issue I encounter is this:
- My main activity uses LaunchMode = LaunchMode.SingleTop
- While on my main activity I press the back button to dismiss the activity.
- I send my push notification from appcenter.ms
- Notification appears in the notification center quite alright.
- Once I click the notification, my Main activity launches (still doesn't call OnNewIntent as I explained earlier).
- The e.Title and e.Message are always null in Push.PushNotificationReceived += (sender, e). Although if I had sent the push notification while the app was in the foreground, e.Title and e.Message will not be null.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.