当前位置: 首页>>代码示例>>Java>>正文


Java OpenGraphActionDialogFeature类代码示例

本文整理汇总了Java中com.facebook.share.internal.OpenGraphActionDialogFeature的典型用法代码示例。如果您正苦于以下问题:Java OpenGraphActionDialogFeature类的具体用法?Java OpenGraphActionDialogFeature怎么用?Java OpenGraphActionDialogFeature使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


OpenGraphActionDialogFeature类属于com.facebook.share.internal包,在下文中一共展示了OpenGraphActionDialogFeature类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getFeature

import com.facebook.share.internal.OpenGraphActionDialogFeature; //导入依赖的package包/类
private static DialogFeature getFeature(
        Class<? extends ShareContent> contentType) {
    if (ShareLinkContent.class.isAssignableFrom(contentType)) {
        return ShareDialogFeature.SHARE_DIALOG;
    } else if (SharePhotoContent.class.isAssignableFrom(contentType)) {
        return ShareDialogFeature.PHOTOS;
    } else if (ShareVideoContent.class.isAssignableFrom(contentType)) {
        return ShareDialogFeature.VIDEO;
    } else if (ShareOpenGraphContent.class.isAssignableFrom(contentType)) {
        return OpenGraphActionDialogFeature.OG_ACTION_DIALOG;
    }
    return null;
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:14,代码来源:ShareDialog.java

示例2: logDialogShare

import com.facebook.share.internal.OpenGraphActionDialogFeature; //导入依赖的package包/类
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);
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:48,代码来源:ShareDialog.java


注:本文中的com.facebook.share.internal.OpenGraphActionDialogFeature类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。