一:集成友盟分享
做第三方登录现在大多数用友盟,友盟之中做第三方登录的时候首先下载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,令牌,头像图片URLNSLog(@"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