Java Code Examples for com.sina.weibo.sdk.WbSdk#install()

The following examples show how to use com.sina.weibo.sdk.WbSdk#install() . 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: WeiboBaseShareInstance.java    From SimpleProject with MIT License 5 votes vote down vote up
public WeiboBaseShareInstance(Activity activity, ShareListener listener) {
	this.activity = activity;
	this.listener = listener;
	ImageLoaderManager.getInstance().init(activity.getApplicationContext(), new FrescoInstance());
	AuthInfo authInfo = new AuthInfo(activity, ShareConstants.APP_WEIBO_KEY, ShareConstants.REDIRECT_URL,
			ShareConstants.SCOPE);
		WbSdk.install(activity, authInfo);

	shareHandler = new WbShareHandler(activity);
	shareHandler.registerApp();
	accessToken = AccessTokenKeeper.readAccessToken(activity);
}
 
Example 2
Source File: WBAuth.java    From sdk3rd with Apache License 2.0 5 votes vote down vote up
WBAuth(Activity activity, Platform platform) {
    WbSdk.install(activity, new AuthInfo(activity, platform.getAppId(), platform.extra("redirectUrl"), "all"));
    mActivity = activity;
    mPlatform = platform;
    mApi = new SsoHandler(mActivity);

}
 
Example 3
Source File: WBShare.java    From sdk3rd with Apache License 2.0 5 votes vote down vote up
WBShare(Activity activity, Platform platform) {
    WbSdk.install(activity, new AuthInfo(activity, platform.getAppId(), platform.extra("redirectUrl"), "all"));
    mActivity = activity;
    mPlatform = platform;
    mApi = new WbShareHandler(mActivity);
    mApi.registerApp();
    services.put(this, true);
}
 
Example 4
Source File: BaseLoginShare.java    From LoginSharePay with Apache License 2.0 5 votes vote down vote up
@Override
public void launchWeiboLogin() {

    WbSdk.install(proxyFragment.getContext(), new AuthInfo(proxyFragment.getContext(), weiboValue, weiboRedirectUrl, weiboScope));

    if (ssoHandler == null) {
        ssoHandler = new SsoHandler(proxyFragment);
    }
}
 
Example 5
Source File: WBHelper.java    From SocialHelper with Apache License 2.0 5 votes vote down vote up
WBHelper(Activity activity, String appId, String redirectUrl) {
    this.activity = activity;
    this.appId = appId;
    this.redirectUrl = redirectUrl;
    if (TextUtils.isEmpty(appId) || TextUtils.isEmpty(redirectUrl)) {
        Log.w("WBHelper", "WeBo's appId or redirectUrl is empty!");
        return;
    }
    WbSdk.install(activity.getApplicationContext(), new AuthInfo(activity.getApplicationContext(), appId, redirectUrl, SCOPE));
}
 
Example 6
Source File: WeiboShareManager.java    From sharesdk with Apache License 2.0 5 votes vote down vote up
WeiboShareManager(Context context) {
    Application app = (Application) context.getApplicationContext();
    app.registerActivityLifecycleCallbacks(this);
    mContext = context;
    mSinaAppKey = ShareSDK.getInstance().getWeiboAppId();
    mSinaRedirectUrl = ShareSDK.getInstance().getSinaRedirectUrl();
    mSinaScope = ShareSDK.getInstance().getWeiboScope();
    if (!TextUtils.isEmpty(mSinaAppKey)) {
        // 创建微博 SDK 接口实例
        AuthInfo mAuthInfo = new AuthInfo(context, mSinaAppKey, mSinaRedirectUrl, mSinaScope);
        WbSdk.install(context, mAuthInfo);
    }
}
 
Example 7
Source File: WeiboShareInstance.java    From ShareLoginPayUtil with Apache License 2.0 4 votes vote down vote up
public WeiboShareInstance(Context context, String appId, String redirectUrl, String scope) {
    AuthInfo authInfo = new AuthInfo(context, appId, redirectUrl, scope);
    WbSdk.install(context, authInfo);
    shareHandler = new WbShareHandler((Activity) context);
    shareHandler.registerApp();
}
 
Example 8
Source File: WeiboLoginInstance.java    From ShareLoginPayUtil with Apache License 2.0 4 votes vote down vote up
public WeiboLoginInstance(Activity activity, LoginListener listener, String appId, String redirectUrl, String scope, boolean fetchUserInfo) {
    super(activity, listener, fetchUserInfo);
    AuthInfo authInfo = new AuthInfo(activity, appId, redirectUrl, scope);
    WbSdk.install(activity, authInfo);
    mSsoHandler = new SsoHandler(activity);
}
 
Example 9
Source File: WBLoginInstance.java    From SimpleProject with MIT License 4 votes vote down vote up
public WBLoginInstance(Activity activity, String appKey, String redirectUrl, String scope, AuthListener listener) {
	this.listener = listener;
	AuthInfo authInfo = new AuthInfo(activity, appKey, redirectUrl, scope);
	WbSdk.install(activity, authInfo);
	ssoHandler = new SsoHandler(activity);
}
 
Example 10
Source File: BaseLoginShare.java    From LoginSharePay with Apache License 2.0 4 votes vote down vote up
@Override
public void launchWeiboShare(WeiboMessageBody weiboMessageBody) {
    WbSdk.install(proxyFragment.getContext(), new AuthInfo(proxyFragment.getContext(), weiboValue, weiboRedirectUrl, weiboScope));
    shareHandler = new WbShareHandler(proxyFragment.getContext());
    shareHandler.registerApp();
}
 
Example 11
Source File: WbPlatform.java    From SocialSdkLibrary with Apache License 2.0 4 votes vote down vote up
private WbPlatform(Context context, String appId, String appName, int target, String redirectUrl, String scope) {
    super(context, appId, appName, target);
    AuthInfo authInfo = new AuthInfo(context, appId, redirectUrl, scope);
    WbSdk.install(context, authInfo);
}
 
Example 12
Source File: Share.java    From UPMiss with GNU General Public License v3.0 4 votes vote down vote up
public static void init(Context context) {
    // 微博初始化
    AuthInfo mAuthInfo = new AuthInfo(context, Constants.WB_APP_ID, Constants.WB_REDIRECT_URL, Constants.WB_SCOPE);
    WbSdk.install(context, mAuthInfo);
}