Java Code Examples for cn.sharesdk.framework.Platform#showUser()

The following examples show how to use cn.sharesdk.framework.Platform#showUser() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LevelTop.java    From AndroidLinkup with GNU General Public License v2.0 6 votes vote down vote up
private void authorize(Platform plat) {
    try {
        // 先清除缓存账户
        // plat.getDb().removeAccount();

        if (plat.isValid()) {
            String userId = plat.getDb().getUserId();
            if (!TextUtils.isEmpty(userId)) {
                login(plat);
                return;
            }
        }
        plat.setPlatformActionListener(this);
        plat.SSOSetting(true);
        plat.showUser(null);
    } catch (Exception ex) {
        Log.d("LevelTop-authorize", ex.getMessage());
    }
}
 
Example 2
Source File: LoginActivity.java    From xmpp with Apache License 2.0 5 votes vote down vote up
/**
 * 新浪微博登录
 */
private void weibo_login() {
    Platform weibo = ShareSDK.getPlatform(SinaWeibo.NAME);
    if (weibo.isValid()) {
        weibo.removeAccount();
    }

    weibo.setPlatformActionListener(this); // 设置分享事件回调
    weibo.SSOSetting(true); // 设置false表示使用SSO授权方式
    // weibo.authorize();
    weibo.showUser(null);

}
 
Example 3
Source File: LoginActivity.java    From xmpp with Apache License 2.0 5 votes vote down vote up
/**
 * QQ登录
 */
private void qq_login() {
    Platform weibo = ShareSDK.getPlatform(QQ.NAME);
    if (weibo.isValid()) {
        weibo.removeAccount();//删除前一次的授权信息
    }

    weibo.setPlatformActionListener(this); // 设置分享事件回调

    // 设置false表示使用SSO授权方式,意思就是如果有QQ就直接跳到QQ授权,如果没有就跳到网页
    weibo.SSOSetting(false);


    weibo.showUser(null);
}
 
Example 4
Source File: DoLogin.java    From BigApp_Discuz_Android with Apache License 2.0 5 votes vote down vote up
/**
 * 第三方登录 发起
 *
 * @param context
 * @param platStr
 * @param callback
 */
public static void authorize(final FragmentActivity context, String platStr, Handler.Callback callback, InjectDo injectDo) {
    Platform plat = ShareSDK.getPlatform(context, platStr);
    ZogUtils.printError(LoginActivity.class, "authorize plat.getName():" + plat.getName());
    ZogUtils.printError(LoginActivity.class, "authorize plat.isValid():" + plat.isValid());

    if (plat.isValid()) {
        platformLogin(context, platStr, callback, injectDo);
    } else {
        LoginPlatformActionListener loginPlatformActionListener = new LoginPlatformActionListener(context, callback);
        plat.setPlatformActionListener(loginPlatformActionListener);
        plat.SSOSetting(true);
        plat.showUser(null);
    }
}
 
Example 5
Source File: PlatformAuthorizeUserInfoManager.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
/**
 * 用户信息的代码
 */
public void doUserInfo(Platform platform, Activity activity) {
	if (platform != null) {
		ShareSDK.setActivity(activity);
		platform.showUser(null);
	}
}
 
Example 6
Source File: PlatformAuthorizeUserInfoManager.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
/**
 * 用户信息的代码
 */
public void doUserInfo(Platform platform, PlatformActionListener listener) {
	if (platform != null) {
		platform.setPlatformActionListener(listener);
		platform.showUser(null);
	}
}
 
Example 7
Source File: PlatformAuthorizeUserInfoManager.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
/**
 * 用户信息的代码
 */
public void doUserInfo(Platform platform, String account, PlatformActionListener listener) {
	if (platform != null) {
		platform.setPlatformActionListener(listener);
		platform.showUser(account);
	}
}
 
Example 8
Source File: SdkTagsMainActivity.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
private void Sina() {
    ShareSDK.setEnableAuthTag(true);
    Platform plat = ShareSDK.getPlatform("SinaWeibo");
    plat.removeAccount(true);
    //plat.SSOSetting(false);
    plat.setPlatformActionListener(this);
    if (plat.isClientValid()) {

    }
    if (plat.isAuthValid()) {

    }
    //plat.authorize();	//要功能,不要数据
    plat.showUser(null);    //要数据不要功能,主要体现在不会重复出现授权界面
}
 
Example 9
Source File: SdkTagsMainActivity.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
private void WeChat() {
    Platform plat = ShareSDK.getPlatform(Wechat.NAME);
    ShareSDK.setEnableAuthTag(true);
    plat.removeAccount(true);
    //plat.SSOSetting(false);
    plat.setPlatformActionListener(this);
    if (plat.isClientValid()) {

    }
    if (plat.isAuthValid()) {

    }
    //plat.authorize();	//要功能,不要数据
    plat.showUser(null);    //要数据不要功能,主要体现在不会重复出现授权界面
}
 
Example 10
Source File: ThirdPartyLogin.java    From ThirdPartyLoginDemo with MIT License 5 votes vote down vote up
private void authorize(Platform plat) {
	if (plat == null) {
		popupOthers();
		return;
	}
	
	plat.setPlatformActionListener(this);
	//关闭SSO授权
	plat.SSOSetting(true);
	plat.showUser(null);
}
 
Example 11
Source File: PlatformAuthorizeUserInfoManager.java    From ShareSDK-for-Android with MIT License 4 votes vote down vote up
/**
 * 用户信息的代码
 */
public void doUserInfo(Platform platform, String account) {
	if (platform != null) {
		platform.showUser(account);
	}
}