標籤:
一:整合友盟分享
做第三方登入現在大多數用友盟,友盟之中做第三方登入的時候首先下載sdk,然後自己看文檔,其實友盟的官方文檔寫的已經十分清楚了,這裡自己寫寫,做一下筆記
二:詳細
友盟: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
貓貓學習ios 之第三方登入友盟實現