Android SDK 版本
- Mutable
- CollectionMapper
- AppCall
- CustomTab
- CustomTabUtils
- DialogFeature
- DialogPresenter
- FacebookDialogBase
- FacebookDialogFragment
- GamingAction
- FacebookWebFallbackDialog
- FragmentWrapper
- InstagramCustomTab
- PlatformServiceClient
- WebDialog
- AnalyticsEvents
- AttributionIdentifiers
- BoltsMeasurementEventListener
- BundleJSONConverter
- CallbackManagerImpl
- FacebookInitProvider
- FacebookRequestErrorClassification
- FacebookSignatureValidator
- FeatureManager
- FetchedAppGateKeepersManager
- FetchedAppSettings
- FetchedAppSettingsManager
- FileLruCache
- ImageDownloader
- ImageRequest
- ImageResponse
- ImageResponseCache
- InstallReferrerUtil
- InternalSettings
- LockOnGetVariable
- Logger
- NativeAppCallAttachmentStore
- NativeProtocol
- ServerProtocol
- SmartLoginOption
- UrlRedirectCache
- Utility
- Validate
- WorkQueue
- MessageDialog
- SendButton
- ShareButton
- ShareButtonBase
- GameRequestDialog
- ShareDialog
- MessageDialogFeature
- VideoUploader
- GameRequestValidation
- CameraEffectFeature
- CameraEffectJSONUtility
- LegacyNativeDialogParameters
- NativeDialogParameters
- ResultProcessor
- ShareConstants
- ShareContentValidation
- ShareDialogFeature
- ShareFeedContent
- ShareInternalUtility
- ShareStoryFeature
- WebDialogParameters
- ShareApi
- ShareBuilder
- Sharer
- Share
- ShareToMessengerParamsBuilder
- Messenger
- MessengerThreadParams
- MessengerUtils
- ShareToMessengerParams
- FacebookAppLinkResolver
- AppLinkData
- AppLinks
- AggregateException
- AppLink
- AppLinkResolver
- AppLinks
- CancellationToken
- CancellationTokenRegistration
- CancellationTokenSource
- Continuation
- ExecutorException
- Task
- TaskCompletionSource
- UnobservedTaskException
- AccessTokenTracker
- AuthenticationTokenTracker
- CustomTabActivity
- CustomTabMainActivity
- FacebookActivity
- FacebookAuthorizationException
- FacebookButtonBase
- FacebookCallback
- FacebookDialog
- FacebookDialogException
- LoginStatusCallback
- WebDialog
- AccessToken
- AccessTokenManager
- AccessTokenSource
- AuthenticationToken
- AuthenticationTokenCache
- AuthenticationTokenClaims
- AuthenticationTokenHeader
- AuthenticationTokenManager
- CallbackManager
- CurrentAccessTokenExpirationBroadcastReceiver
- FacebookBroadcastReceiver
- FacebookContentProvider
- FacebookException
- FacebookGraphResponseException
- FacebookOperationCanceledException
- FacebookRequestError
- FacebookSdk
- FacebookSdkNotInitializedException
- FacebookServiceException
- GraphRequest
- GraphRequestAsyncTask
- GraphRequestBatch
- GraphResponse
- HttpMethod
- LoggingBehavior
- Profile
- ProfileCache
- ProfileManager
- ProfileTracker
- ProgressNoopOutputStream
- ProgressOutputStream
- RequestProgress
- Common
- DeviceRequestsHelper
- EndToEndDumper
- CodeChallengeMethod
- CustomTabLoginMethodHandler
- CustomTabPrefetchHelper
- DeviceAuthDialog
- DeviceAuthMethodHandler
- GetTokenLoginMethodHandler
- KatanaProxyLoginMethodHandler
- LoginBehavior
- LoginClient
- LoginConfiguration
- LoginFragment
- LoginManager
- LoginMethodHandler
- LoginResult
- NativeAppLoginMethodHandler
- NonceUtil
- WebLoginMethodHandler
- WebViewLoginMethodHandler
- DefaultAudience
- LoginTargetApp
- DeviceLoginManager
- Login
- AppGroupCreationContent
- CameraEffectArguments
- CameraEffectTextures
- GameRequestContent
- ShareCameraEffectContent
- ShareContent
- ShareHashtag
- ShareLinkContent
- ShareMedia
- ShareMediaContent
- ShareMessengerActionButton
- ShareMessengerURLActionButton
- ShareModel
- ShareModelBuilder
- SharePhoto
- SharePhotoContent
- ShareStoryContent
- ShareVideo
- ShareVideoContent
- AccessTokenAppIdPair
- AppEvent
- AppEventsConstants
- AppEventsLogger
- AppEventsManager
- FlushResult
- InternalAppEventsLogger
- UserDataStore
- MetadataIndexer
- MetadataRule
- SettingsAPIFields
- AppEventsCAPIManager
- CustomEventField
- AppEventType
- AppEventUserAndAppDataField
- ConversionsAPISection
- ConversionsAPICustomEventField
- ConversionsAPIUserAndAppDataField
- ConversionsAPIEventName
- OtherEventConstants
- AppEventsConversionsAPITransformer
- AppEventsConversionsAPITransformerWebRequests
- CodelessLoggingEventListener
- CodelessManager
- RCTCodelessLoggingEventListener
- ViewIndexer
- Constants
- EventBinding
- ParameterComponent
- PathComponent
- SensitiveUserDataUtils
- UnityReflection
- ViewHierarchy
- EventDeactivationManager
- InAppPurchaseActivityLifecycleTracker
- InAppPurchaseAutoLogger
- InAppPurchaseBillingClientWrapper
- InAppPurchaseEventManager
- InAppPurchaseLoggerManager
- InAppPurchaseManager
- InAppPurchaseSkuDetailsWrapper
- InAppPurchaseUtils
- IntegrityManager
- ActivityLifecycleTracker
- AppEventUtility
- AppEventsLoggerUtility
- AutomaticAnalyticsLogger
- Constants
- FileDownloadTask
- ViewHierarchyConstants
- MTensor
- Model
- ModelManager
- Utils
- OnDeviceProcessingManager
- RemoteServiceWrapper
- RestrictiveDataManager
- SuggestedEventsManager
- ViewOnClickListener
- Core
- GateKeeper
- GateKeeperRuntimeCache
- ExceptionAnalyzer
- InstrumentData
- InstrumentManager
- InstrumentUtility
- ANRDetector
- ANRHandler
- CrashHandler
- AutoHandleExceptions
- CrashShieldHandler
- NoAutoExceptionHandling
- ErrorReportData
- ErrorReportHandler
- ThreadCheckHandler
- Excuse
- ExcusesForDesignViolations
- CertificateUtil
- OidcSecurityUtil
- DeviceLoginButton
- LoginButton
- ProfilePictureView
- ToolTipPopup
- All
public class AppEventsLogger.Companion
Field Summary
Modifier and Type | Field | Description |
---|---|---|
private final String | ACTION_APP_EVENTS_FLUSHED | |
private final String | APP_EVENTS_EXTRA_NUM_EVENTS_FLUSHED | |
private final String | APP_EVENTS_EXTRA_FLUSH_RESULT | |
public final static AppEventsLogger.Companion | INSTANCE |
Method Summary
Modifier and Type | Method | Description |
---|---|---|
final Unit | activateApp(Application application) | Notifies the events system that the app has launched and activate and deactivate events should start being logged automatically. |
final Unit | activateApp(Application application, String applicationId) | Notifies the events system that the app has launched and activate and deactivate events should start being logged automatically. |
final Unit | initializeLib(Context context, String applicationId) | Notifies the events system which internal SDK Libraries, and some specific external Libraries that the app is utilizing. |
final AppEventsLogger | newLogger(Context context) | Build an AppEventsLogger instance to log events through. |
final AppEventsLogger | newLogger(Context context, AccessToken accessToken) | Build an AppEventsLogger instance to log events through. |
final AppEventsLogger | newLogger(Context context, String applicationId, AccessToken accessToken) | Build an AppEventsLogger instance to log events through. |
final AppEventsLogger | newLogger(Context context, String applicationId) | Build an AppEventsLogger instance to log events that are attributed to the application but not to any particular Session. |
final AppEventsLogger.FlushBehavior | getFlushBehavior() | Access the behavior that AppEventsLogger uses to determine when to flush logged events to the server. |
final Unit | setFlushBehavior(AppEventsLogger.FlushBehavior flushBehavior) | Set the behavior that this AppEventsLogger uses to determine when to flush logged events to the server. |
final Unit | onContextStop() | Call this when the consuming Activity/Fragment receives an onStop() callback in order to persist any outstanding events to disk so they may be flushed at a later time. |
final Unit | setPushNotificationsRegistrationId(String registrationId) | Sets and sends registration id to register the current app for push notifications. |
final Unit | augmentWebView(WebView webView, Context context) | Intended to be used as part of a hybrid webapp. |
final String | getUserID() | Returns the set user id else null. |
final Unit | setUserID(String userID) | Sets a user id to associate with all app events. |
final Unit | clearUserID() | Clears the currently set user id. |
final Unit | setUserData(String email, String firstName, String lastName, String phone, String dateOfBirth, String gender, String city, String state, String zip, String country) | Sets user data to associate with all app events. |
final String | getUserData() | Returns the set user data else null. |
final Unit | clearUserData() | Clears the current user data |
final String | getAnonymousAppDeviceGUID(Context context) | Each app/device pair gets an GUID that is sent back with App Events and persisted with this app/device pair. |
final Unit | setInstallReferrer(String referrer) | |
final String | getACTION_APP_EVENTS_FLUSHED() | The action used to indicate that a flush of app events has occurred. |
final String | getAPP_EVENTS_EXTRA_NUM_EVENTS_FLUSHED() | |
final String | getAPP_EVENTS_EXTRA_FLUSH_RESULT() |
Method Detail
activateApp
final UnitactivateApp(Application application)
Notifies the events system that the app has launched and activate and deactivate events should start being logged automatically. By default this function is called automatically from sdkInitialize() flow. In case 'com.facebook.sdk.AutoLogAppEventsEnabled' manifest setting is set to false, it should typically be called from the OnCreate method of you application.
Parameters:
application
- The running applicationactivateApp
final UnitactivateApp(Application application, String applicationId)
Notifies the events system that the app has launched and activate and deactivate events should start being logged automatically. By default this function is called automatically from sdkInitialize() flow. In case 'com.facebook.sdk.AutoLogAppEventsEnabled' manifest setting is set to false, it should typically be called from the OnCreate method of you application.
Call this if you wish to use a different Application ID then the one specified in the Facebook SDK.
Parameters:
application
- The running applicationapplicationId
- The application id used to log activate/deactivate events.initializeLib
final UnitinitializeLib(Context context, String applicationId)
Notifies the events system which internal SDK Libraries, and some specific external Libraries that the app is utilizing. This is called internally and does NOT need to be called externally.
Parameters:
context
- The ContextapplicationId
- The String applicationIdnewLogger
final AppEventsLoggernewLogger(Context context)
Build an AppEventsLogger instance to log events through. The Facebook app that these events are targeted at comes from this application's metadata. The application ID used to log events will be determined from the app ID specified in the package metadata.
Parameters:
context
- Used to access the applicationId and the attributionId for non-authenticated users.newLogger
final AppEventsLoggernewLogger(Context context, AccessToken accessToken)
Build an AppEventsLogger instance to log events through.
Parameters:
context
- Used to access the attributionId for non-authenticated users.accessToken
- Access token to use for logging events.newLogger
final AppEventsLoggernewLogger(Context context, String applicationId, AccessToken accessToken)
Build an AppEventsLogger instance to log events through.
Parameters:
context
- Used to access the attributionId for non-authenticated users.applicationId
- Explicitly specified Facebook applicationId to log events against.accessToken
- Access token to use for logging events.newLogger
final AppEventsLoggernewLogger(Context context, String applicationId)
Build an AppEventsLogger instance to log events that are attributed to the application but not to any particular Session.
Parameters:
context
- Used to access the attributionId for non-authenticated users.applicationId
- Explicitly specified Facebook applicationId to log events against.getFlushBehavior
final AppEventsLogger.FlushBehaviorgetFlushBehavior()
Access the behavior that AppEventsLogger uses to determine when to flush logged events to the server. This setting applies to all instances of AppEventsLogger.
setFlushBehavior
final UnitsetFlushBehavior(AppEventsLogger.FlushBehavior flushBehavior)
Set the behavior that this AppEventsLogger uses to determine when to flush logged events to the server. This setting applies to all instances of AppEventsLogger.
Parameters:
flushBehavior
- the desired behavior.onContextStop
final UnitonContextStop()
Call this when the consuming Activity/Fragment receives an onStop() callback in order to persist any outstanding events to disk so they may be flushed at a later time. The next flush (explicit or not) will check for any outstanding events and if present, include them in that flush. Note that this call may trigger an I/O operation on the calling thread. Explicit use of this method is necessary.
setPushNotificationsRegistrationId
final UnitsetPushNotificationsRegistrationId(String registrationId)
Sets and sends registration id to register the current app for push notifications.
Parameters:
registrationId
- RegistrationId received from FCM.augmentWebView
final UnitaugmentWebView(WebView webView, Context context)
Intended to be used as part of a hybrid webapp. If you call this method, the FB SDK will add a new JavaScript interface into your webview. If the FB Pixel is used within the webview, and references the app ID of this app, then it will detect the presence of this injected JavaScript object and pass Pixel events back to the FB SDK for logging using the AppEvents framework.
Parameters:
webView
- The webview to augment with the additional JavaScript behaviourcontext
- Used to access the applicationId and the attributionId for non-authenticated users.setUserID
final UnitsetUserID(String userID)
Sets a user id to associate with all app events. This can be used to associate your own user id with the app events logged from this instance of an application.
The user ID will be persisted between application instances.
Parameters:
userID
- A User ID, or null to clear the User IDsetUserData
final UnitsetUserData(String email, String firstName, String lastName, String phone, String dateOfBirth, String gender, String city, String state, String zip, String country)
Sets user data to associate with all app events. All user data are hashed and used to match Facebook user from this instance of an application.
The user data will be persisted between application instances.
Parameters:
email
- user's emailfirstName
- user's first namelastName
- user's last namephone
- user's phonedateOfBirth
- user's date of birthgender
- user's gendercity
- user's citystate
- user's statezip
- user's zipcountry
- user's countrygetAnonymousAppDeviceGUID
final StringgetAnonymousAppDeviceGUID(Context context)
Each app/device pair gets an GUID that is sent back with App Events and persisted with this app/device pair.
Parameters:
context
- The application context.setInstallReferrer
final UnitsetInstallReferrer(String referrer)
getACTION_APP_EVENTS_FLUSHED
final StringgetACTION_APP_EVENTS_FLUSHED()
The action used to indicate that a flush of app events has occurred. This should be used as an action in an IntentFilter and BroadcastReceiver registered with the [ ].
getAPP_EVENTS_EXTRA_NUM_EVENTS_FLUSHED
final StringgetAPP_EVENTS_EXTRA_NUM_EVENTS_FLUSHED()
getAPP_EVENTS_EXTRA_FLUSH_RESULT
final StringgetAPP_EVENTS_EXTRA_FLUSH_RESULT()