Swiftpack.co - hamed8080/FanapPodAsyncSDK as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by hamed8080.
hamed8080/FanapPodAsyncSDK 1.2.0
An async client that manages the connection to the async server.
⭐️ 0
🕓 3 weeks ago
iOS macOS macCatalyst
.package(url: "https://github.com/hamed8080/FanapPodAsyncSDK.git", from: "1.2.0")

FanapPodAsyncSDK



Fanap's POD Async iOS SDK

Features

  • ☑ Simplify Socket connection to Async server

Installation

Swift Package Manager(SPM)

Add in Package.swift or directly in Xcode Project dependencies section:

.package(url: "https://pubgi.fanapsoft.ir/chat/ios/fanappodasyncsdk.git", .upToNextMinor(from: "1.2.0")),

CocoaPods

Add in Podfile:

pod 'FanapPodAsyncSDK'

How to use?

let asyncConfig = AsyncConfigBuilder()
            .socketAddress("socketAddresss")
            .reconnectCount(Int.max)
            .reconnectOnClose(true)
            .appId("PodChat")
            .serverName("serverName")
            .isDebuggingLogEnabled(false)
            .build()
let async = Async(config: asyncConfig, delegate: self)
async.createSocket()

Connection State

Notice: Use the connection only it's in ASYNC_READY state

public func asyncStateChanged(asyncState: AsyncSocketState, error: AsyncError?) {
    Chat.sharedInstance.delegate?.chatState(state: asyncState.chatState, currentUser: nil, error: error?.chatError)
    if asyncState == .ASYNC_READY{
        // Write your code here.
    }
}


Send data

async.sendData(type: .message, message: message)


Documentation

For more information about how to use Async SDK visit Documentation

Developer Application

For more example and usage you can use developer implementation app

Contributing to FanapPodAsyncSDK

Please see the contributing guide for more information.

GitHub

link
Stars: 0
Last commit: Yesterday
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Dependencies

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics