Agora provides an open source Online Karaoke sample project on GitHub. This page shows how to compile and run this sample project on an iOS platform in order to experience the Online Karaoke features.
The Online Karaoke sample project provided by Agora uses a third-party cloud service, so you need to obtain information about this cloud service. Refer to the following steps:
Go to Third-party Cloud Service Console to register an account and create a new application.
After creating the application, click Settings > Application Credential on the left navigation bar, and you can get the AppID, AppKey, and the REST API server address by clicking the copy button on the right.
Click Settings > Data Storage > Service Settings, and select the LiveQuery option.
Run the following command on the terminal:
pip3 install leancloud
Refer to the following steps to configure the sample project:
Clone the Online Karaoke sample project to the local folder, and open the Agora-Online-KTV-iOS
folder.
Open the Config.swift
file in the ./Core
path, and modify the following information:
AppId
and Token
with the Agora App ID and temporary token obtained from the Agora console.LeanCloudAppId
, LeanCloudAppKey
, and LeanCloudServerUrl
with the AppID, AppKey, and REST API server address, respectively, that you obtained from Step 1.Open the LeanCloudHelp.py
file in the Online-KTV
folder, and fill in appid
and appkey
with the AppID and AppKey obtained in Step 1.
Fill in customer_key
, customer_secret,
and agora_app_id
with the customer ID, secret key, and Agora App ID, respectively, that you obtained in the Agora console.
Refer to the following steps to integrate the Agora iOS SDK into the sample project:
.framework
file in the libs
directory of the SDK package to the ./AgoraSDK/libs
directory.Refer to the following steps to run the sample project to experience the Online Karaoke features:
Agora-Online-KTV-iOS
folder in the terminal, and run the pod install
command to link the required dependencies. Once you successfully install the SDK, it shows Pod installation complete! in terminal, and you can see an xcworkspace file in the project folder.