Skip to content

Instantly share code, notes, and snippets.

@zontan
Last active June 24, 2020 20:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zontan/e4b9db52b751b76e8d307550eb3ef528 to your computer and use it in GitHub Desktop.
Save zontan/e4b9db52b751b76e8d307550eb3ef528 to your computer and use it in GitHub Desktop.
import AgoraRtcKit
let appID = "YourAppIDHere"
var agoraKit: AgoraRtcEngineKit?
let tempToken: String? = nil //If you have a token, put it here.
var userID: UInt = 0 //This tells Agora to generate an id for you. If you have unique user IDs already, you can use those.
...
private func getAgoraEngine() -> AgoraRtcEngineKit {
if agoraKit == nil {
agoraKit = AgoraRtcEngineKit.sharedEngine(withAppId: appID, delegate: self)
}
return agoraKit!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment