Latest 1.0.8
Homepage https://github.com/poholo/LDSDKManager_IOS
License MIT
Platforms ios 8.0, requires ARC
Frameworks UIKit, CoreGraphics, Foundation
Authors

LDSDKManager_IOS

聚合QQ、微信、微博、支付宝、钉钉、Telegram等第三方库,抽象封装分享、授权、支付功能,以便其他开发者能快速接入。

集成方式

pod 'LDSDKManager'

默认配置LDSDKManager集成的所有库,如果你有选择性的集成,请按照如下集成


pod 'LDSDKManager/QQ'
pod 'LDSDKManager/Wechat'
pod 'LDSDKManager/Weibo'
pod 'LDSDKManager/Alipay'
pod 'LDSDKManager/DingTalk'
pod 'LDSDKManager/Telegram'

or 
pod 'LDSDKManager/All'

集成步骤

1.注册第三方keys


     NSArray *regPlatformConfigList = @[
        @{
            LDSDKConfigAppIdKey:@"微信appid",
            LDSDKConfigAppSecretKey:@"微信appsecret",
            LDSDKConfigAppDescriptionKey:@"应用描述",
            LDSDKConfigAppPlatformTypeKey:@(LDSDKPlatformWeChat)
        },
        @{
            LDSDKConfigAppIdKey:@"QQ appid",
            LDSDKConfigAppSecretKey:@"qq appkey",
            LDSDKConfigAppPlatformTypeKey:@(LDSDKPlatformQQ)
        },
        @{
            LDSDKConfigAppIdKey:@"易信appid",
            LDSDKConfigAppSecretKey:@"易信appsecret",
            LDSDKConfigAppPlatformTypeKey:@(LDSDKPlatformYiXin)
        },
        @{
            LDSDKConfigAppSchemeKey:@"支付宝 appScheme",
            LDSDKConfigAppPlatformTypeKey:@(LDSDKPlatformAliPay)
        },
        ];
        [[LDSDKManager share] registerWithPlatformConfigList:regPlatformConfigList];

2.在Appdelegate中

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
    BOOL success = [[LDSDKManager share] handleURL:url];
    return success;
}

- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
    BOOL success = [[LDSDKManager share] handleURL:url];
    return success;
}

3.分享能力和授权能力

请参照LDSDKManager-SDK-Example & 

4.其他配置

4.1 info.plist add schemes
<key>LSApplicationQueriesSchemes</key>
<array>
    <string>wechat</string>
    <string>weixin</string>
    <string>sinaweibohd</string>
    <string>sinaweibo</string>
    <string>sinaweibosso</string>
    <string>weibosdk</string>
    <string>weibosdk2.5</string>
    <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>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>
    <string>waquchild</string>
    <string>tencentapi.qq.reqContent</string>
    <string>tencentapi.qzone.reqContent</string>
    <string>dingtalk</string>
    <string>dingtalk-open</string>
    <string>dingtalk-sso</string>
</array>
4.1 info.plist add URL types
<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>CFBundleURLName</key>
        <string>com.poholo.MCShare</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>mcshare</string>
        </array>
    </dict>
    <dict>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>CFBundleURLName</key>
        <string>weixin</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>xxxxx</string>
        </array>
    </dict>
    <dict>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>CFBundleURLName</key>
        <string>tencent</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>xxxxx</string>
        </array>
    </dict>
    <dict>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>CFBundleURLName</key>
        <string>weibo</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>sina.xxxxxxxx</string>
        </array>
    </dict>
    <dict>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>CFBundleURLName</key>
        <string>alipayShare</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>apxxxxxxxx</string>
        </array>
    </dict>
    <dict>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>CFBundleURLName</key>
        <string>dingtalk</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>dingoak5hqhuvmpfhpnjvt</string>
        </array>
    </dict>

</array>

LDSDKManager的框架层次

LDSDKManager目前有五个submodule,分别是CoreService,QQService,WechatService,AlipayService。后边四个分别整合了QQSDK、微信SDK、支付宝SDK,他们都依赖于CoreService。

整合的优点在于:

  1. 开发者无需调用SDK头文件,方便SDK的升级;

  2. 易拓展,可以通过增加模块使得开发者无需修改代码即可支持更多的第三方SDK。

如何新增一个第三方SDK

  1. 如果是已有的模块,导入子模块即可;
  2. 如果要导入新的SDK,实现步骤:
    SDKManager中LDSDKPlatformType添加相应type;
    建立新文件夹,导入SDK文件,编写代码实现SDKServiceInterface文件夹 中的protocol;
    修改SDKServiceConfig.plist,添加新SDK支持的Service以及对应实现的文件名。

