Skip to content

Commit 814bd6f

Browse files
authored
Added extras to push docs for Swift
2 parents 1b9d0a7 + 5426235 commit 814bd6f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

content/push/publish.textile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,6 +1193,25 @@ channel = realtime.channels.get('pushenabled:foo');
11931193
channel.publish(message);
11941194
```
11951195

1196+
```[realtime_swift]
1197+
let extras = ["push": [
1198+
"notification": [
1199+
"title": "Hello from Ably!",
1200+
"body": "Example push notification from Ably!"
1201+
]
1202+
]] as any ARTJsonCompatible
1203+
1204+
let message = ARTMessage(name: "name", data: "data")
1205+
message.extras = extras
1206+
1207+
let channel = realtime.channels.get("pushenabled:foo")
1208+
channel.publish([message]) { error in
1209+
if let error = error {
1210+
print("Error publishing message: \(error)")
1211+
}
1212+
}
1213+
```
1214+
11961215
```[rest_javascript]
11971216
var extras = {
11981217
push: {

0 commit comments

Comments
 (0)