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


Java SessionDefaultAudience类代码示例

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


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

示例1: createProxyAuthIntent

import com.facebook.SessionDefaultAudience; //导入依赖的package包/类
public static Intent createProxyAuthIntent(Context context, String applicationId, List<String> permissions,
        String e2e, boolean isRerequest, SessionDefaultAudience defaultAudience) {
    for (NativeAppInfo appInfo : facebookAppInfoList) {
        Intent intent = new Intent()
                .setClassName(appInfo.getPackage(), FACEBOOK_PROXY_AUTH_ACTIVITY)
                .putExtra(FACEBOOK_PROXY_AUTH_APP_ID_KEY, applicationId);

        if (!Utility.isNullOrEmpty(permissions)) {
            intent.putExtra(FACEBOOK_PROXY_AUTH_PERMISSIONS_KEY, TextUtils.join(",", permissions));
        }
        if (!Utility.isNullOrEmpty(e2e)) {
            intent.putExtra(FACEBOOK_PROXY_AUTH_E2E_KEY, e2e);
        }

        intent.putExtra(ServerProtocol.DIALOG_PARAM_RESPONSE_TYPE, ServerProtocol.DIALOG_RESPONSE_TYPE_TOKEN);
        intent.putExtra(ServerProtocol.DIALOG_PARAM_RETURN_SCOPES, ServerProtocol.DIALOG_RETURN_SCOPES_TRUE);
        intent.putExtra(ServerProtocol.DIALOG_PARAM_DEFAULT_AUDIENCE, defaultAudience.getNativeProtocolAudience());

        if (!Settings.getPlatformCompatibilityEnabled()) {
            // Override the API Version for Auth
            intent.putExtra(ServerProtocol.DIALOG_PARAM_LEGACY_OVERRIDE, ServerProtocol.GRAPH_API_VERSION);

            // Only set the rerequest auth type for non legacy requests
            if (isRerequest) {
                intent.putExtra(ServerProtocol.DIALOG_PARAM_AUTH_TYPE, ServerProtocol.DIALOG_REREQUEST_AUTH_TYPE);
            }
        }

        intent = validateActivityIntent(context, intent, appInfo);

        if (intent != null) {
            return intent;
        }
    }
    return null;
}
 
开发者ID:dannegm,项目名称:BrillaMXAndroid,代码行数:37,代码来源:NativeProtocol.java

示例2: getOpenRequest

import com.facebook.SessionDefaultAudience; //导入依赖的package包/类
private static OpenRequest getOpenRequest(StatusCallback callback, List<String> permissions, Activity activity) {
    OpenRequest req = new OpenRequest(activity);
    req.setCallback(callback);
    req.setPermissions(permissions);
    req.setDefaultAudience(SessionDefaultAudience.FRIENDS);

    return req;
}
 
开发者ID:stevesolomon,项目名称:DualRunner,代码行数:9,代码来源:FBLogin.java

示例3: getNewPermissionsRequest

import com.facebook.SessionDefaultAudience; //导入依赖的package包/类
private static Session.NewPermissionsRequest getNewPermissionsRequest(Session session, StatusCallback callback, List<String> permissions, Activity activity) {
    Session.NewPermissionsRequest req = new Session.NewPermissionsRequest(activity, permissions);
    req.setCallback(callback);
    // This should really be "req.setCallback(callback);"
    // Unfortunately the current underlying SDK won't add the callback when you do it that way
    // TODO: when upgrading to the latest see if this can be "req.setCallback(callback);"
    // if it still doesn't have it, file a bug!
    session.addCallback(callback);
    req.setDefaultAudience(SessionDefaultAudience.FRIENDS);
    return req;
}
 
开发者ID:stevesolomon,项目名称:DualRunner,代码行数:12,代码来源:FBLogin.java

示例4: testCanSetParametersViaLayout

