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();
}
}
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);
}
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);
}
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);
}
Aggregations