登录 立即注册
金钱:

Code4App-iOS开发-iOS 开源代码库-iOS代码实例搜索-iOS特效示例-iOS代码例子下载-Code4App.com

SRThirdSocialPlatform

[复制链接]
来自: guowilling 分类: iOS精品源码 上传时间: 2016-11-3 19:42:12
Tag:社交分享 授权登录 授权 Social 微信

项目介绍:

SRThirdSocialPlatform

https://github.com/guowilling/SRThirdSocialPlatform

封装微信, 微博, QQ 第三方社交平台的登录授权功能, 通过 Block 的方式回调授权登录结果, 使用简单方便.

If you like it, please star me, thanks a lot.

Have Fun.

SRThirdSocialPlatform

  • 封装微信, 微博, QQ 第三方社交平台的登录授权功能, 通过 Block 的方式回调授权登录结果, 使用简单方便.

  • 实际项目开发中, 客户端只需拿到第三方平台的 code 或 token 即可, 所以可根据不同的业务需求, 自行修改代码.

image image image

Project settings

图片描述

图片描述

图片描述

Usage

Initialize settings

// Firstly registerApp through SRAuthManager when your app didFinishLaunching.
// Like this
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    
    [SRThirdSocialManager registerApp];
    
    return YES;
}
// Then handleOpenURL.
// Like this
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
    
    return [SRThirdSocialManager handleOpenURL:url];
}

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
    
    return [SRThirdSocialManager handleOpenURL:url];
}

That's all settings, you can use the third social platform's auth and login features.

Like this

// Weixin auth
if ([SRThirdSocialManager isAppInstalled:SRThirdSocialWX]) {
    [SRThirdSocialManager authRequest:SRThirdSocialWX
                          authSuccess:^(NSString *openID, NSString *unionID) {
                              // Your code
                          } authError:^(NSError *error) {
                              // Your code
                          }];
}
    
// Weixin login
if ([SRThirdSocialManager isAppInstalled:SRThirdSocialWX]) {
    [SRThirdSocialManager loginRequest:SRThirdSocialWX
                          loginSuccess:^(NSString *openID, NSString *unionID, NSString *userNickname, NSString *userAvatarURL) {
                              // Your code
                          } loginError:^(NSError *error) {
                              // Your code
                          }];
}
// Weibo auth
if ([SRThirdSocialManager isAppInstalled:SRThirdSocialWB]) {
    [SRThirdSocialManager authRequest:SRThirdSocialWB
                          authSuccess:^(NSString *openID, NSString *unionID) {
                              // Your code
                          } authError:^(NSError *error) {
                              // Your code
                          }];
}
    
// Weibo login
if ([SRThirdSocialManager isAppInstalled:SRThirdSocialWB]) {
    [SRThirdSocialManager loginRequest:SRThirdSocialWB
                          loginSuccess:^(NSString *openID, NSString *unionID, NSString *userNickname, NSString *userAvatarURL) {
                              // Your code
                          } loginError:^(NSError *error) {
                              // Your code
                          }];
}
// QQ auth
if ([SRThirdSocialManager isAppInstalled:SRThirdSocialQQ]) {
    [SRThirdSocialManager authRequest:SRThirdSocialQQ
                          authSuccess:^(NSString *openID, NSString *unionID) {
                              // Your code
                          } authError:^(NSError *error) {
                              // Your code
                          }];
}
    
// QQ login
if ([SRThirdSocialManager isAppInstalled:SRThirdSocialQQ]) {
    [SRThirdSocialManager loginRequest:SRThirdSocialQQ
                          loginSuccess:^(NSString *openID, NSString *unionID, NSString *userNickname, NSString *userAvatarURL) {
                              // Your code
                          } loginError:^(NSError *error) {
                              // Your code
                          }];
}

More information please see the source code.

If you have any question, please issue or contact me.

If you like it, please star me, thanks a lot.

Have Fun.

code4app

相关源码推荐:

我来说两句
*滑动验证:
所有评论(34)
王颖博 2016-11-4 11:02:32
感谢分享,Code4App有你更精彩
回复
cbaqz 2016-11-4 17:22:10
DDDDDDDDDDD
回复
phoiu 2016-11-5 15:17:38
code4app确实是个好地方,必须支持~
回复
littleRed 2016-11-5 15:28:31
不错不错,楼主辛苦了。。。
回复
BlueManlove 2016-11-5 15:42:01
相当不错,感谢无私分享精神!
回复
hellokenken 2016-11-5 15:53:49
相当不错,感谢无私分享精神!
回复
唯爱阿鹏 2016-11-7 11:12:17
很给力,Code4App有你更精彩!
回复
mmli0323 2016-11-7 11:14:15
正需要啊,感谢楼主无私分享!
回复
唯爱阿鹏 2016-11-7 13:49:12
我只是路过打酱油的。
回复
1234下一页
提取码:  下载次数:25 状态:已购或VIP 售价:0(原价:10)金钱 下载权限:初级码农 
615 0 25
联系我们
首页/微信公众账号投稿

帖子代码编辑/版权问题

QQ:435399051,742864542

如何获得代码达人称号?

代码贡献英雄榜
用户名 下载数
通过邮件订阅最新 Code4App 信息
上一条 /4 下一条
联系我们
关闭
合作电话:
13802416937
Email:
435399051@qq.com
商务市场合作/投稿
问题反馈及帮助
联系我们

广告投放| Github|申请友链|手机版|Code4App ( 粤ICP备15117877号-1 )

快速回复 返回顶部 返回列表