Skip to main content

Deep Linking in FAQs

Important
Helpshift’s Legacy SDKs (SDK Version <=7.x.x) reached their end of life on 31 Dec 2022, and end of support on 31 March 2023. Please upgrade to the Latest SDKif you haven't already.

Deep Linking in FAQs

Using custom URL schemes to support deep linking in your app

Use custom URL schemes to direct users to particular link in your app from Helpshift FAQs. You can use these schemes to provide a more seamless experience for the user. For example, if your android app has a registration screen, clicking on a registration link in an FAQ can directly take the user to that screen.

Insert custom URL schemes in FAQs

When editing your FAQ, select the text and then click on create a link.

add-android-deep-link-1.png

In the dialog that pops up, enter your custom URL and save the FAQ.

add-android-deep-link-2.png

Deep linking is a custom linking URL that gives the developers the freedom to decide what the URL can do when the user clicks on a Custom URL.

In deep linking, you are allowed to set Custom URL schemes like myscheme://example.com. For example, the URL myscheme://example.com/?faqid=95 (where faqid is the publish ID of an FAQ), will open up the relevant FAQ and the URL myscheme://example.com/?sectionid=8 (where sectionid is the publish id of any Section), will open up relevant section.

In order for the developers to handle myscheme, they will have to call showSingleFAQ and showFAQSection api with the corresponding FAQ ID and SECTION ID respectively. You will then need to implement following things in your app to handle and take the required action.

For Example:

//AndroidManifest.xml
<activity android:name=".DeepLinkActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="myscheme" android:host="example.com"/>
</intent-filter>
</activity>
//DeepLinkActivity.java
public class DeepLinkActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.deep_link);

TextView deepLinkUrl = (TextView) findViewById(R.id.deep_link_url);

Intent intent = getIntent();
Uri data = intent.getData();

if (data.getQueryParameter("faqid") != null) {
Support.showSingleFAQ(this, data.getQueryParameter("faqid"));
finish();
} else if (data.getQueryParameter("sectionid") != null) {
Support.showFAQSection(this, data.getQueryParameter("sectionid"));
finish();
} else {
deepLinkUrl.setText("Deep link received - " + data);
}
}
}