Notifications iOS

Configure Push notifications and In-app notifications

Configure push notifications via Helpshift

Helpshift enables you to send notifications to your users. This is particularly useful when you have multiple users on multiple platforms like iOS and Android. Notifications are useful to tell your users when you reply to an issue that they submitted. When the app is backgrounded, the notification that is sent from Helpshift appears as a badge or sound alert or both and appears with the App icon in the iOS Notification Center.

Configure Helpshift's push notification service in the Helpshift admin interface

Set up your application with Apple and enable push notifications. Download the Push Notifcation Certificate from Apple's developer portal, and double click on it to import it to the Keychain Access application.

In the Keychain Access application right click on the certificate that was just added and click export it in .p12 format. Please provide a password while exporting the certificate (We do not accept empty passwords). Note that if your development private key is not present in Keychain Access you will not be able to export it in .p12 format. Once you have exported the .p12 file you can login and upload that file in your app settings in the Helpshift admin panel. Provide the same password you used while exporting to .p12 format.


Set the Production / Development mode options, depending on whether your Apple push certificate was for testing (development push) or production. You can configure whether to send a badge or not, and sound alerts if you provided custom sounds bundled with your app to handle notifications. Save it and you're all set.

Configure the Helpshift Xamarin SDK to handle notifications

For Helpshift SDK to work with the Helpshift push notification service you will need to invoke the HelpshiftApi.HelpshiftCore.RegisterDeviceTokenapi call inside the application delegate method RegisteredForRemoteNotifications In your app delegate file it will look something like this:

public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
    var DeviceToken = deviceToken.Description;

Whenever a push notification is received, the application delegate DidReceiveRemoteNotification gets called. Developers should check the "origin" field of the notification dictionary and call 'HelpshiftCore.HandlePushNotification' api if the origin of the notification is "helpshift". The Helpshift SDK will check issue for which the notification was received and will launch the chat screen for that issue automatically.

Whenever a push notification is received and the app is not active, i.e. it is in killed state, on tapping the notification, FinishedLaunching delegate gets called and then DidReceiveRemoteNotification gets called. There are two different APIs for handling push notification. From FinishedLaunching, you need to call the HandlePushNotification(object notification, bool isAppLaunch, UIViewController vc) API. To avoid calling the push handler APIs from both FinishedLaunching and DidReceiveRemoteNotification, you need to use a bool flag (this flag can be a member of the AppDelegate class), as shown in the code below :

Example usage:

public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
    // Your code

    //  Check if the app is launched through a push notification
    if (launchOptions != null && launchOptions.Keys != null && launchOptions.ContainsKey(new NSString("UIApplicationLaunchOptionsRemoteNotificationKey")))
        NSDictionary userInfo = launchOptions.ObjectForKey(new NSString("UIApplicationLaunchOptionsRemoteNotificationKey")) as NSDictionary;

        //  Check if the notification belongs to Helpshift
        if (userInfo.ObjectForKey((NSString)"origin").IsEqual((NSString)"helpshift"))
            // Set the boolean flag to 'true' (This flag can be a member of the AppDelegate class)
            pushHandledFromFinishedLaunching = true;

            // Get the top view controller
            var window = UIApplication.SharedApplication.Delegate.GetWindow();
            var vc = window.RootViewController;
            while (vc.PresentedViewController != null)
                vc = vc.PresentedViewController;

            // Call the push handler API
            HelpshiftCore.HandlePushNotification(userInfo, true, vc);

    //  Your code

public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
    var DeviceToken = deviceToken.Description;

public override void DidReceiveRemoteNotification(UIApplication application, NSDictionary userInfo, System.Action<UIBackgroundFetchResult> completionHandler)
    NSObject originVal = userInfo.ObjectForKey((NSString)"origin");

    // Check if the notification belongs to Helpshift
    // Check if it was not handled from FinishedLaunching
    if (originVal != null && originVal.IsEqual((NSString)"helpshift") && !pushHandledFromFinishedLaunching)
        Console.WriteLine("notification is " + userInfo);

    // Reset the boolean flag (This flag can be a member of the AppDelegate class)
    pushHandledFromFinishedLaunching = false;

In-app notifications

In-app notifications are similar to Apple's push notification banners. Unlike push notifications, they appear within your app when it is in use by the user.

These notifications are sent when an agent replies to a customer's issue. Your customers can click on these banners to go straight into the conversation screen.



Configuring In-app notifications

If you do not want the in-app notifications support provided by the Helpshift SDK, please set this flag to "no". The default value of this flag is "yes" i.e in-app notifications will be enabled.
Read more about in-app notifications in the Notifications section.

"yes" / "no"


using HelpshiftApi;

Dictionary<string, string> config = new Dictionary<string, string>();
HelpshiftCore.Install("apiKey","domainName","appId", config);

Showing notification count when replies are sent to the user

Via Helpshift API

If you want to show your user notifications for replies sent by an Agent to their open Issues, you can use notification counts provided by the Helpshift SDK. These notification counts give you the total number of unread messages and display it as a badge. You can get notification counts asynchronously by implementing the Helpshift delegate method "DidReceiveUnreadMessageCount" . Notifications are typically displayed as badges inside your app where a user clicks on the help section. These badges can be displayed anywhere in your app's interface to tell the user that they have unread replies/messages from you.

For example


If you want to fetch the notification count from the server, you can call the RequestUnreadMessagesCount API with a true param value.

For example


You will receive the callback with the notification count in the delegate registered using HelpshiftSupport.SetDelegate() api in DidReceiveUnreadMessagesCount method. Refer Support delegates.