Add in Package.swift
or directly in Xcode Project dependencies
section:
.package(url: "https://pubgi.fanapsoft.ir/chat/ios/async.git", .upToNextMinor(from: "1.3.1")),
Because it has conflict with other Pods' names in cocoapods you have to use direct git repo.
Add in Podfile
:
pod 'Starscream', :git => 'https://github.com/daltoniam/Starscream.git', :tag => '3.0.5'
pod 'Additive', :git => 'http://pubgi.fanapsoft.ir/chat/ios/additive.git', :tag => '1.0.1'
pod 'Logger', :git => 'http://pubgi.fanapsoft.ir/chat/ios/logger.git', :tag => '1.0.2'
pod "Async", :git => 'http://pubgi.fanapsoft.ir/chat/ios/async.git', :tag => '1.3.1'
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()
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.
}
}
async.sendData(type: .message, message: message)
For more information about how to use Async SDK visit Documentation
For more example and usage you can use developer implementation app
Please see the contributing guide for more information.
link |
Stars: 0 |
Last commit: 1 week ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics