Getting started with Agora + iOS

My creation
  1. Go to agora.io
  2. Sign up
New agora project setup
  1. Create xcode project
<key>NSMicrophoneUsageDescription</key>
<string>We need you permission</string>
pod init
open podfile
pod 'AgoraRtm_iOS', '~> 1.4'
pod 'AgoraAudio_iOS', '~> 3.2'
pod install
var agoraRTMkit = AgoraRtmKit(appId: "YOUR_APP_ID", delegate: self)
var agoraKit = AgoraRtcEngineKit.sharedEngine(withAppId: "YOUR_APP_ID", delegate: self)
agoraKit?.enableAudio()
agoraKit?.enableAudioVolumeIndication(1000, smooth: 3, report_vad: true)
agoraKit?.setChannelProfile(.liveBroadcasting)
agoraRTMkit?.login(byToken: "token", user: "USER_NAME")
var agoraRTMchannel = agoraRTMkit?.createChannel(withId: "CHANNEL_NAME", delegate: self)
agoraKit?.setClientRole(userRole)
agoraKit?.joinChannel( byToken: “token”, channelId: “CHANNEL_NAME”, info: nil, uid: nil, joinSuccess: { (_, uid, elapsed) in 
print(uid)
agoraRTMchannel?.join(completion: { (errcode) in
print(errcode)
})
})
agoraRTMchannel?.leave()
agoraKit?.createRtcChannel("CHANNEL_NAME")?.leave()
agoraKit?.leaveChannel()
agoraRTMkit?.logout()
AgoraRtcEngineKit.destroy()
agoraRTMkit?.destroyChannel(withId: "CHANNEL_NAME")
iVoice app

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ashok

Ashok

 iOS and Flutter developer @TCS, Chennai. Here to share best practices learned through my experience. Reach me on www.linkedin.com/in/ashok1208