Latest1.2.0
Homepagehttps://github.com/zhang382847657/arenaShareSDK
LicenseMIT
Platformsios 8.0
FrameworksCoreGraphics, UIKit, Foundation
Authors

arenaShareSDK

集成友盟分享的SDK,目前仅支持微信及QQ两个平台

使用说明

1. 通过Pod安装

pod 'ArenaShareSDK'

2. 配置Info.plist 和 URL Scheme

  • 在项目的Info.plist文件中添加白名单,具体操作请戳这里
  • 在项目的Info -> URL Types里添加对应平台的URL Scheme,具体操作请戳这里

3. 引入资源文件

Finder打开ArenaShareSDK,把Libraries文件夹下所有的.a文件以及Resources文件夹下所有的.bundle文件都添加到项目中,然后在项目的Build Phases -> Copy Bundle Resources中引入刚才所有的.a.bundle

4. 友盟初始化设置

需要在Appdelegate.swift文件中的didFinishLaunchingWithOptions函数里调用以下代码,主要是对友盟进行初始化的设置

//集成友盟分享的一些配置信息 友盟的APPKEY 以及微信和QQ的Key
Share.configUSharePlatforms(with: "59ee97488f4a9d1b8a000010", //友盟AppKey
 andWXAppKey: "wx085a8685d1892707", //微信平台的AppKey
 andWXSecret: "0a6538a186d20bc2b8d155362b21c9c2",  //微信平台的Secret
 andQQAppKey: "",  //QQ平台的AppKey
 andRedirectURL: "" 
 )

同时在Appdelegate.swift文件中的openUrl函数里调用以下代码,主要是为了让友盟分享的回调能响应

func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
    return Share.applicationOpen(url)
}

5. 调用分享功能

  • 分享网页链接

    Share.share(data: [ "title":"分享的标题",  //必填
                    "content":"分享的内容",  //必填
                    "url":"https://www.baidu.com",  //必填
                    "image":"https://www.baidu.com/pic/login.png"] //选填
                    )
  • 分享本地图片

    Share.shareImage(data: [ "filePath":"图片在本地的路径"] //必填
                    )

Latest podspec

{
    "name": "ArenaShareSDK",
    "version": "1.2.0",
    "summary": "Arenau96c6u6210u53cbu76dfu5206u4eabu7684SDK",
    "description": "u96c6u6210u53cbu76dfu5206u4eab,u652fu6301u5faeu4fe1u4ee5u53caQQuff08u90fdu4e3au7cbeu7b80u7248uff09uff0cu65b9u4fbfArenau6846u67b6u4f7fu7528u5206u4eabu529fu80fd",
    "homepage": "https://github.com/zhang382847657/arenaShareSDK",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "u4e3au6bdbu54e9": "[email protected]"
    },
    "source": {
        "git": "https://github.com/zhang382847657/arenaShareSDK.git",
        "tag": "1.2.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "ArenaShareSDK/Classes/**/*",
    "frameworks": [
        "CoreGraphics",
        "UIKit",
        "Foundation"
    ],
    "libraries": "sqlite3",
    "pod_target_xcconfig": {
        "OTHER_LDFLAGS": [
            "-ObjC"
        ]
    },
    "vendored_frameworks": "Frameworks/*",
    "vendored_libraries": "Libraries/*",
    "resources": [
        "Resources/*",
        "*.plist"
    ]
}

Pin It on Pinterest

Share This