Notifications

Configure In-app notifications

Helpshift's macOS sdk uses local notifications to inform users when you reply to a conversation submitted by them. Since these are local notifications, they do not work if the user quits the app.

For a smooth user experience please implement the following delegate methods in your App's delegate:

- (BOOL) userNotificationCenter:(NSUserNotificationCenter *)center shouldPresentNotification:(NSUserNotification *)notification {
    if([notification.identifier isEqualToString:HelpshiftOSXNotificationIdentifier]) {
        return YES;
    }
    return NO;
}

Sometimes macOS may decide to silence the notification from an app. This delegate tells the OS that you are interested in presenting the notification to the user.

- (void) userNotificationCenter:(NSUserNotificationCenter *)center didActivateNotification:(NSUserNotification *)notification {
    if([notification.identifier isEqualToString:HelpshiftOSXNotificationIdentifier]) {
        [HelpshiftSupport showConversationWithOptions:<CONFIG>];
        [[NSUserNotificationCenter defaultUserNotificationCenter] removeDeliveredNotification:notification];
    }
}

This delegate is called if the user clicks on a notification. Here we check if the notification belongs to Helpshift, if so we open up the Conversation screen to the user can view the latest reply to his issue. We also remove the notification from the system tray.