Android deep linking - passing data through scheme not working


#1

I’ve successfully gotten deep linking to work (My application will launch when the user clicks the Twitter card). However, I want to pass additional data to my own scheme (testapp://www.sample.com/read?id=27514372&groupid=8995833). It appears that the Twitter application does not pass the values from the meta data “twitter:app:url:googleplay” to my application. Is this a known bug?

Meta data:

<html>
<meta name="twitter:app:name:googleplay" content="TestApp" />
<meta name="twitter:app:id:googleplay" content="wp.TestApp" />
<meta name="twitter:app:url:googleplay" content="testapp://www.sample.com/read?id=27514372&groupid=8995833" />
<meta name="twitter:creator" content="@Name" />
</html>

In my AndroidManifest.xml, I have the following for my scheme

<xml>
<activity
    android:name=".ui.activities.LoginActivity"
    android:screenOrientation="nosensor"
    android:theme="@style/NoTitleBar"
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    <intent-filter>
        <data android:scheme="testapp"/>
        <action android:name="android.intent.action.VIEW"/>
        <category android:name="android.intent.category.DEFAULT"/>
        <category android:name="android.intent.category.BROWSABLE"/>
    </intent-filter>
</activity>
</xml>

In the onCreate(..) and onStart(..), any calls to getIntent().getData(); will always return null. There is absolutely no data being passed to my application.

Thanks in advance!


Android deep-linking documentation
#2

I am currently having the same issue with my Summary twitter card. Was a solution ever found for this?


#3

Hi @TheHeartshotKid,

We believe deep links with custom url schemes to be working, but I will be looking in to this to verify. Can you supply some of the same detail as @ianko0_0 did in the mean time?

Thanks!


#4

Hi everyone,

I recently tested this from end to end and it worked as expected. If you have an issue with deep links and custom URL schemes please post enough detail about the actual values (or representative values) you are using in your urls so we can verify if there are any problems.


#5

Sorry about the delayed response. I was moved to a new project and couldn’t find time to reply. Here are the meta tags I am using to test and the main activity from my Android manifest. The twitter card shows correctly and recognizes that the app is installed as the “Open in App” button appears when the card is expanded on device. Whenever I follow the link though the url from the meta tags does not appear to be passed in. I am doing the same thing as @ianko0_0 to get the url from the launch intent ( getIntent().getData() ) and I know that android deep linking was working previously as I created a testbed app to test the process on both iOS and Android and encountered no issues. Not sure where the disconnect is so any help would be appreciated.

Google Play meta tags on test page:

<html>
<meta name="twitter:app:name:googleplay" content="Propulsion Core">
<meta name="twitter:app:id:googleplay" content="com.thrusterapps.aobaseball">
<meta name="twitter:app:url:googleplay" content="‪aobaseball://#target_url=aobaseball?deeplink=SEDum74Jag8L9QrY">‬

Main activity in AndroidManifest:

<activity android:name="com.thrusterapps.propulsioncore.PropDeepLinkingManager" 
	     android:screenOrientation="sensorLandscape"
             android:launchMode="standard"
	     android:exported="true"
             android:label="@string/app_name"
	     android:theme="@android:style/Theme.NoTitleBar"      android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
	    <intent-filter>
		<data android:scheme="aobaseball" />
		<action android:name="android.intent.action.VIEW" />
		<category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE"/>
            </intent-filter>
 </activity>
</html>

#6

FYI - If you need to pass data through app install you can use Branch Metrics (branch.io) - where you can create personalized deep links into your app even if the user does not have the app installed already.


#7

We’re having some trouble with Deep Links here Gallery Card: Android Deep Linking not working; only sends to play store