First, in the project to configure AppID and Appkey
#import "ViewController.h"#import "UMSocial.h"@interfaceViewcontroller ()@end@implementationViewcontroller- (void) viewdidload {[Super viewdidload];}#pragmaMark-third-party login-(ibaction) sinalogin {umsocialsnsplatform*snsplatform =[Umsocialsnsplatformmanager Getsocialplatformwithname:umsharetosina]; Snsplatform.loginclickhandler (Self,[umsocialcontrollerservice Defaultcontrollerservice],yes,^ (Umsocialresponseentity *response) { //access to Weibo usernames, uid, tokens, etc. if(Response.responsecode = =umsresponsecodesuccess) {umsocialaccountentity*snsaccount =[[Umsocialaccountmanager socialaccountdictionary] Valueforkey:umsharetosina]; NSLog (@"username is%@, UID was%@, token is%@ URL is%@", Snsaccount.username,snsaccount.usid,snsaccount.accesstoken,snsaccount.iconurl); }});}-(ibaction) qqlogin {umsocialsnsplatform*snsplatform =[Umsocialsnsplatformmanager GETSOCIALPLATFORMWITHNAME:UMSHARETOQQ]; Snsplatform.loginclickhandler (Self,[umsocialcontrollerservice Defaultcontrollerservice],yes,^ (Umsocialresponseentity *response) { if(Response.responsecode = =umsresponsecodesuccess) {umsocialaccountentity*snsaccount =[[Umsocialaccountmanager socialaccountdictionary] valueforkey:umsharetoqq]; NSLog (@"username is%@, UID was%@, token is%@ URL is%@", Snsaccount.username,snsaccount.usid,snsaccount.accesstoken,snsaccount.iconurl); }});}#pragmaMark-Share-(ibaction) sharetosession {[Self sharetoweixin:umsharetowechatsession];}-(ibaction) sharetotimeline {[Self sharetoweixin:umsharetowechattimeline];}- (void) Sharetoweixin: (NSString *) sharetoweixin{UIImage*image = [UIImage imagenamed:@"dzq_icon.jpg"]; [[Umsocialdataservice Defaultdataservice] postsnswithtypes:@[sharetoweixin] Content:@"The dream still has to have, in case the realization of it"Image:image location:nil urlresource:nil presentedcontroller:self completion:^ (umsocialresponseentity *response) { if(Response.responsecode = =umsresponsecodesuccess) {NSLog (@"Share Success! "); } }];}
Friend Alliance Third Party Login