AJ學IOS 之第三方登陸友盟實現

一:集成友盟分享

作第三方登陸如今大多數用友盟,友盟之中作第三方登陸的時候首先下載sdk,而後本身看文檔,其實友盟的官方文檔寫的已經十分清楚了,這裏本身寫寫,作一下筆記markdown

二:詳細

友盟:http://www.umeng.com/app

appDelegate中寫入ui

//設置分享到QQ/Qzone的應用Id,和分享url 連接
    #import "UMSocialQQHandler.h"
    [UMSocialQQHandler setQQWithAppId:@"100424468" appKey:@"c7394704798a158208a74ab60104f0ba" url:@"http://www.umeng.com/social"];

qq登陸的地方url

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,令牌,頭像圖片URLspa

相關文章
相關標籤/搜索