Android SDK Version
  • java.lang.Object
    • com.facebook.applinks.AppLinkData

public class AppLinkData
extends java.lang.Object
Class to encapsulate an app link, and provide methods for constructing the data from various sources
Nested Class Summary
Modifier and TypeClass and Description
static interface AppLinkData.CompletionHandler
Interface to asynchronously receive AppLinkData after it has been fetched.
Field Summary
Modifier and TypeField and Description
static java.lang.StringARGUMENTS_EXTRAS_KEY
Key that should be used to get the "extras" field for this app link.
static java.lang.StringARGUMENTS_NATIVE_CLASS_KEY
Key that should be used to pull out the native class that would have been used if the applink was deferred.
static java.lang.StringARGUMENTS_NATIVE_URL
Key that should be used to pull out the native url that would have been used if the applink was deferred.
static java.lang.StringARGUMENTS_REFERER_DATA_KEY
Key that should be used to get the "referer_data" field for this app link.
static java.lang.StringARGUMENTS_TAPTIME_KEY
Key that should be used to pull out the UTC Unix tap-time from the arguments for this app link.
Method Summary
Modifier and TypeMethod and Description
static AppLinkDatacreateFromActivity(Activity activity)
Parses out any app link data from the Intent of the Activity passed in.
static AppLinkDatacreateFromAlApplinkData(Intent intent)
Parses out any app link data from the Intent passed in.
static voidfetchDeferredAppLinkData(Context context, AppLinkData.CompletionHandler completionHandler)
Asynchronously fetches app link information that might have been stored for use after installation of the app
static voidfetchDeferredAppLinkData(Context context, java.lang.String applicationId, AppLinkData.CompletionHandler completionHandler)
Asynchronously fetches app link information that might have been stored for use after installation of the app
BundlegetArgumentBundle()
The full set of arguments for this app link.
java.lang.StringgetPromotionCode()
Returns the promotion code for this App Link.
java.lang.StringgetRef()
Returns the ref for this App Link.
BundlegetRefererData()
The referer data associated with the app link.
UrigetTargetUri()
Returns the target uri for this App Link.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Field Detail

ARGUMENTS_TAPTIME_KEY

public static final java.lang.String ARGUMENTS_TAPTIME_KEY
Key that should be used to pull out the UTC Unix tap-time from the arguments for this app link.

ARGUMENTS_REFERER_DATA_KEY

public static final java.lang.String ARGUMENTS_REFERER_DATA_KEY
Key that should be used to get the "referer_data" field for this app link.

ARGUMENTS_EXTRAS_KEY

public static final java.lang.String ARGUMENTS_EXTRAS_KEY
Key that should be used to get the "extras" field for this app link.

ARGUMENTS_NATIVE_CLASS_KEY

public static final java.lang.String ARGUMENTS_NATIVE_CLASS_KEY
Key that should be used to pull out the native class that would have been used if the applink was deferred.

ARGUMENTS_NATIVE_URL

public static final java.lang.String ARGUMENTS_NATIVE_URL
Key that should be used to pull out the native url that would have been used if the applink was deferred.
Method Detail

fetchDeferredAppLinkData

public static void fetchDeferredAppLinkData(Context context,
                                            AppLinkData.CompletionHandler completionHandler)
Asynchronously fetches app link information that might have been stored for use after installation of the app
Parameters:
context - The context
completionHandler - CompletionHandler to be notified with the AppLinkData object or null if none is available. Must not be null.

fetchDeferredAppLinkData

public static void fetchDeferredAppLinkData(Context context,
                                            java.lang.String applicationId,
                                            AppLinkData.CompletionHandler completionHandler)
Asynchronously fetches app link information that might have been stored for use after installation of the app
Parameters:
context - The context
applicationId - Facebook application Id. If null, it is taken from the manifest
completionHandler - CompletionHandler to be notified with the AppLinkData object or null if none is available. Must not be null.

createFromActivity

public static AppLinkData createFromActivity(Activity activity)
Parses out any app link data from the Intent of the Activity passed in.
Parameters:
activity - Activity that was started because of an app link
Returns:
AppLinkData if found. null if not.

createFromAlApplinkData

public static AppLinkData createFromAlApplinkData(Intent intent)
Parses out any app link data from the Intent passed in.
Parameters:
intent - Intent from the Activity that started because of an app link
Returns:
AppLinkData if found. null if not.

getTargetUri

public Uri getTargetUri()
Returns the target uri for this App Link.
Returns:
target uri

getRef

public java.lang.String getRef()
Returns the ref for this App Link.
Returns:
ref

getPromotionCode

public java.lang.String getPromotionCode()
Returns the promotion code for this App Link.
Returns:
promotion code

getArgumentBundle

public Bundle getArgumentBundle()
The full set of arguments for this app link. Properties like target uri & ref are typically picked out of this set of arguments.
Returns:
App link related arguments as a bundle.

getRefererData

public Bundle getRefererData()
The referer data associated with the app link. This will contain Facebook specific information like fb_access_token, fb_expires_in, and fb_ref.
Returns:
the referer data.