aboutsummaryrefslogtreecommitdiff
path: root/WordPress/src/main/java/org/wordpress/android/ui/HelpshiftDeepLinkReceiver.java
blob: a2c2328a511206250d0f418c0b07fd3485478adc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package org.wordpress.android.ui;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.helpshift.support.Support;

public class HelpshiftDeepLinkReceiver extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        String action = getIntent().getAction();
        Uri data = getIntent().getData();

        if (Intent.ACTION_VIEW.equals(action) && data != null) {
            String faqid = data.getQueryParameter("faqid");
            String sectionid = data.getQueryParameter("sectionid");
            if (faqid != null) {
                Support.showSingleFAQ(this, faqid);
            } else if (sectionid != null) {
                Support.showFAQSection(this, sectionid);
            }
        }
        finish();
    }
}