profile
viewpoint

Ask questionsHow use facebook Deferred App Link Data android?

I need use Deferred app deeplink in my Android app, but in next code i get appLinkData = null

    AppLinkData.fetchDeferredAppLinkData(this, getString(R.string.facebook_app_id),
            new AppLinkData.CompletionHandler() {
                @Override
                public void onDeferredAppLinkDataFetched(AppLinkData appLinkData) {
                    Log.d("SplashActivity", "appLinkData: " + appLinkData);
                }
            }
    );

If I use Notification all work (Using the DEEP LINK TESTING TOOL) But me need exactly Deferred deeplink

I read: https://developers.facebook.com/docs/app-ads/deep-linking https://developer.android.com/training/app-links/deep-linking but this not help me

My Manifest

 <meta-data
        android:name="com.facebook.sdk.ApplicationId"
        android:value="@string/facebook_app_id" />

    <activity
        android:name="com.facebook.FacebookActivity"
        android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
        android:label="@string/app_name" />

    <activity
        android:name="com.tanat.posture.SplashActivity"
        android:screenOrientation="portrait">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </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="posture"/>
        </intent-filter>
    </activity>

My SplashActivity

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_splash);

    AppLinkData.fetchDeferredAppLinkData(this, getString(R.string.facebook_app_id),
            new AppLinkData.CompletionHandler() {
                @Override
                public void onDeferredAppLinkDataFetched(AppLinkData appLinkData) {
                    Log.d("SplashActivity", "appLinkData: " + appLinkData);
                }
            }
    );

    Intent intent = getIntent();
    String action = intent.getAction();
    Uri data = intent.getData();
    Log.d("SplashActivity", "data: " + data);
}
facebook/facebook-android-sdk

Answer questions pavel-zlotarenchuk

@KylinChang Hi, what can you say?

useful!
source:https://uonfu.com/
Github User Rank List