This topic describes how to integrate Push SDK for iOS.
|System version||iOS 8.0 or later|
|Phone model||iPhone 5S or later|
|CPU architecture||ARM64 or ARMv7|
|Integration tool||Xcode 8.0 or later|
Download the SDK package
|AlivcLivePusherSDK/arm||The edition that applies only to ARM architectures.|
|AlivcLivePusherSDK/arm&simulator||The edition that applies to both ARM and simulator architectures.|
Integrate Push SDK for iOS
After you integrate Push SDK for iOS in manual or pod mode, you must configure permissions to use features and access resources, disable bitcode, and use Push SDK for iOS.
- Integrate Push SDK for iOS in manual or pod mode. If you use manual mode, follow Step 2. If you use pod mode, follow Step 3.
- Integrate Push SDK for iOS in manual mode:
- Create a demo project named DemoPush in Xcode.
- Add the following files to the demo project in Xcode.
To use the retouching and sticker effects, you must also add the following files:
- Select Copy items if needed and click Finish.
- After you import Push SDK for iOS, add the SDK dependencies to the Embedded Binaries section of the General tab in Xcode.
- Integrate Push SDK for iOS in pod mode:
- Open Terminal and run the following command to install CocoaPods. Notice Set up a Ruby environment on macOS in advance.
sudo gem install cocoapods
- In Terminal, run the following command to create a Podfile file in the project path:
- Edit the Podfile file to add Push SDK for iOS as a dependency. To achieve live stream
playback, you can add ApsaraVideo Player SDK as a dependency.
# Integrate Push SDK for iOS. pod 'AlivcLivePusher', '~> 4.4.1' pod 'RtsSDK', '~> 1.8' # Integrate ApsaraVideo Player SDK. pod 'AliPlayerSDK_iOS', '~> 5.4.2' pod 'AliPlayerSDK_iOS_ARTC', '~> 5.4.2'
- In Terminal, run the following command. After the preceding commands are executed,
the project file with the .xcworkspace suffix is generated. Double click the project
file to update and install Push SDK for iOS.
- Open Terminal and run the following command to install CocoaPods.
- Configure the permissions to use features and access resources. Note To use the recording feature and the camera, you must add the related permission configurations to the Info.plist file.Add the following configurations for permissions on the microphone and camera in the Info.plist file: Privacy - Camera Usage Description and Privacy - Microphone Usage Description. If you want to continue stream ingest when the mobile app is switched to the background, you must enable audio recording in the background.
- Disable bitcode. Push SDK for iOS does not support bitcode. Therefore, you must set the Enable Bitcode parameter to No for the demo project.
- Use the SDK.