3

My app is working fine but whenever i add deep link code in my manifest my app lunching icon disappears this is my manifest file

<activity
    android:name=".login.LoginActivity"
    android:screenOrientation="portrait">
    <intent-filter>
        <category android:name="android.intent.category.LAUNCHER" />
        <action android:name="android.intent.action.MAIN" />
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE"/>
        <data android:scheme="https" />
        <data android:host="gizbo.ae" />
    </intent-filter>
</activity> 

When ever i add these three line for deep linking. App icon launching icon disappears from device.

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="https" />
<data android:host="gizbo.ae" />

even i removed these two lines

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE"/> 

again same problem.

i just want to make my app visible in Google search and i am following this link

TheMisir
  • 4,083
  • 1
  • 27
  • 37
Umer
  • 1,566
  • 2
  • 20
  • 31

2 Answers2

12

You must use multiple intent-filter tags:

  <activity
        android:name=".login.LoginActivity"
        android:screenOrientation="portrait">
        <intent-filter>
            <category android:name="android.intent.category.LAUNCHER" />
            <action android:name="android.intent.action.MAIN" />
        </intent-filter>
        <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="https" />
            <data android:host="gizbo.ae" />
        </intent-filter>
    </activity> 
Simon Marquis
  • 7,248
  • 1
  • 28
  • 43
  • thanks man it works...with this code my app will display in google search or i have to add some uri? – Umer Jan 05 '16 at 12:59
  • No, you should implement the App Indexing API: https://developers.google.com/app-indexing/android/publish – Simon Marquis Jan 05 '16 at 18:04
1

You have to add another activity to use deep linking and then start your login activity and pass your data to that.

So declare the activity as below:

 <activity
            android:name=".DeelinkActivity"
            android:screenOrientation="portrait"
            android:launchMode="singleTask"
            android:windowSoftInputMode="adjustResize|stateAlwaysHidden">
            <!-- URL scheme -->
            <intent-filter>
                <data android:host="gizbo.ae"
                    android:scheme="https" />

                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
            </intent-filter>
            <!-- End URL scheme -->
  </activity>

and then in onCreate in that activity you can call the login activity also from there you can pass your data to that activity.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    Intent intent = getIntent();
    String action = intent.getAction();
    Uri data = intent.getData();
    //put code to pass data as extras and Start your login activity here
}

Good luck.

Tharindu Welagedara
  • 2,660
  • 18
  • 27