Java Code Examples for cn.sharesdk.framework.Platform#SSOSetting

The following examples show how to use cn.sharesdk.framework.Platform#SSOSetting . 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: OnekeyShareThemeImpl.java    From YiZhi with Apache License 2.0 6 votes vote down vote up
final void shareSilently(Platform platform) {
	if (formateShareData(platform)) {
		ShareParams sp = shareDataToShareParams(platform);
		if (sp != null) {
			toast("ssdk_oks_sharing");
			if (customizeCallback != null) {
				customizeCallback.onShare(platform, sp);
			}
			if (disableSSO) {
				platform.SSOSetting(disableSSO);
			}
			platform.setPlatformActionListener(callback);
			platform.share(sp);
		}
	}
}
 
Example 2
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 3
Source File: OnekeyShareThemeImpl.java    From HHComicViewer with Apache License 2.0 6 votes vote down vote up
final void shareSilently(Platform platform) {
	if (formateShareData(platform)) {
		ShareParams sp = shareDataToShareParams(platform);
		if (sp != null) {
			toast("ssdk_oks_sharing");
			if (customizeCallback != null) {
				customizeCallback.onShare(platform, sp);
			}
			if (disableSSO) {
				platform.SSOSetting(disableSSO);
			}
			platform.setPlatformActionListener(callback);
			platform.share(sp);
		}
	}
}
 
Example 4
Source File: OnekeyShareThemeImpl.java    From fingerpoetry-android with Apache License 2.0 6 votes vote down vote up
final void shareSilently(Platform platform) {
	if (formateShareData(platform)) {
		ShareParams sp = shareDataToShareParams(platform);
		if (sp != null) {
			toast("ssdk_oks_sharing");
			if (customizeCallback != null) {
				customizeCallback.onShare(platform, sp);
			}
			if (disableSSO) {
				platform.SSOSetting(disableSSO);
			}
			platform.setPlatformActionListener(callback);
			platform.share(sp);
		}
	}
}
 
Example 5
Source File: OnekeyShareThemeImpl.java    From GithubApp with Apache License 2.0 6 votes vote down vote up
final void shareSilently(Platform platform) {
	if (formateShareData(platform)) {
		ShareParams sp = shareDataToShareParams(platform);
		if (sp != null) {
			toast("ssdk_oks_sharing");
			if (customizeCallback != null) {
				customizeCallback.onShare(platform, sp);
			}
			if (disableSSO) {
				platform.SSOSetting(disableSSO);
			}
			platform.setPlatformActionListener(callback);
			platform.share(sp);
		}
	}
}
 
Example 6
Source File: OnekeyShareThemeImpl.java    From MyHearts with Apache License 2.0 6 votes vote down vote up
final void shareSilently(Platform platform) {
	if (formateShareData(platform)) {
		ShareParams sp = shareDataToShareParams(platform);
		if (sp != null) {
			toast("ssdk_oks_sharing");
			if (customizeCallback != null) {
				customizeCallback.onShare(platform, sp);
			}
			if (disableSSO) {
				platform.SSOSetting(disableSSO);
			}
			platform.setPlatformActionListener(callback);
			platform.share(sp);
		}
	}
}
 
Example 7
Source File: ShareItemClickListener.java    From BigApp_Discuz_Android with Apache License 2.0 6 votes vote down vote up
private void doShare(String platformName) {

//        shareParams.setImageUrl("http://mobfile.youzu.com/show/Uploads_image/2/e/a/d/eadf1eda9529216516c1af5a5dd3fa5f_1024_1024.png");
//        shareParams.setText("bdjdhdhdhhdjdjdj");
//        shareParams.setTitle("hdjdbdj");
//        shareParams.setUrl("http://192.168.180.23:8080/luyi3.2gbk/forum.php?mod=viewthread&tid=1");

//        ZogUtils.printError(ShareItemClickListener.class, "title:::" + shareParams.getTitle() + "\ntext:::" + shareParams.getText());

        ZogUtils.printError(ShareItemClickListener.class, "do doShare:" + JsonUtils.toJSON(shareParams).toString());

        Platform plat = ShareSDK.getPlatform(context, platformName);
        plat.SSOSetting(true);
        if (platformActionListener != null) {
            plat.setPlatformActionListener(platformActionListener);
        }
        plat.share(shareParams);


//        plat.setPlatformActionListener(platformActionListener);
//        ShareCore shareCore = new ShareCore();
////        shareCore.setShareContentCustomizeCallback(customizeCallback);
//        shareCore.share(plat, data);
    }
 
