SwiftSalesIosSdk 1.1.0

SwiftSalesIosSdk 1.1.0

SwiftSales 维护。



  • Swiftsales

Swift-Chat iOS SDK

需求

Swift-Chat iOS SDK 需要 iOS 11.0 或更高版本,并与 Swift 5 兼容。

安装

CocoaPods

Swift-Chat iOS SDK 可以通过 CocoaPods 获取。

pod 'swiftsales_ios_sdk'

App Delegate

通过向 SwiftSaleSdk.initialize 方法提供 userId 和 domainName 来初始化 swift chat sdk(注意:您可以从 swiftSale 管理面板获取 userId 和 domainName)或 创建账户

import UIKit
import swiftsales_ios_sdk

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // initialize swift sale sdk
        SwiftSaleSdk.initialize(userId: 865, domainName:  "files.shahzaibsheikh.com")
        return true
    }

    ... // your remaining methods or code
}

用法

您可以从视图控制器手动打开 SwiftSale 聊天

import UIKit
import swiftsales_ios_sdk

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
    }

    @IBAction func OpenSwiftChatPressed(_ sender: UIButton) {
        SwiftSaleSdk.presentViewController(viewController: self) // or you can push SwiftSaleSdk.pushViewController(navigationController: self.navigationController)
    }
}

SwiftSale SDK 还提供了名为 "SwiftChatFabView" 的 UIView 小部件,您可以通过选择 UI-Kit 库中的“视图”,然后在身份检查器中选择自定义类下拉列表中的 "SwiftChatFabView",并在模块下拉列表中选择 "swiftsales_ios_sdk" 来将其添加到 StoryBoard 中。

许可证

MIT License

Copyright (c) 2020 Koderlabs

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.