I've implemented push notifications with AppCenter on an ASP.Net Core Web API. Server is sending HTTP requests to AppCenter that is in charge of pushing notifications to each platforms Android & iOS.
Mobile apps are developed with Xamarin Forms. I've followed Microsoft documentation here
Xamarin Android application is receiving every push notifications like a charm.
The problem is for Xamarin iOS application. Devices are not receiving any push notification.
Here is iOS settings I've made:
Then, I've successfully published the app to TestFligth in production mode.
When launching the app, I'm getting appcenter device InstallId by calling method AppCenter.GetInstallIdAsync()
.
Finally, when push notification is sent, nothing happens. And I don't have any logs to search the problem.
Is there something I missed to make it work ?
AppCenter provides a different AppSecret for each platform. You should do :
if (Xamarin.Forms.Device.RuntimePlatform == Xamarin.Forms.Device.iOS)
{
//Start AppCenter Push notification with iOS app secret
AppCenter.Start("xxxxxxxxxxxxxxxxxxxxxxx", typeof(Push));
}
else if (Xamarin.Forms.Device.RuntimePlatform == Xamarin.Forms.Device.UWP)
{
//Start AppCenter Push notification with UWP app secret
AppCenter.Start("xxxxxxxxxxxxxxxxxxxxxxx", typeof(Push));
}
else if(Xamarin.Forms.Device.RuntimePlatform == Xamarin.Forms.Device.Android)
{
//Start AppCenter Push notification with Android app secret
AppCenter.Start("xxxxxxxxxxxxxxxxxxxxxxx", typeof(Push));
}