diff --git a/README.md b/README.md index 422b56f2..e62e3f77 100644 --- a/README.md +++ b/README.md @@ -216,7 +216,31 @@ Update the `AndroidManifest.xml` file to set the application class: Make sure you have correctly configured your app to support push notifications, and that you have generated certificate/token for sending pushes. -To enable offline notification support on iOS a guide will be released soon on our website. +##### Offline support for push notifications + +- open the XCode project +- create a new target of type `Notification service extension` +- add `App Groups` capability to the `Runner` target and the just created one +- add the line ` pod 'StreamChatClient', :git => 'https://github.com/GetStream/stream-chat-swift.git', :branch => 'release/2.0'` to the Podfile +- run `pod install` +- substitute the code in the `Notification service` with [this one](https://gist.github.com/imtoori/d37611faefef036e1a6c017b1a09e91f) and substitute APPGROUP with the just created one +- do the same with `AppDelegate.swift` using [this template](https://gist.github.com/imtoori/f95b30f25b745c5f777bfff1085176ef) +- set the notification template on your GetStream dashboard to be like this: +```handlebars +template = { + "aps" : { + "alert" : { + "title" : "{{ sender.name }} @ {{ channel.name }}", + "body" : "{{ message.text }}" + }, + "badge": {{ unread_count }}, + "apns-priority": 10, + "mutable-content" : 1 + }, + "message_id": "{{ message.id }}" +} +``` +Of course you can change the `alert` object as you want. Just make sure it has the last three lines. ## Contributing