Skip to content

FanapSoft/pod-async-ios-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pod-Async-iOS-SDK



Swift Platforms CocoaPods Compatible

Fanap's POD Async iOS SDK

Features

  • Simplify Socket connection to Async server

Installation

Add in Podfile:

pod 'FanapPodAsyncSDK'

Intit

let asyncConfig = AsyncConfig(socketAddress:                socketAddress,
                                serverName:                 serverName,
                                deviceId:                   deviceId ?? UUID().uuidString,
                                appId:                      "PodChat", // PodChat is default app Id
                                peerId:                     nil,
                                messageTtl:                 messageTtl,
                                connectionRetryInterval:    TimeInterval(connectionRetryInterval),
                                connectionCheckTimeout:     TimeInterval(connectionCheckTimeout),
                                reconnectCount:             reconnectCount,
                                reconnectOnClose:           reconnectOnClose,
                                isDebuggingLogEnabled:      isDebuggingAsyncEnable)
asyncClient = NewAsync(config: asyncConfig, delegate: self)
asyncClient?.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{
        UserInfoRequestHandler.getUserForChatReady()
    }
}


Send data

asyncClient?.sendData(type: type, data: data)


Developer Application

For more example and usage you can use developer implementation app

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •