I'm creating a deep/dynamic link following this github project.
Here's the link which is getting created: https://appcode.app.goo.gl/?link=http://example.com/-example&apn=com.abc.xxx&amv=16&ad=0&extraParameter=null
This is the method I'm using for sharing it:
private void shareDeepLink(String deepLink) {
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_SUBJECT, "Firebase Deep Link");
intent.putExtra(Intent.EXTRA_TEXT, deepLink);
itemView.getContext().startActivity(intent);
}
This is the intent-filters
defined in my app's AndroidManifest.xml
file:
<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:host="example.com" android:scheme="http"/>
<data android:host="example.com" android:scheme="https"/>
</intent-filter>
This is how I'm trying to receive the shared deep-link
:
boolean autoLaunchDeepLink = false;
AppInvite.AppInviteApi.getInvitation(mGoogleApiClient, this, autoLaunchDeepLink)
.setResultCallback(
new ResultCallback<AppInviteInvitationResult>() {
@Override
public void onResult(@NonNull AppInviteInvitationResult result) {
if (result.getStatus().isSuccess()) {
// Extract deep link from Intent
Intent intent = result.getInvitationIntent();
final String deepLink = AppInviteReferral.getDeepLink(intent);
Log.d("deepLinkMainActivity", deepLink);
} else {
Log.d("getInvitation", "getInvitation: no deep link found.");
}
}
});
Here's what is getting logged out (received deep-link): http://example.com/-example
As you can clearly see, I'm not getting the exact deep-link which was created and instead I'm getting it's altered version. Why?
And how can I get exactly the same deep-link which was created and shared?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…