To run the example project, clone the repo, and run pod install
from the Example directory first.
Rio can be used by developers to build serverless object oriented systems. You should create an retter.io account and an Rio project to start.
You need to have a Rio projectId.
Rio is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'Rio'
You can use swift package manager with following repo url and using main branch:
https://github.com/rettersoft/rio-ios-sdk
Initialize the SDK with your project id created in RBS console.
let rio = Rio.init(config: RioConfig(projectId: "{PROJECT_ID}"))
Rio client's authenticateWithCustomToken method should be used to authenticate a user. If you don't call this method, client will send actions as an anonymous user.
rio.authenticateWithCustomToken(customToken)
You can sign out with .signout method.
rio.signOut()
You can attach a delegate to Rio client.
rio.delegate = self
And start receiving authentication state changes.
extension ViewController : RioClientDelegate {
func rioClient(client: Rio, authStatusChanged toStatus: RioClientAuthStatus) {
}
}
rio.getCloudObject(with: RioCloudObjectOptions(classID: "Test")) { object in
} onError: { error in
}
object.call(with: RioCloudObjectOptions(method: "sayHello")) { resp in
} onError: { error in
}
object.state?.public.subscribe(onSuccess: { data in
}, onError: { err in
})
Rio is available under the MIT license. See the LICENSE file for more info.