-
Notifications
You must be signed in to change notification settings - Fork 22
Rich Push Notifications
LasOri edited this page Jul 5, 2019
·
8 revisions
Push notification could show media content and action buttons besides the title and body. Push notifications with these types of contents are called Rich Notifications.
- MobileEngage backend is setup for sending push notifications already
- application is setup for receiving push notifications already
- use Emarsys SDK notification extension as mentioned in documentation
NoteOnly HTTPS image URLs are supported.
| Mode | Text | Image |
|---|---|---|
| Notification center collapsed | Title is 1 line and it’s truncated if too long. Body is 4 line and it’s truncated if too long. | The small image preview is shown on the right side. Title is 1 line and it’s truncated if too long. Body is 4 line and it’s truncated if too long. |
| Lockscreen collapsed | Title is 1 line and it’s truncated if too long. Body is 4 line and it’s truncated if too long. | The small image preview is shown on the right side. Title is 1 line and it’s truncated if too long. Body is 4 line and it’s truncated if too long. |
| Floating collapsed | Title is 1 line and it’s truncated if too long. Body is 2 line and it’s truncated if too long. | The small image preview is shown on the right side. Title is 1 line and it’s truncated if too long. Body is 2 line and it’s truncated if too long. |
| Expanded | Title is 1 line and it’s truncated if too long. If the body is very long than it will be scrollable. | The image is shown at the top. Title is 1 line and it’s truncated if too long. If the body is very long than it will be scrollable. |
-
Add a new Notification Service Extension target to your project
-
Add the
EmarsysNotificationServiceto this target in the PodfilePodfiletarget "Emarsys Sample" do pod 'EmarsysSDK' end target "EMSNotificationService" do pod 'EmarsysNotificationService' end
-
Install pods with the "pod install" command
-
If your selected language is Swift, then create a Bridging-Header for your new target
<NameOfYourExtension-Bridging-Header.h>#import <EmarsysNotificationService/EMSNotificationService.h>
-
Open the NotificationService class in the target, and
- import the EmarsysNotificationService
- extend the class
EMSNotificationServiceinstead ofUNNotificationServiceExtension
import EmarsysNotificationService class NotificationService: EMSNotificationService { }
-
That's it. If you stuck anywhere, just check our sample application