Skip to content
This repository has been archived by the owner on Apr 2, 2021. It is now read-only.

Implement fetch deferred app link #813

Conversation

rnike
Copy link
Contributor

@rnike rnike commented Nov 14, 2020

About

Using facebook deferred app link in react-native project was a bit painful, because it isn't included in react-native-fbsdk.

Simply warp the fetchDeferredAppLink function from native.

iOS

  1. Use fetchDeferredAppLink from FBSDKAppLinkUtility
  2. Convert app link url from NSURL to NSString if app link is found and pass it to JS using RCTPromiseResolveBlock.
  3. Resolve null if app link is not found.

Android

  1. Use fetchDeferredAppLinkData from AppLinkData
  2. If appLinkData is found, convert its Uri to String and pass it to JS using com.facebook.react.bridge.Promise.
  3. Resolve null if appLinkData is not found.

Test Plan:

Check if AppLink.fetchDeferredAppLink is working as expected

Example code

import { AppLink } from 'react-native-fbsdk';

const link = await AppLink.fetchDeferredAppLink();

console.log(link); // should be a string or null

@rnike rnike marked this pull request as ready for review November 16, 2020 06:25
Copy link
Contributor

@janicduplessis janicduplessis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Looks good

@janicduplessis janicduplessis merged commit 85a984d into facebookarchive:master Nov 23, 2020
@inveon-yakupdurmus
Copy link

inveon-yakupdurmus commented Jan 21, 2021

I can get data when I send a deferred deep link for applink from the test page. But when I click on a created ad, the deep link comes NULL even though I am directed to the application.

I publish the ad from the Facebook Ad management and add it to my Facebook stream. When I click on the ad, it goes to the app. But since the application comes with NULL, I cannot direct it to product details.

I can get data when I send a deferred deep connection on the test screen.

How can I solve this problem.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants