/aircore-media-panel-ios-samples

Sample apps for the Aircore Sync Audio SDK for iOS. Quickly add high-quality, real-time voice chat to your app, using a pre-built design that you can customize.

Primary LanguageSwiftMIT LicenseMIT

MediaPanel SDK iOS Samples

The samples in this repository demonstrate how to use the Aircore MediaPanel SDK. For more information, check out the getting started guide or the API reference.

Setup
git clone https://github.com/aircoreio/aircore-media-panel-ios-samples.git
Launch
  1. Ensure you have Xcode 13.3+ installed.
  2. Open Finder and navigate to the directory where you checked out the code.
  3. For the SwiftUI sample, launch aircore-media-panel-ios-samples -> MediaPanel-SwiftUI -> MediaPanel-SwiftUI.xcodeproj.
  4. For the Swift sample, launch aircore-media-panel-ios-samples -> MediaPanel-UIKit-Swift -> MediaPanel-UIKit-Swift.xcodeproj.
  5. For the Objective-C sample, launch aircore-media-panel-ios-samples -> MediaPanel-UIKit-ObjC -> MediaPanel-UIKit-ObjC.xcodeproj.

Customization

  1. From the Xcode Project Navigator, open the Info.plist file.
  2. Replace INSERT_PUBLISHABLE_API_KEY_FROM_DEVELOPER_DASHBOARD with a Publishable API Key from the developer dashboard.
  3. Open MediaPanel_SwiftUIApp.swift for the SwiftUI sample, ViewController.swift for the Swift sample, or ViewController.m for the Objective-C sample.
  4. Change these values as per your needs:
SwiftUI/Swift
let userId = UUID.init().uuidString // Replace with any unique ID that represents your user in your system.
lazy var userName = "User " + userId.prefix(5) // Replace with any name that represents your user in your system.
lazy var userAvatarURL = URL(string: "https://i.pravatar.cc/300?u=" + userId) // Replace with a url for a profile picture that represents your user in your system.
let channel = "sample-app" // Replace with any unique name/id that represents a channel in your system.
Objective-C
NSString *userId = [NSUUID UUID].UUIDString; // Replace with any unique ID that represents your user in your system.
NSString *userName = [NSString stringWithFormat:@"User %@", [userId substringToIndex:5]]; // Replace with any name that represents your user in your system.
NSString *avatarUrl = [NSString stringWithFormat:@"https://i.pravatar.cc/300?u=%@", userId];  // Replace with a url for a profile picture that represents your user in your system.
NSString *const kChannelId = @"sample-app"; // Replace with any unique name/id that represents a channel in your system.
Running the Sample
  1. Choose a simulator or an actual device (if you're running on a M1 mac)
  2. Tap the ▷ button to run the sample