updates


1.0.4 更新依赖方式(pod版),支持最新的sdk

1.0.5 a.三方库均用官方和poholo维护的三方库
      b.更新sdk,增加更多的分享类型,以及平台特性。
      c.授权-微博增加用户信息获取
1.0.8 support MCBase/Dto & Log

Author

littleplayer [email protected]

License

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

Latest podspec

{
    "name": "LDSDKManager",
    "version": "1.0.8",
    "summary": "iOSu7b2cu4e09u65b9u805au5408u5e93",
    "description": "u805au5408QQu3001u5faeu4fe1u3001u5faeu535au3001u652fu4ed8u5b9du3001u9489u9489u3001Telegramu7b49u7b2cu4e09u65b9u5e93uff0cu62bdu8c61u5c01u88c5u5206u4eabu3001u6388u6743u3001u652fu4ed8u529fu80fduff0cu4ee5u4fbfu5176u4ed6u5f00u53d1u8005u80fdu5febu901fu63a5u5165u3002",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "littleplayer": "[email protected]"
    },
    "homepage": "https://github.com/poholo/LDSDKManager_IOS",
    "source": {
        "git": "https://github.com/poholo/LDSDKManager_IOS.git",
        "tag": "1.0.8"
    },
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "default_subspecs": "All",
    "xcconfig": {
        "VALID_ARCHS": "arm64 x86_64",
        "USER_HEADER_SEARCH_PATHS": "${PROJECT_DIR}/Pods/**"
    },
    "pod_target_xcconfig": {
        "VALID_ARCHS": "arm64 x86_64"
    },
    "frameworks": [
        "UIKit",
        "CoreGraphics",
        "Foundation"
    ],
    "subspecs": [
        {
            "name": "Core",
            "source_files": [
                "SDK/Core/**/*.{h,m,mm}",
                "SDK/Core/*.{h,m,mm}"
            ],
            "public_header_files": "SDK/Core/**/*.h",
            "dependencies": {
                "MCBase/Dto": [],
                "MCBase/Log": []
            }
        },
        {
            "name": "QQ",
            "source_files": "SDK/QQPlatform/*.{h,m,mm}",
            "public_header_files": "SDK/QQPlatform/*.h",
            "dependencies": {
                "LDSDKManager/Core": [],
                "MCTencentOpenAPI": []
            }
        },
        {
            "name": "Wechat",
            "source_files": [
                "SDK/WechatPlatform/**/*.{h,m,mm}",
                "SDK/WechatPlatform/*.{h,m,mm}"
            ],
            "public_header_files": "SDK/WechatPlatform/*.h",
            "dependencies": {
                "LDSDKManager/Core": [],
                "WechatOpenSDK": []
            }
        },
        {
            "name": "Weibo",
            "source_files": "SDK/WeiboPlatform/*{h,m,mm}",
            "public_header_files": "SDK/WeiboPlatform/*.h",
            "dependencies": {
                "LDSDKManager/Core": [],
                "Weibo_SDK": []
            }
        },
        {
            "name": "Alipay",
            "source_files": "SDK/AlipayPlatform/*{h,m,mm}",
            "public_header_files": "SDK/AlipayPlatform/*.h",
            "dependencies": {
                "AlipaySDK-iOS": [],
                "LDSDKManager/Core": [],
                "APOpenSdk": []
            }
        },
        {
            "name": "DingTalk",
            "source_files": "SDK/DingTalkPlatform/*{h,m,mm}",
            "public_header_files": "SDK/DingTalkPlatform/*.h",
            "dependencies": {
                "LDSDKManager/Core": [],
                "MCDingTalk": []
            }
        },
        {
            "name": "Telegram",
            "source_files": "SDK/TelegramPlatform/*{h,m,mm}",
            "public_header_files": "SDK/TelegramPlatform/*.h",
            "dependencies": {
                "LDSDKManager/Core": []
            }
        },
        {
            "name": "All",
            "dependencies": {
                "LDSDKManager/QQ": [],
                "LDSDKManager/Wechat": [],
                "LDSDKManager/Weibo": [],
                "LDSDKManager/Alipay": [],
                "LDSDKManager/DingTalk": [],
                "LDSDKManager/Telegram": []
            }
        }
    ]
}

Pin It on Pinterest

Share This