Skip to content

yuna-ran/iOS-background-and-watermark

Repository files navigation

API Example iOS

English | 中文

Overview

This repository contains sample projects using the Agora RTC Objective-C SDK for iOS.

image

Project structure

The project uses a single app to combine a variety of functionalities. Each function is loaded as a storyboard for you to play with.

Function Location
Live streaming LiveStreaming.swift
Custom audio capture CustomAudioSource.swift
Custom video renderer CustomVideoRender.swift
Raw audio and video frames (Objective-C with C++, uses AgoraMediaRawData.h ) RawMediaData.swift
Raw audio frames (Native Objective-C interface) RawAudioData.swift
Custom video capture (Push) CustomVideoSourcePush.swift
Custom video capture (mediaIO) CustomVideoSourceMediaIO.swift
Switch a channel QuickSwitchChannel.swift
Join multiple channels JoinMultiChannel.swift
Join an audio channel JoinChannelAudio.swift
Join a video channel JoinChannelVideo.swift
Play audio files and audio mixing AudioMixing.swift
Voice effects VoiceChanger.swift
MediaPlayer Kit MediaPlayer.swift
RTMP streaming RTMPStreaming.swift
Audio/video stream SDK/custom encryption StreamEncryption.swift
Video metadata VideoMetadata.swift
Group video chat VideoChat.swift
Pre-call test PrecallTest.swift
Channel media relay MediaChannelRelay.swift
Super resolution SuperResolution.swift
Use multi-processing to send video streams from screen sharing and local camera ScreenShare.swift
Use custom video source (mediaIO) to implement AR function ARKit.swift
Send data stream CreateDataStream.swift
Geofencing GlobalSettings.swift

How to run the sample project

Prerequisites

  • Xcode 10.0+
  • Physical iOS device (iPhone or iPad)
  • iOS simulator is NOT supported

Steps to run

  1. Navigate to the iOS folder and run following command to install project dependencies:

    $ pod install
  2. Open the generated APIExample.xcworkspace file with Xcode.

  3. Edit the KeyCenter.swift file.

    • Replace YOUR APP ID with your App ID.
    • Replace YOUR ACCESS TOKEN with the Access Token.
    struct KeyCenter {
    static let AppId: String = <#Your App Id#>
    
    // assign token to nil if you have not enabled app certificate
    static var Token: String? = <#Temp Access Token#>
    }

    See Set up Authentication to learn how to get an App ID and access token. You can get a temporary access token to quickly try out this sample project.

    The Channel name you used to generate the token must be the same as the channel name you use to join a channel.

    To ensure communication security, Agora uses access tokens (dynamic keys) to authenticate users joining a channel.

    Temporary access tokens are for demonstration and testing purposes only and remain valid for 24 hours. In a production environment, you need to deploy your own server for generating access tokens. See Generate a Token for details.

  4. Build and run the project in your iOS device.

You are all set! Feel free to play with this sample project and explore features of the Agora RTC SDK.

Feedback

If you have any problems or suggestions regarding the sample projects, feel free to file an issue.

Reference

Related resources

  • Check our FAQ to see if your issue has been recorded.
  • Dive into Agora SDK Samples to see more tutorials
  • Take a look at Agora Use Case for more complicated real use case
  • Repositories managed by developer communities can be found at Agora Community
  • If you encounter problems during integration, feel free to ask questions in Stack Overflow

Known issues

After users upgrade their iOS devices to iOS 14.0, and use an app that integrates the Agora RTC SDK for iOS with the version earlier than v3.1.2 for the first time, users see a prompt for finding local network devices. The following picture shows the pop-up prompt:

Refer to the this FAQ to learn how to fix this issue.

License

The sample projects are under the MIT license.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published