IosDemo - aopacloud/aopa-rtc GitHub Wiki
Run through API sample project
Opa has provided an open source SDK sample project AopaRtcIos, showing various basic and advanced scenes. This article takes Runtong video call example project as an example to help you quickly experience the effect of Opa video call.
Precondition- A computer that can access the Internet. Please make sure that your network environment does not have a firewall deployed, or you may not be able to use the OPA service normally.
- Xcode 13.0 or above.
- Cocoapods installed. If Cocoapods is not installed, refer to [Getting Started with CocoaPods]( https://guides.cocoapods.org/using/getting-started.html#getting -Started) installation instructions.
- Two iOS 14.0 and above devices
- A valid Opa account and Opa project. Please refer to [Opening Service] to obtain the following information from the Opa console:
- App ID: A string randomly generated by Opa to identify your project.
- App certificate (optional): string used to generate token. If your project has enabled * * Allow only App ID to join * *, you do not need to obtain this field.
- Apple developer account.
Operating Steps
Get sample projectYou can choose one of the following two ways to get the sample project:
-
Go to the [Download] page, download the latest version of the iOS video SDK, and unzip it.
-
Go to the [sample project] provided by Opa on GitHub( https://github.com/olaola-chat/AopaApi-Example ), and then run the following command to clone the repository locally.
Shell
git clone [email protected]:aopacloud/aopa-rtc.git
information
Opa provides video sample projects for the iOS platform in the warehouse, which are located in the path of '/aopa-rtc/AopaRtcObjc'.
Configuration sample project-
Open the sample project folder and fill in the '/aopa-rtc/AopaRtcObjc/NALoginController' file with the App ID and App Certificate you obtained from the Opa console (if the project is enabled with * * Allow only App ID to join * *, the 'Certificate' field is left blank).
-
Open the terminal and use Xcode to open the newly generated 'AppRtcObjc. xcodeproj' file under the project folder.
Compile and run the sample project-
Connect the iOS device to the computer, open * * Device>Privacy and Security>Security * * on the device, and open * * Developer Mode * *.
-
Check your iOS device in the * * iOS Device * * option at the top of the Xcode interface.
-
Check * * Automatically manage signing * * on the * * Signing&Capabilities * * interface under the project * * TARGETS * *, and then configure your Apple developer account and * * Bundle Identifier * * under each target.
-
Click 开始编译。
-
After successful compilation, it will appear on your iOS device! [AppBBRtcIOS2]((https://rtc-resouce.oss-ap-southeast-1.aliyuncs.com/github_pic/55.png) App icon.
-
(Optional) If the * * Untrusted developer * * prompt pops up on the device, first click * * Cancel * * to close the prompt, then open * * Settings>General>VPN and Device Management * * on the iOS device, and select the trusted developer in the * * Developer APP * *.
-
Open * * API Example * *, select a scenario you want to try, enter the channel name (such as' test '), and click the * * Add Channel * * button.
-
In order to better experience various audio and video interaction scenarios, you can invite a friend to use another device to run the sample project (ensure that the App ID and App certificate in 'samples/APIExample/APIExample/Common/KeyCenter. swift' remain unchanged). After you enter the same channel name to join the channel, you can experience various interactive scenes in the same channel.