Class PushNotifications
Namespace: Unity.Services.PushNotifications
Syntax
public class PushNotifications : object
Properties
Analytics
Declaration
public static PushNotificationAnalytics Analytics { get; }
Property Value
| Type | Description |
|---|---|
| PushNotificationAnalytics |
Methods
RegisterForPushNotificationsAsync()
Registers for push notifications with the appropriate mechanism for the current platform.
This method will automatically handle platform specific intricacies of getting a push notification token, and will send the appropriate analytics events to Unity Analytics 2.
Declaration
public static Task<string> RegisterForPushNotificationsAsync()
Returns
| Type | Description |
|---|---|
| Task<String> | (Asynchronously via a Task) The device token as a string. |
RegisterForPushNotificationsAsync(PushNotificationSettings)
(Deprecated - use the parameterless version and set settings in the editor GUI instead. Using this method will overwrite any settings you have in the GUI settings interface). Registers for push notifications with the appropriate mechanism for the current platform.
This method will automatically handle platform specific intricacies of getting a push notification token, and will send the appropriate analytics events to Unity Analytics 2.
Declaration
public static Task<string> RegisterForPushNotificationsAsync(PushNotificationSettings settings)
Parameters
| Type | Name | Description |
|---|---|---|
| PushNotificationSettings | settings | A PushNotificationSettings object with the settings for the SDK. See the documentation on that class for more information. |
Returns
| Type | Description |
|---|---|
| Task<String> | (Asynchronously via a Task) The device token as a string. |
Events
OnNotificationReceived
Declaration
public static event Action<Dictionary<string, object>> OnNotificationReceived
Event Type
| Type | Description |
|---|---|
| Action<Dictionary<String, Object>> |