Docs

Messages

In-app messaging and push notifications with the Grovs iOS SDK

If console messages have automatic display enabled in your dashboard, they will appear in your app without any additional integration.

Push notifications

To receive push notifications for messages sent from the Grovs dashboard, pass the device token to the SDK:

Swift
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
    let token = deviceToken.map { String(format: "%02.2hhx", $0) }.joined()
    Grovs.pushToken = token
}

Displaying messages

Show the full list of messages as a modal:

Swift
Grovs.displayMessagesViewController {
    // Modal was dismissed
}

Unread count

Get the number of unread messages — useful for showing a badge:

Swift
Grovs.numberOfUnreadMessages { count in
    print("Unread: \(count)")
}