Skip to main content

Outbound Support

With Outbound Support, you can proactively engage with consumers to solve problems within the app. Read more about the feature here.

Note

All the public APIs in the SDK should be called after initializing the SDK via Install() API.

The steps to use this feature are the following -

To generate the link for Outbound Support, on your Helpshift dashboard, go to Settings > Workflows > Outbound Support.

You should see a New link button. Click on the New link button and select an action like Chat, Help Center, Single FAQ or FAQ Section and other data like CIFs, Tags, First User Message you want to send as payload to Helpshift SDK.

At last, you will get a URL encoded payload link. Send this link to your end-users embedded in a notification payload using your existing push notification system.

YOUR_APP_IDENTIFIER: Can be any unique string that identifies your app. For example, like the scheme you would use in deep link URLs for your app like myApp, myAppSupport etc.

Delegate push notification data to Helpshift

To pass the Outbound Support data to Helpshift, follow these steps -

  1. Send push notification to the users you want to give proactive support using your app's push notification system

  2. In your app, handle this notification such that when a user opens the app through notification, you pass the notification data to Helpshift SDK by calling HandleProactiveLink(string) API in IUNUserNotificationCenterDelegate.DidReceiveNotificationResponse delegate

  3. We will read the data from the link you provided and open Helpshift support with the configurations you provided from outbound support dashboard

Reference implementation of IUNUserNotificationCenterDelegate.WillPresentNotification -

[Export("userNotificationCenter:willPresentNotification:withCompletionHandler:")]
public void WillPresentNotification(UNUserNotificationCenter center, UNNotification notification, Action<UNNotificationPresentationOptions> completionHandler)
{
var userInfo = notification.Request.Content.UserInfo;
if (userInfo.ObjectForKey((NSString)"origin").IsEqual((NSString)"helpshift"))
{
// This is a notification from helpshift push notification system
// for messages sent from agent from Helpshift Dashboard
Helpshift.HandlePush(notification.Request.Content.UserInfo, false);
completionHandler(UNNotificationPresentationOptions.None);
}
else
{
// Notification is not from Helpshift. You should handle this in a way
// that best suits your app's needs. Here, we show the standard iOS
// system notification banner.
completionHandler(UNNotificationPresentationOptions.Banner);
}
}

Reference implementation of IUNUserNotificationCenterDelegate.DidReceiveNotificationResponse -

[Export("userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:")]
public void DidReceiveNotificationResponse(UNUserNotificationCenter center, UNNotificationResponse response, Action completionHandler)
{
var userInfo = response.Notification.Request.Content.UserInfo;
if (userInfo.ObjectForKey((NSString)"origin").IsEqual((NSString)"helpshift"))
{
// This is a notification from helpshift push notification system
// for messages sent from agent from Helpshift Dashboard
Helpshift.HandlePush(response.Notification.Request.Content.UserInfo, true);
}
else
{
var proactiveLink = userInfo.ObjectForKey((NSString)"helpshift_proactive_link");
if (proactiveLink is NSString && !String.IsNullOrWhiteSpace((NSString)proactiveLink))
{
// This is your app's push notification system containing a Helpshift proactive link
Helpshift.HandleProactiveLink((NSString)proactiveLink);
}
else
{
// This is your app's push notification system.
}
}
completionHandler();
}

Passing configuration specific to the current user

You may want to add configuration specific to the current user in your app when they click on the notification.

Setting local API config enables the Helpshift SDK to merge configuration from both, the config embedded in the outbound support link (as mentioned in previous steps) and the local config provided at runtime. This local API config is exactly same as we would expect in other APIs like ShowConversation() or ShowFAQs().

We will use this configuration for current issue as well as next issue filed in same session.

Note

You need to call this API after Helpshift.Install() and before Helpshift.HandleProactiveLink()

Implement public interface IHelpshiftProactiveAPIConfigCollector and call Helpshift.SetHelpshiftProactiveConfigCollector(<IHelpshiftProactiveAPIConfigCollector instance>) method to initialize the config collector.

You will have to implement the method GetAPIConfig() where you can add any user specific config in the same format as you add in other public APIs like ShowConversation() or ShowFAQs().

We will merge this config and the config embedded in the Outbound Support link. We will append data of config from Outbound Support link to local config like Tags, CIFs, etc. In case of conflicts, Outbound Support config will get the precedence.

For example, following code shows how to implement IHelpshiftProactiveAPIConfigCollector interface and how to add user specific configurations using GetAPIConfig() method -

public partial class ViewController : UIViewController, IHelpshiftProactiveAPIConfigCollector
{
public ViewController(IntPtr p) : base(p)
{
Helpshift.SetHelpshiftProactiveConfigCollector(this);
}

public Dictionary<string, object> GetAPIConfig()
{
Dictionary<string, object> configDictionary = new Dictionary<string, object>();
Dictionary<string, object> cif = new Dictionary<string, object>();
cif.Add("age", new Dictionary<string, string>{
{ "type", "number" },
{ "value", "42" }
});
configDictionary.Add("cifs", cif);
return configDictionary;
}
}