Getting started with Agora + iOS

My creation
New agora project setup

Life is seems to be sooo simple ! 😆

<key>NSMicrophoneUsageDescription</key>
<string>We need you permission</string>

Note: I recommended you to test the entire app in real device. Not in simulator. Things might be break.

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")

Note: Here token is optional. Its required for authentication purpose. We are not focusing this.

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