You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**IMPORTANT**: Initialize 1 ApnSender per bundle. When you send many messages at once make sure to retry the sending in case of an error. If error happens it's recommended to retry the call after 1 second delay (await Task.Delay(1000)). Apple typically doesn't like to receive too many messages and will ocasionally respond with HTTP 429. From my experiance it happens once per 1000 requests.
102
102
103
-
Please see Apple notification format examples here: https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CreatingtheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH10-SW1.
104
-
Tip: To send properties like {"content-available": true} you can use Newtonsoft.Json attributes over C# properties like `[JsonProperty("content-available")]`.
103
+
Please see Apple notification payload examples here: https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CreatingtheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH10-SW1.
104
+
Tip: To send properties like {"content-available": true} you can use System.Text.Json attributes over C# properties like `[JsonPropertyName("content-available")]`.
105
105
106
106
## Example of notification payload
107
107
You can find expected notification formats for different types of notifications in the documentation. To make it easier to get started, here is a simple example of visible notification (the one that you'll see in phone's notification center) for iOS:
@@ -111,17 +111,17 @@ public class AppleNotification
111
111
{
112
112
publicclassApsPayload
113
113
{
114
-
[JsonProperty("alert")]
114
+
[JsonPropertyName("alert")]
115
115
publicstringAlertBody { get; set; }
116
116
}
117
117
118
118
// Your custom properties as needed
119
119
120
-
[JsonProperty("aps")]
120
+
[JsonPropertyName("aps")]
121
121
publicApsPayloadAps { get; set; }
122
122
}
123
123
```
124
-
Use `[JsonProperty("alert-type")]` attribute to serialize C# properties into JSON properties with dashes.
124
+
Use `[JsonPropertyName("alert-type")]` attribute to serialize C# properties into JSON properties with dashes.
0 commit comments