import com.facebook.SessionDefaultAudience; //导入依赖的package包/类
@MediumTest
@LargeTest
public void testCanSetParametersViaLayout() throws Throwable {
    TestActivity activity = getActivity();
    assertNotNull(activity);

    final UserSettingsFragment fragment = activity.getFragment();
    assertNotNull(fragment);

    assertEquals(SessionLoginBehavior.SUPPRESS_SSO, fragment.getLoginBehavior());
    assertEquals(SessionDefaultAudience.EVERYONE, fragment.getDefaultAudience());
    List<String> permissions = fragment.getPermissions();
    assertEquals(2, permissions.size());
    assertEquals("read_1", permissions.get(0));
}
 
开发者ID:kodamirmo,项目名称:LostAndFound,代码行数:16,代码来源:UserSettingsFragmentTests.java

示例5: onCreate

import com.facebook.SessionDefaultAudience; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getSupportFragmentManager().executePendingTransactions();
    UserSettingsFragment fragment = getFragment();
    fragment.setLoginBehavior(SessionLoginBehavior.SUPPRESS_SSO);
    fragment.setReadPermissions("read_1", "read_2");
    fragment.setDefaultAudience(SessionDefaultAudience.EVERYONE);
}
 
开发者ID:kodamirmo,项目名称:LostAndFound,代码行数:10,代码来源:UserSettingsFragmentTests.java

示例6: onCreate

import com.facebook.SessionDefaultAudience; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getSupportFragmentManager().executePendingTransactions();
    UserSettingsFragment fragment = getFragment();
    fragment.setLoginBehavior(SessionLoginBehavior.SUPPRESS_SSO);
    fragment.setReadPermissions(Arrays.asList("read_1", "read_2"));
    fragment.setDefaultAudience(SessionDefaultAudience.EVERYONE);
}
 
开发者ID:GrioSF,项目名称:facebook-android-sdk,代码行数:10,代码来源:UserSettingsFragmentTests.java

示例7: setDefaultAudience

import com.facebook.SessionDefaultAudience; //导入依赖的package包/类
public void setDefaultAudience(SessionDefaultAudience defaultAudience) {
    this.defaultAudience = defaultAudience;
}
 
开发者ID:yeloapp,项目名称:yelo-android,代码行数:4,代码来源:LoginButton.java

示例8: getDefaultAudience

import com.facebook.SessionDefaultAudience; //导入依赖的package包/类
public SessionDefaultAudience getDefaultAudience() {
    return defaultAudience;
}
 
开发者ID:yeloapp,项目名称:yelo-android,代码行数:4,代码来源:LoginButton.java

示例9: getDefaultAudience

import com.facebook.SessionDefaultAudience; //导入依赖的package包/类
public SessionDefaultAudience getDefaultAudience()
{
  return this.properties.getDefaultAudience();
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:5,代码来源:LoginButton.java

示例10: setDefaultAudience

import com.facebook.SessionDefaultAudience; //导入依赖的package包/类
public void setDefaultAudience(SessionDefaultAudience paramSessionDefaultAudience)
{
  this.properties.setDefaultAudience(paramSessionDefaultAudience);
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:5,代码来源:LoginButton.java

示例11: getDefaultAudience

import com.facebook.SessionDefaultAudience; //导入依赖的package包/类
public SessionDefaultAudience getDefaultAudience()
{
  return this.loginButtonProperties.getDefaultAudience();
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:5,代码来源:UserSettingsFragment.java

示例12: setDefaultAudience

import com.facebook.SessionDefaultAudience; //导入依赖的package包/类
public void setDefaultAudience(SessionDefaultAudience paramSessionDefaultAudience)
{
  this.loginButtonProperties.setDefaultAudience(paramSessionDefaultAudience);
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:5,代码来源:UserSettingsFragment.java

示例13: setDefaultAudience

import com.facebook.SessionDefaultAudience; //导入依赖的package包/类
/**
 * Sets the default audience to use when the session is opened.
 * This value is only useful when specifying write permissions for the native
 * login dialog.
 *
 * @param defaultAudience the default audience value to use
 */
public void setDefaultAudience(SessionDefaultAudience defaultAudience) {
    loginButtonProperties.setDefaultAudience(defaultAudience);
}
 
开发者ID:yeloapp,项目名称:yelo-android,代码行数:11,代码来源:UserSettingsFragment.java


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