MicrosoftDocs / playfab-docs

Documentation for the Azure PlayFab service for game development
Creative Commons Attribution 4.0 International
99 stars 129 forks source link

iOS Push Notifications guide outdated and incomplete #561

Open kevinfoley opened 5 months ago

kevinfoley commented 5 months ago

The documentation for setting up push notifications on iOS has several issues:

  1. The example code uses a deprecated Unity API, UnityEngine.iOS.NotificationServices.RegisterForNotifications(). New projects should use the Mobile Notifications package
  2. The tutorial cannot be followed in a cross-platform application that implements Push Notifications on Android. The PlayFab documentation for Android push notifications directs us to use Firebase Cloud Messaging (FCM). If the FCM plugin is installed, on iOS it hijacks the normal notification APIs via swizzling. When we attempt to request user authorization to display notifications, we get an error "Attempting to complete future before FCM initialized."

Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

anjekan commented 6 days ago

we are very emergency about this ios push deprecated in unity 2022.3.53f1 If there is any possible alternative, please let me know.

because of our request, publisher started using Playfab. While positive opinions about Playfab are coming out, iOS push problem makes publisher feel not good. I hope an alternative comes out as soon as possible. Thank you.

is req.DeviceToken at below codes can be used in RegisterForIOSPushNotificationRequest?

IEnumerator RequestAuthorization() { var authorizationOption = AuthorizationOption.Alert | AuthorizationOption.Badge; using (var req = new AuthorizationRequest(authorizationOption, true)) { while (!req.IsFinished) { yield return null; };

    string res = "\n RequestAuthorization:";
    res += "\n finished: " + req.IsFinished;
    res += "\n granted :  " + req.Granted;
    res += "\n error:  " + req.Error;
    res += "\n deviceToken:  " + req.DeviceToken;
    Debug.Log(res);
}

}