Skip to content

Working with http/https schemes in StreetHawk Growth (Android)


The article describes steps to use StreetHawk growth with http and https as deeplink scheme inside your Android application. The idea is to bundle the deeplink url with http or https scheme inside a application specific deeplink url

Implementation Steps

  • Register application specific scheme in AndroidManifest.xml

Register your application specific scheme in AndroidManifest.xml (preferably in Launcher Activity of application) as shown below.

<intent-filter android:label="secondPage">
    <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.BROWSABLE" />
        <category android:name="android.intent.category.DEFAULT" />
        <data android:scheme="MyFirstApp" />    <!--  Replace with your application specific scheme -->

Make sure to include the application scheme inside it's own intent-filter tabs and not to merge with existing ones as doing so wont register your application specific scheme.

  • Append the application specific scheme before the actual deeplink URL

Call originate share when user press the share button. Simply append your application specific scheme to your original deeplink url as shown below. Share the url received from StreetHawk.

    Button share = new Button(this);
        share.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {

        /*Replace with your application specific scheme*/   
        String appScheme = "MyFirstApp://";    

                String ID = "ShareViaFacebook"

        /*Append appScheme before https scheme*/
                String shareLink = appScheme+"https://homepage?recipe=chocolatechipcookie";

                String utm_source = "Facebook";
                String utm_medium = "cpc";
                String utm_term = "facebookAdd";
                String campaign_content = "best chocolate chip cookie recipe";
                String default_ur = "";

                Growth.getInstance(this).originateShareWithCampaign(ID, shareLink, utm_source, utm_medium,utm_term, campaign_content, default_ur, new IGrowth() {
                            public void onReceiveShareUrl(String shareUrl) {
                     Intent intent = new Intent(Intent.ACTION_SEND);
                    mContext.startActivity(intent);       // Launch default application picker

                            public void onReceiveErrorForShareUrl(JSONObject errorResponse) {

  • Extract the deeplink with http/https scheme and launch with deeplink url

Implement handleHttpDeepLink function inside your application and call the same from the onCreate function of the activity registered with your deeplink url (preferably launcher activity of your application)

 private void handleHttpDeeplink(){
        String SH_SCHEME = "MyFirstApp://";
        Intent intent = getIntent();
        String scheme=intent.getScheme();
            String httpUrl = intent.getDataString().replace(SH_SCHEME,"");
            try {
                int index = httpUrl.indexOf(':');
                if (index > 0) {
                    scheme = httpUrl.substring(0, index);
                    if(scheme.equals("http") || scheme.equals("https")){
                        Intent deepLinkIntent = new Intent();
            } catch (Exception e) {

    protected void onCreate(Bundle savedInstanceState) {
     handleHttpDeeplink();  //Calling handleHttpDeeplink function