Run the RoomKit sample code
- Contact ZEGO Sales to enable the RoomKit service and obtain your RoomKit Admin Console login account and password.
- Log in to RoomKit Admin Console to obtain the SecretID, SecretSign, and ProductID, which are required for initializing the RoomKit SDK.
- Make sure your development environment meets the following requirements:
- Xcode 7.0 or later.
- An iOS device or simulator running iOS 9.0 or later (we recommend you use a real device).
- The iOS device is connected to the internet.
- CocoaPods installed.
While the sample code shows that it is possible to get the SDK access token required for the subsequent login process by directly specifying the SecretID and SecretSign in the client code, don't use this approach when you develop your own app. To ensure system security, get the SDK access token by posting a Get SDK access token request from your application server to the RoomKit server.
Run the sample code
Download the RoomKit sample code.
Open Terminal, go to the directory where the Podfile is located, and run the command
pod repo updateto update the local dependency library index. This step may take a while ( about 3 to 20 minutes) to complete, depending on your network condition,
Run the command
pod installand wait for all the dependent libraries to be downloaded (the size of RoomKit related SDKs is about 300 MB).
Double-click the file
ZegoRoomkitDemo.xcworkspacein the unzipped folder.
Change the bundle identifier and signing certificate.
a. In the Xcode project navigator, click the project ZegoRoomkitDemo.
b. Select the target ZegoRoomkitDemo, click Signing & Capabilities, then under Signing, choose your team from the Team pop-up menu, and change Bundle Identifier and App Groups to your own value. Repeat the same steps for the extension target ZegoRoomkitDemoScreenShare.
For the target ZegoRoomkitDemo, change the settings as indicated below:
For the extension target ZegoRoomkitDemoScreenShare, change the settings as indicated below:
Modify the source file
Specify the values of the parameters that are required for initializing the RoomKit SDK, including
kProductID. You must use the values you obtained according to the procedure mentioned in the Prerequisites section above. Otherwise, the sample code will not run correctly.
Connect the iOS device to your development computer. Then, from the scheme menu in the Xcode toolbar, choose the connected iOS device (or an iOS simulator) as the run destination.
Click the Run button in the toolbar to build and run the sample code.