Search in sources :

Example 11 with AppEventsLogger

use of com.facebook.appevents.AppEventsLogger in project facebook-android-sdk by facebook.

the class DeviceAuthDialog method setCurrentRequestState.

private void setCurrentRequestState(RequestState currentRequestState) {
    this.currentRequestState = currentRequestState;
    confirmationCode.setText(currentRequestState.getUserCode());
    confirmationCode.setVisibility(View.VISIBLE);
    progressBar.setVisibility(View.GONE);
    if (!isRetry) {
        if (DeviceRequestsHelper.startAdvertisementService(currentRequestState.getUserCode())) {
            final AppEventsLogger logger = AppEventsLogger.newLogger(getContext());
            logger.logSdkEvent(AnalyticsEvents.EVENT_SMART_LOGIN_SERVICE, null, null);
        }
    }
    // If we polled within the last interval schedule a poll else start a poll.
    if (currentRequestState.withinLastRefreshWindow()) {
        schedulePoll();
    } else {
        poll();
    }
}
Also used : AppEventsLogger(com.facebook.appevents.AppEventsLogger)

Example 12 with AppEventsLogger

use of com.facebook.appevents.AppEventsLogger in project facebook-android-sdk by facebook.

the class ShareDialog method logDialogShare.

private void logDialogShare(Context context, ShareContent content, Mode mode) {
    String displayType;
    if (isAutomaticMode) {
        mode = Mode.AUTOMATIC;
    }
    switch(mode) {
        case AUTOMATIC:
            displayType = AnalyticsEvents.PARAMETER_SHARE_DIALOG_SHOW_AUTOMATIC;
            break;
        case WEB:
            displayType = AnalyticsEvents.PARAMETER_SHARE_DIALOG_SHOW_WEB;
            break;
        case NATIVE:
            displayType = AnalyticsEvents.PARAMETER_SHARE_DIALOG_SHOW_NATIVE;
            break;
        default:
            displayType = AnalyticsEvents.PARAMETER_SHARE_DIALOG_SHOW_UNKNOWN;
            break;
    }
    String contentType;
    DialogFeature dialogFeature = getFeature(content.getClass());
    if (dialogFeature == ShareDialogFeature.SHARE_DIALOG) {
        contentType = AnalyticsEvents.PARAMETER_SHARE_DIALOG_CONTENT_STATUS;
    } else if (dialogFeature == ShareDialogFeature.PHOTOS) {
        contentType = AnalyticsEvents.PARAMETER_SHARE_DIALOG_CONTENT_PHOTO;
    } else if (dialogFeature == ShareDialogFeature.VIDEO) {
        contentType = AnalyticsEvents.PARAMETER_SHARE_DIALOG_CONTENT_VIDEO;
    } else if (dialogFeature == OpenGraphActionDialogFeature.OG_ACTION_DIALOG) {
        contentType = AnalyticsEvents.PARAMETER_SHARE_DIALOG_CONTENT_OPENGRAPH;
    } else {
        contentType = AnalyticsEvents.PARAMETER_SHARE_DIALOG_CONTENT_UNKNOWN;
    }
    AppEventsLogger logger = AppEventsLogger.newLogger(context);
    Bundle parameters = new Bundle();
    parameters.putString(AnalyticsEvents.PARAMETER_SHARE_DIALOG_SHOW, displayType);
    parameters.putString(AnalyticsEvents.PARAMETER_SHARE_DIALOG_CONTENT_TYPE, contentType);
    logger.logSdkEvent(AnalyticsEvents.EVENT_SHARE_DIALOG_SHOW, null, parameters);
}
Also used : DialogFeature(com.facebook.internal.DialogFeature) OpenGraphActionDialogFeature(com.facebook.share.internal.OpenGraphActionDialogFeature) ShareDialogFeature(com.facebook.share.internal.ShareDialogFeature) Bundle(android.os.Bundle) AppEventsLogger(com.facebook.appevents.AppEventsLogger)

Example 13 with AppEventsLogger

use of com.facebook.appevents.AppEventsLogger in project facebook-android-sdk by facebook.

the class FacebookButtonBase method logButtonTapped.

private void logButtonTapped(final Context context) {
    AppEventsLogger logger = AppEventsLogger.newLogger(context);
    logger.logSdkEvent(analyticsButtonTappedEventName, null, null);
}
Also used : AppEventsLogger(com.facebook.appevents.AppEventsLogger)

Example 14 with AppEventsLogger

use of com.facebook.appevents.AppEventsLogger in project facebook-android-sdk by facebook.

the class FriendPickerFragment method logAppEvents.

@Override
void logAppEvents(boolean doneButtonClicked) {
    AppEventsLogger logger = AppEventsLogger.newLogger(this.getActivity(), AccessToken.getCurrentAccessToken().getToken());
    Bundle parameters = new Bundle();
    // If Done was clicked, we know this completed successfully. If not, we don't know (caller might have
    // dismissed us in response to selection changing, or user might have hit back button). Either way
    // we'll log the number of selections.
    String outcome = doneButtonClicked ? AnalyticsEvents.PARAMETER_DIALOG_OUTCOME_VALUE_COMPLETED : AnalyticsEvents.PARAMETER_DIALOG_OUTCOME_VALUE_UNKNOWN;
    parameters.putString(AnalyticsEvents.PARAMETER_DIALOG_OUTCOME, outcome);
    parameters.putInt("num_friends_picked", getSelection().size());
    logger.logSdkEvent(AnalyticsEvents.EVENT_FRIEND_PICKER_USAGE, null, parameters);
}
Also used : Bundle(android.os.Bundle) AppEventsLogger(com.facebook.appevents.AppEventsLogger)

Aggregations

AppEventsLogger (com.facebook.appevents.AppEventsLogger)14 Bundle (android.os.Bundle)10 Context (android.content.Context)2 IntentFilter (android.content.IntentFilter)2 LocalBroadcastManager (android.support.v4.content.LocalBroadcastManager)2 AccessToken (com.facebook.AccessToken)2 WaitForBroadcastReceiver (com.facebook.WaitForBroadcastReceiver)2 DialogFeature (com.facebook.internal.DialogFeature)1 FetchedAppSettings (com.facebook.internal.FetchedAppSettings)1 OpenGraphActionDialogFeature (com.facebook.share.internal.OpenGraphActionDialogFeature)1 ShareDialogFeature (com.facebook.share.internal.ShareDialogFeature)1