Git Product home page Git Product logo

ios-uikit's Introduction

Agora UIKit for iOS and macOS

Instantly integrate Agora in your own application or prototype using iOS or macOS.

Requirements

  • Device
    • Either an iOS device with 12.0 or later
    • Or a macOS computer with 10.14 or later
  • Xcode 11 or later
  • *CocoaPods (if installing with CocoaPods)
  • An Agora developer account

Once you have an Agora developer account and an App ID, you're ready to use this pod.

Click here for full documentation

Installation

Swift Package Manager (Recommended, iOS Only)

Add the URL of this repository to your Xcode 11+ Project.

Go to File > Swift Packages > Add Package Dependency, and paste in this link:

https://github.com/AgoraIO-Community/iOS-UIKit

If you are using the developer preview, add 4.0.0-preview in the version box there, otherwise use a version from 1.0.0 up to 2.0.0.


If you have issues installing the Swift Package:

In Xcode's File menu, select 'Swift Packages' and then 'Reset Package Caches'.

CocoaPods

In your iOS or macOS project, add this pod to your repository by adding a file named Podfile, with contents similar to this:

# Uncomment the next line to define a global platform for your project
# platform :ios, '12.0'

target 'Agora-UIKit-Example' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Uncomment the next line if you want to install for iOS
  # pod 'AgoraUIKit_iOS', '~> 1.0'

  # Uncomment the next line if you want to install for macOS
  # pod 'AgoraUIKit_macOS', '~> 1.0'
end

And then install the pods using pod install --repo-update

If any of these steps are unclear, look at "Using Cocoapods" on cocoapods.org. The installation will change slightly once this pod is out of pre-release.

Usage

Once installed, open your application .xcodeproj file. Or .xcworkspace if using CocoaPods.

Decide where you want to add your AgoraVideoViewer, and in the same file import Agora_UIKit or Agora_AppKit for iOS and macOS respectively. Next, create an AgoraVideoViewer object and frame it in your scene like you would any other UIView or NSView. The AgoraVideoViewer object must be provided AgoraConnectionData and a UIViewController/NSViewController on creation.

AgoraConnectionData has two values for initialising. These are appId and rtcToken, as well as an optional rtmToken.

An AgoraVideoViewer can be created like this:

import AgoraRtcKit
import AgoraUIKit_iOS

let agoraView = AgoraVideoViewer(
    connectionData: AgoraConnectionData(
        appId: "my-app-id",
        rtcToken: "my-channel-token",
        rtmToken: "my-channel-rtm-token"
    ),
    style: .grid,
    delegate: self
)

An alternative style is .floating, as seen in the image above.

To join a channel, simply call:

agoraView.join(channel: "test", as: .broadcaster)

Documentation

For full documentation, see our AgoraUIKit documentation page.

Roadmap

  • Muting/Unmuting a remote member
  • Usernames
  • Promoting an audience member to a broadcaster role.
  • Layout for Voice Calls
  • Cloud recording

UIKits

The plan is to grow this library and have similar offerings across all supported platforms. There are already similar libraries for Android, React Native, and Flutter, so be sure to check them out.

ios-uikit's People

Contributors

digitallysavvy avatar maxxfrazer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.