Java 类com.facebook.SessionDefaultAudience 实例源码

项目:BrillaMXAndroid    文件:NativeProtocol.java   
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;
}
项目:TP-Formation-Android    文件:NativeProtocol.java   
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;
}
项目:AutoTimeHelper    文件:NativeProtocol.java   
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;
}
项目:BrainStudio    文件:NativeProtocol.java   
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;
}
项目:Qtino.SharingKit    文件:NativeProtocol.java   
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;
}
项目:smartenit    文件:NativeProtocol.java   
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;
}
项目:DualRunner    文件:NativeProtocol.java   
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;
}
项目:DualRunner    文件:FBLogin.java   
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;
}
项目:DualRunner    文件:FBLogin.java   
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;
}
项目:MeNextAndroid    文件:NativeProtocol.java   
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;
}
项目:ClassParticipation2    文件:NativeProtocol.java   
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;
}
项目:LostAndFound    文件:UserSettingsFragmentTests.java   
@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));
}
项目:LostAndFound    文件:UserSettingsFragmentTests.java   
@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);
}
项目:PetTinder    文件:NativeProtocol.java   
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;
}
项目:StoryTeller    文件:NativeProtocol.java   
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;
}
项目:HereAStory-Android    文件:NativeProtocol.java   
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;
}
项目:FacebookImageShareIntent    文件:UserSettingsFragmentTests.java   
@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));
}
项目:FacebookImageShareIntent    文件:UserSettingsFragmentTests.java   
@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);
}
项目:Abelana-Android    文件:NativeProtocol.java   
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;
}
项目:localhost-android    文件:NativeProtocol.java   
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;
}
项目:facebook-android-sdk    文件:UserSettingsFragmentTests.java   
@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));
}
项目:facebook-android-sdk    文件:UserSettingsFragmentTests.java   
@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);
}
项目:facebook-api-android-maven    文件:NativeProtocol.java   
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;
}
项目:yelo-android    文件:LoginButton.java   
public void setDefaultAudience(SessionDefaultAudience defaultAudience) {
    this.defaultAudience = defaultAudience;
}
项目:yelo-android    文件:LoginButton.java   
public SessionDefaultAudience getDefaultAudience() {
    return defaultAudience;
}
项目:QuizUpWinner    文件:LoginButton.java   
public SessionDefaultAudience getDefaultAudience()
{
  return this.properties.getDefaultAudience();
}
项目:QuizUpWinner    文件:LoginButton.java   
public void setDefaultAudience(SessionDefaultAudience paramSessionDefaultAudience)
{
  this.properties.setDefaultAudience(paramSessionDefaultAudience);
}
项目:QuizUpWinner    文件:LoginButton.java   
public SessionDefaultAudience getDefaultAudience()
{
  return this.defaultAudience;
}
项目:QuizUpWinner    文件:LoginButton.java   
public void setDefaultAudience(SessionDefaultAudience paramSessionDefaultAudience)
{
  this.defaultAudience = paramSessionDefaultAudience;
}
项目:QuizUpWinner    文件:UserSettingsFragment.java   
public SessionDefaultAudience getDefaultAudience()
{
  return this.loginButtonProperties.getDefaultAudience();
}
项目:QuizUpWinner    文件:UserSettingsFragment.java   
public void setDefaultAudience(SessionDefaultAudience paramSessionDefaultAudience)
{
  this.loginButtonProperties.setDefaultAudience(paramSessionDefaultAudience);
}
项目:p2psafety    文件:LoginButton.java   
public void setDefaultAudience(SessionDefaultAudience defaultAudience) {
    this.defaultAudience = defaultAudience;
}
项目:p2psafety    文件:LoginButton.java   
public SessionDefaultAudience getDefaultAudience() {
    return defaultAudience;
}
项目:Klyph    文件:LoginButton.java   
public void setDefaultAudience(SessionDefaultAudience defaultAudience) {
    this.defaultAudience = defaultAudience;
}
项目:Klyph    文件:LoginButton.java   
public SessionDefaultAudience getDefaultAudience() {
    return defaultAudience;
}
项目:KlyphMessenger    文件:LoginButton.java   
public void setDefaultAudience(SessionDefaultAudience defaultAudience) {
    this.defaultAudience = defaultAudience;
}
项目:KlyphMessenger    文件:LoginButton.java   
public SessionDefaultAudience getDefaultAudience() {
    return defaultAudience;
}
项目:yelo-android    文件:LoginButton.java   
/**
 * 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) {
    properties.setDefaultAudience(defaultAudience);
}
项目:yelo-android    文件:LoginButton.java   
/**
 * Gets the default audience to use when the session is opened.
 * This value is only useful when specifying write permissions for the native
 * login dialog.
 *
 * @return the default audience value to use
 */
public SessionDefaultAudience getDefaultAudience() {
    return properties.getDefaultAudience();
}
项目:yelo-android    文件:UserSettingsFragment.java   
/**
 * 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);
}