Skip to content

myxianwen/YJSocialManager

Repository files navigation

YJSocialManager

CI Status Version License Platform

Example

1、To run the example project, clone the repo, and run pod install from the Example directory first. 2、初始化SDK

//1.注册微信、QQ、新浪SDK
[[YJSocialManger sharedManger] registPlatform:YJSocialPlatfromType_QQ appKey:QQAppID appSecret:QQAppSecret redirectURL:nil];
[[YJSocialManger sharedManger] registPlatform:YJSocialPlatfromType_WechatSession appKey:WXAppID appSecret:WXAppSecret redirectURL:nil];

[[YJSocialManger sharedManger] registPlatform:YJSocialPlatfromType_Sina appKey:KSinaAppKey appSecret:KSinaAppSecret redirectURL:kRedirectURI];

//2.注册UMSDK
[[YJSocialManger sharedManger] startSocialSDKWithAppKey:UMAppKey openLog:NO];

3、处理回调

#pragma mark - 回调
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
{
BOOL result = [[YJSocialManger sharedManger] handldeOpenURL:url];

if (result == NO) {

//在这里调用其他SDK


}

return result;
}

- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation
{
BOOL result = [[YJSocialManger sharedManger] handleOpenURL:url sourceApplication:sourceApplication annotation:annotation];

if (result == NO) {

//在这里调用其他SDK

}

return result;
}

4、添加NSAppTransportSecurity

<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>

添加白名单

<key>LSApplicationQueriesSchemes</key>
<array>
<!-- 微信 URL Scheme 白名单-->
<string>wechat</string>
<string>weixin</string>

<!-- 新浪微博 URL Scheme 白名单-->
<string>sinaweibohd</string>
<string>sinaweibo</string>
<string>sinaweibosso</string>
<string>weibosdk</string>
<string>weibosdk2.5</string>

<!-- QQ、Qzone URL Scheme 白名单-->
<string>mqqapi</string>
<string>mqq</string>
<string>mqqOpensdkSSoLogin</string>
<string>mqqconnect</string>
<string>mqqopensdkdataline</string>
<string>mqqopensdkgrouptribeshare</string>
<string>mqqopensdkfriend</string>
<string>mqqopensdkapi</string>
<string>mqqopensdkapiV2</string>
<string>mqqopensdkapiV3</string>
<string>mqqopensdkapiV4</string>
<string>mqzoneopensdk</string>
<string>wtloginmqq</string>
<string>wtloginmqq2</string>
<string>mqqwpa</string>
<string>mqzone</string>
<string>mqzonev2</string>
<string>mqzoneshare</string>
<string>wtloginqzone</string>
<string>mqzonewx</string>
<string>mqzoneopensdkapiV2</string>
<string>mqzoneopensdkapi19</string>
<string>mqzoneopensdkapi</string>
<string>mqqbrowser</string>
<string>mttbrowser</string>
</array>

5、配置URL Scheme 11474533850_.pic_hd.jpeg 配置规则如下

QQ20170426-0.png 具体规则请求各自平台的开发者平台文档

Requirements

Installation

YJSocialManager is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "YJSocialManager"

Author

full-of-fire, 591730822@qq.com

License

YJSocialManager is available under the MIT license. See the LICENSE file for more info.

About

社会化分享,常见的QQ/微信/微博 的登录组件

Resources

License

Stars

Watchers

Forks

Packages

No packages published