Example 8
Source File: OnekeyShareThemeImpl.java    From BaoKanAndroid with MIT License 6 votes vote down vote up
final void shareSilently(Platform platform) {
	if (formateShareData(platform)) {
		ShareParams sp = shareDataToShareParams(platform);
		if (sp != null) {
			toast("ssdk_oks_sharing");
			if (customizeCallback != null) {
				customizeCallback.onShare(platform, sp);
			}
			if (disableSSO) {
				platform.SSOSetting(disableSSO);
			}
			platform.setPlatformActionListener(callback);
			platform.share(sp);
		}
	}
}
 
Example 9
Source File: OnekeyShareThemeImpl.java    From LQRWeChat with MIT License 6 votes vote down vote up
final void shareSilently(Platform platform) {
	if (formateShareData(platform)) {
		ShareParams sp = shareDataToShareParams(platform);
		if (sp != null) {
			toast("ssdk_oks_sharing");
			if (customizeCallback != null) {
				customizeCallback.onShare(platform, sp);
			}
			if (disableSSO) {
				platform.SSOSetting(disableSSO);
			}
			platform.setPlatformActionListener(callback);
			platform.share(sp);
		}
	}
}
 
Example 10
Source File: OnekeyShareThemeImpl.java    From Mobike with Apache License 2.0 6 votes vote down vote up
final void shareSilently(Platform platform) {
	if (formateShareData(platform)) {
		ShareParams sp = shareDataToShareParams(platform);
		if (sp != null) {
			toast("ssdk_oks_sharing");
			if (customizeCallback != null) {
				customizeCallback.onShare(platform, sp);
			}
			if (disableSSO) {
				platform.SSOSetting(disableSSO);
			}
			platform.setPlatformActionListener(callback);
			platform.share(sp);
		}
	}
}
 
Example 11
Source File: OnekeyShareThemeImpl.java    From Social with Apache License 2.0 6 votes vote down vote up
final void shareSilently(Platform platform) {
	if (formateShareData(platform)) {
		ShareParams sp = shareDataToShareParams(platform);
		if (sp != null) {
			toast("ssdk_oks_sharing");
			if (customizeCallback != null) {
				customizeCallback.onShare(platform, sp);
			}
			if (disableSSO) {
				platform.SSOSetting(disableSSO);
			}
			platform.setPlatformActionListener(callback);
			platform.share(sp);
		}
	}
}
 
Example 12
Source File: OnekeyShareThemeImpl.java    From LiuAGeAndroid with MIT License 6 votes vote down vote up
final void shareSilently(Platform platform) {
	if (formateShareData(platform)) {
		ShareParams sp = shareDataToShareParams(platform);
		if (sp != null) {
			toast("ssdk_oks_sharing");
			if (customizeCallback != null) {
				customizeCallback.onShare(platform, sp);
			}
			if (disableSSO) {
				platform.SSOSetting(disableSSO);
			}
			platform.setPlatformActionListener(callback);
			platform.share(sp);
		}
	}
}
 
Example 13
Source File: OnekeyShareThemeImpl.java    From enjoyshop with Apache License 2.0 6 votes vote down vote up
final void shareSilently(Platform platform) {
	if (formateShareData(platform)) {
		ShareParams sp = shareDataToShareParams(platform);
		if (sp != null) {
			toast("ssdk_oks_sharing");
			if (customizeCallback != null) {
				customizeCallback.onShare(platform, sp);
			}
			if (disableSSO) {
				platform.SSOSetting(disableSSO);
			}
			platform.setPlatformActionListener(callback);
			platform.share(sp);
		}
	}
}
 
Example 14
Source File: OnekeyShareThemeImpl.java    From POCenter with MIT License 6 votes vote down vote up
final void shareSilently(Platform platform) {
	if (formateShareData(platform)) {
		ShareParams sp = shareDataToShareParams(platform);
		if (sp != null) {
			toast("ssdk_oks_sharing");
			if (customizeCallback != null) {
				customizeCallback.onShare(platform, sp);
			}
			if (disableSSO) {
				platform.SSOSetting(disableSSO);
			}
			platform.setPlatformActionListener(callback);
			platform.share(sp);
		}
	}
}
 
Example 15
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 16
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 17
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 18
Source File: DialogShare.java    From BigApp_WordPress_Android with Apache License 2.0 5 votes vote down vote up
private void doShare(String platformName, Platform.ShareParams sp, boolean ssoSetting) {
        sp.setShareType(Platform.SHARE_TEXT);
        sp.setShareType(Platform.SHARE_WEBPAGE);
        ShareSDK.initSDK(mContext);
        Platform plat = ShareSDK.getPlatform(mContext, platformName);
        plat.SSOSetting(ssoSetting);
        if (platformActionListener != null) {
            plat.setPlatformActionListener(platformActionListener);
        }
        plat.share(sp);
//        ShareCore shareCore = new ShareCore();
//        shareCore.setShareContentCustomizeCallback(customizeCallback);
//        shareCore.share(plat, data);
    }
 
Example 19
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);
}