This app demonstrates using the Agora's Signaling SDK for real-time communication in a SwiftUI app.
The example app is a documentation reference for iOS and macOS, designed to enhance your productivity and understanding. It's built to be flexible, easily extensible, and beginner-friendly.
Note: ℹ️ Please note that the code examples provided in this repository are for demonstration purposes only and are not officially supported by Agora. They may not reflect the latest best practices or updates in Agora's SDK. For the latest updates, please refer to Agora's Official Documentation.
Use these examples as a reference and modify them to suit your specific needs.
You'll find numerous examples illustrating the functionality and features of this reference app in the root directory. Each example is self-contained in its own directory, providing an easy way to understand how to use the app. For more information about each example, see the README file within its directory.
- Stream channels
- Presence
- Store channel and user data
- Connect through restricted networks with Cloud Proxy
- Data encryption
Before getting started with this example app, please ensure you have the following software installed on your machine:
- Xcode 14.0 or later.
- Swift 5.8 or later.
-
Clone the repository
To clone the repository to your local machine, open Terminal and navigate to the directory where you want to clone the repository. Then, use the following command:
git clone https://github.com/AgoraIO/signaling-sdk-samples-ios.git
-
Open the project
Navigate to Example-App, and open Example-App.xcodeproj.
All dependencies are installed with Swift Package Manager, so will be fetched automatically by Xcode.
-
Update Signing
As with any Xcode project, head to the target, "Signing & Capabilities", and add your team, and modify the bundle identifier to make it unique.
-
Modify the project configuration
The app loads connection parameters from the config.json
file. Ensure that the
file is populated with the required parameter values before running the application.
- `uid`: The user ID associated with the application, or identifierForVendor to take the device ID.
- `appId`: (Required) The unique ID for the application obtained from [Agora Console](https://console.agora.io).
- `channelName`: The default name of the channel to join.
- `token`: A token generated for `uid`. You generate a temporary token using the [Agora token builder](https://agora-token-generator-demo.vercel.app/).
- `tokenUrl`: The URL for the token generator. See [Secure authentication with tokens](./authentication-workflow) for information on how to set up a token server.
If a valid tokenUrl
is provided, all samples use the token server to obtain a token except the SDK quickstart project that uses the token
. If a tokenUrl
is not specified, all samples except Secure authentication with tokens use the token
from config.json
.
-
Build and run the project
To build and run the project, use the build button (Cmd+R) in Xcode. Select your preferred device/simulator as the scheme.
Default Chat View |
---|
If you have any questions, issues, or suggestions, please file an issue in our GitHub Issue Tracker.