Objective-C version of the API demo. Mirrors cases from APIExample/ but uses
Objective-C instead of Swift.
pod install # install CocoaPods dependencies
# Then open APIExample-OC.xcworkspace in Xcode and build (Cmd+B)Edit APIExample-OC/Common/KeyCenter.m:
+ (NSString *)AppId {
return @"YOUR_APP_ID";
}
+ (NSString *)Certificate {
return nil; // leave nil if App Certificate is not enabled
}See ARCHITECTURE.md for the full registration mechanism. The required steps are:
-
Create an example folder under
APIExample-OC/Examples/Basic/orAPIExample-OC/Examples/Advanced/:<ExampleName>.h/<ExampleName>.mcontaining both Entry and Main classes<ExampleName>.storyboardwith two scenes: Entry (EntryViewController) and Main
-
Add a
MenuItemto the+[MenuSection menus]method inAPIExample-OC/ViewController.m:[[MenuItem alloc] initWithName:@"My New Case".localized storyboard:@"MyNewCase" controller:@""]
-
Build and run — the case appears in the list.
- Do NOT add audio-only cases that require
AgoraAudio_iOSexclusivity — useAPIExample-Audio/instead. - Do NOT use SwiftUI or UIKit Storyboards with Swift — this project is Objective-C + Storyboards only.
- Do NOT introduce Swift files — this project is Objective-C only.
- Each case must create and destroy its own
AgoraRtcEngineKitinstance. - Always call
[agoraKit leaveChannel:]before[AgoraRtcEngineKit destroy]when the screen is dismissed. AgoraRtcEngineDelegatecallbacks may arrive on a background thread — dispatch UI updates to the main thread.- Always request camera/microphone permissions before calling
joinChannelByToken:.
ARCHITECTURE.md— full directory layout, case registration internals, Entry/Main pattern details