### 一:集成友盟分享
做第三方登錄現在大多數用友盟,友盟之中做第三方登錄的時候首先下載sdk,然后自己看文檔,其實友盟的官方文檔寫的已經十分清楚了,這里自己寫寫,做一下筆記
### 二:詳細
友盟:[http://www.umeng.com/](http://www.umeng.com/)
appDelegate中寫入
~~~
//設置分享到QQ/Qzone的應用Id,和分享url 鏈接
#import "UMSocialQQHandler.h"
[UMSocialQQHandler setQQWithAppId:@"100424468" appKey:@"c7394704798a158208a74ab60104f0ba" url:@"http://www.umeng.com/social"];
~~~
qq登錄的地方
~~~
UMSocialSnsPlatform *snsPlatform = [UMSocialSnsPlatformManager getSocialPlatformWithName:UMShareToQQ];
snsPlatform.loginClickHandler(self,[UMSocialControllerService defaultControllerService],YES,^(UMSocialResponseEntity *response){
// 獲取微博用戶名、uid、token等
if (response.responseCode == UMSResponseCodeSuccess) {
UMSocialAccountEntity *snsAccount = [[UMSocialAccountManager socialAccountDictionary] valueForKey:UMShareToQQ];
//qq昵稱,uid,令牌,頭像圖片URL
NSLog(@"username is %@, uid is %@, token is %@ url is %@",snsAccount.userName,snsAccount.usid,snsAccount.accessToken,snsAccount.iconURL);
}});
~~~
其中這一段snsAccount.userName,snsAccount.usid,snsAccount.accessToken,snsAccount.iconURL分別代表qq昵稱,uid,令牌,頭像圖片URL