Skip to content

Commit e44e03a

Browse files
authored
Update README.md
1 parent 5d8005a commit e44e03a

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Edit your `Package.swift`
3333

3434
```swift
3535
//add this repo to dependencies
36-
.package(url: "https://github.com/MihaelIsaev/FCM.git", from: "0.4.1")
36+
.package(url: "https://github.com/MihaelIsaev/FCM.git", from: "0.5.0")
3737
//and don't forget about targets
3838
//"FCM"
3939
```
@@ -93,6 +93,18 @@ services.register(fcm, as: FCM.self)
9393
>
9494
> 🔑 Just go to Settings -> Service Accounts tab and press **Create Private Key** button in e.g. NodeJS tab
9595
96+
#### OPTIONAL: Set default configurations, e.g. to enable notification sound
97+
Add the following code to your `configure.swift`
98+
```swift
99+
fcm.apnsDefaultConfig = FCMApnsConfig(headers: [:],
100+
aps: FCMApnsApsObject(sound: "default"))
101+
fcm.androidDefaultConfig = FCMAndroidConfig(ttl: "86400s",
102+
restricted_package_name: "com.example.myapp",
103+
notification: FCMAndroidNotification(sound: "default"))
104+
fcm.webpushDefaultConfig = FCMWebpushConfig(headers: [:],
105+
data: [:],
106+
notification: [:])
107+
```
96108
#### Let's send first push notification! 🚀
97109

98110
Then you could send push notifications using token, topic or condition.

0 commit comments

Comments
 (0)