Stay organized with collections
Save and categorize content based on your preferences.
public abstract class FirebaseUserActions extends Object
Provides methods for logging actions that the user takes in the app.
This is a simple example for logging that the user has started to view an article:
FirebaseUserActions.getInstance(getApplicationContext()).start(
Actions.newView(
"Index your app with Google App Indexing",
"//example.net/articles/02101984.html"));
Logs that the user has stopped doing something in the app.
Use this method for a user action of some duration that has come to an end, like
when the user has finished viewing an article or stopped listening to a song, as well
as for instantaneous actions the user has taken, such as sending a message or adding a
song to a playlist. For these instantaneous actions, don't call
start(Action) at all, but just
end(Action).
Parameters
action
The Action
describing either the instantaneous action the user has just taken, or the more
long-lived activity the user has stopped doing in the app; for the latter
start(Action) should be called before calling
end(Action).
Logs that the user has started doing something in the app.
Use this method for a user action of some duration, like viewing an article or
listening to a song. If the action is instantaneous, such as sending a message or
adding a song to a playlist, then make a single call to
end(Action) instead.
Parameters
action
The Action
describing what the user has started doing in the app.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2021-05-11 UTC."],[],[],null,["# FirebaseUserActions\n\npublic abstract class **FirebaseUserActions** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nProvides methods for logging actions that the user takes in the app.\n\nThis is a simple example for logging that the user has started to view an article: \n\n FirebaseUserActions.getInstance(getApplicationContext()).start(\n Actions.newView(\n \"Index your app with Google App Indexing\",\n \"//example.net/articles/02101984.html\"));\n \n### Constant Summary\n\n|-------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [String](//developer.android.com/reference/java/lang/String.html) | [APP_INDEXING_API_TAG](/docs/reference/android/com/google/firebase/appindexing/FirebaseUserActions#APP_INDEXING_API_TAG) | The tag used for logging debug information for calls to [FirebaseUserActions](/docs/reference/android/com/google/firebase/appindexing/FirebaseUserActions) class. |\n\n### Public Constructor Summary\n\n|---|----------------------------------------------------------------------------------------------------------------------------|\n| | [FirebaseUserActions](/docs/reference/android/com/google/firebase/appindexing/FirebaseUserActions#FirebaseUserActions())() |\n\n### Public Method Summary\n\n|------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract Task\\\u003c[Void](//developer.android.com/reference/java/lang/Void.html)\\\u003e | [end](/docs/reference/android/com/google/firebase/appindexing/FirebaseUserActions#end(com.google.firebase.appindexing.Action))([Action](/docs/reference/android/com/google/firebase/appindexing/Action) action) Logs that the user has stopped doing something in the app. |\n| synchronized static [FirebaseUserActions](/docs/reference/android/com/google/firebase/appindexing/FirebaseUserActions) | [getInstance](/docs/reference/android/com/google/firebase/appindexing/FirebaseUserActions#getInstance(android.content.Context))([Context](//developer.android.com/reference/android/content/Context.html) context) Returns an instance of [FirebaseUserActions](/docs/reference/android/com/google/firebase/appindexing/FirebaseUserActions). |\n| abstract Task\\\u003c[Void](//developer.android.com/reference/java/lang/Void.html)\\\u003e | [start](/docs/reference/android/com/google/firebase/appindexing/FirebaseUserActions#start(com.google.firebase.appindexing.Action))([Action](/docs/reference/android/com/google/firebase/appindexing/Action) action) Logs that the user has started doing something in the app. |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nConstants\n---------\n\n#### public static final [String](//developer.android.com/reference/java/lang/String.html)\n**APP_INDEXING_API_TAG**\n\nThe tag used for logging debug information for calls to [FirebaseUserActions](/docs/reference/android/com/google/firebase/appindexing/FirebaseUserActions)\nclass.\n\nTo enable logging: \n\n`adb shell setprop `*log.tag.FirebaseUserActions*` `*DEBUG* \nConstant Value: \"FirebaseUserActions\"\n\nPublic Constructors\n-------------------\n\n#### public **FirebaseUserActions** ()\n\nPublic Methods\n--------------\n\n#### public abstract Task\\\u003c[Void](//developer.android.com/reference/java/lang/Void.html)\\\u003e **end** ([Action](/docs/reference/android/com/google/firebase/appindexing/Action) action)\n\nLogs that the user has stopped doing something in the app.\n\nUse this method for a user action of some duration that has come to an end, like\nwhen the user has finished viewing an article or stopped listening to a song, as well\nas for instantaneous actions the user has taken, such as sending a message or adding a\nsong to a playlist. For these instantaneous actions, don't call [start(Action)](/docs/reference/android/com/google/firebase/appindexing/FirebaseUserActions#start(com.google.firebase.appindexing.Action)) at all, but just [end(Action)](/docs/reference/android/com/google/firebase/appindexing/FirebaseUserActions#end(com.google.firebase.appindexing.Action)). \n\n##### Parameters\n\n| action | The [Action](/docs/reference/android/com/google/firebase/appindexing/Action) describing either the instantaneous action the user has just taken, or the more long-lived activity the user has stopped doing in the app; for the latter [start(Action)](/docs/reference/android/com/google/firebase/appindexing/FirebaseUserActions#start(com.google.firebase.appindexing.Action)) should be called before calling [end(Action)](/docs/reference/android/com/google/firebase/appindexing/FirebaseUserActions#end(com.google.firebase.appindexing.Action)). |\n|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n\n##### Returns\n\n- A [Task](/docs/reference/android/com/google/android/gms/tasks/Task) indicating the result of the operation. \n\n#### public static synchronized [FirebaseUserActions](/docs/reference/android/com/google/firebase/appindexing/FirebaseUserActions)\n**getInstance** ([Context](//developer.android.com/reference/android/content/Context.html) context)\n\nReturns an instance of [FirebaseUserActions](/docs/reference/android/com/google/firebase/appindexing/FirebaseUserActions).\n\nThis method does not require FirebaseApp initialization. Instead, the application\ncontext is inferred from the `context` that is explicitly passed in. \n\n#### public abstract Task\\\u003c[Void](//developer.android.com/reference/java/lang/Void.html)\\\u003e **start** ([Action](/docs/reference/android/com/google/firebase/appindexing/Action) action)\n\nLogs that the user has started doing something in the app.\n\nUse this method for a user action of some duration, like viewing an article or\nlistening to a song. If the action is instantaneous, such as sending a message or\nadding a song to a playlist, then make a single call to [end(Action)](/docs/reference/android/com/google/firebase/appindexing/FirebaseUserActions#end(com.google.firebase.appindexing.Action)) instead. \n\n##### Parameters\n\n| action | The [Action](/docs/reference/android/com/google/firebase/appindexing/Action) describing what the user has started doing in the app. |\n|--------|-------------------------------------------------------------------------------------------------------------------------------------|\n\n##### Returns\n\n- A [Task](/docs/reference/android/com/google/android/gms/tasks/Task) indicating the result of the operation."]]