Search in sources :

Example 1 with DialogFeature

use of com.facebook.internal.DialogFeature 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)

Aggregations

Bundle (android.os.Bundle)1 AppEventsLogger (com.facebook.appevents.AppEventsLogger)1 DialogFeature (com.facebook.internal.DialogFeature)1 OpenGraphActionDialogFeature (com.facebook.share.internal.OpenGraphActionDialogFeature)1 ShareDialogFeature (com.facebook.share.internal.ShareDialogFeature)1