Before you start
Prepare OpenIMServer, user credentials, and the iOS project environment before authenticating or sending messages.
Before integrating the OpenIM iOS SDK into an application, ensure you have an accessible OpenIMServer deployment, valid user authentication credentials, and an Xcode project configured for Objective-C dependencies.
Prepare OpenIMServer
If you do not have an active OpenIMServer instance, deploy one using the Docker deployment guide. Verify that both physical devices and iOS simulators can reach the following endpoints:
| Endpoint | Description |
|---|---|
apiAddr | OpenIMServer HTTP API base URL, utilized for authentication, data synchronization, and media uploads. |
wsAddr | OpenIMServer WebSocket URL, utilized for persistent socket connections and real-time events. |
Production environments require valid HTTPS and WSS certificates. Verify connectivity across cellular networks, Wi-Fi connections, and corporate proxies, and ensure your iOS project's App Transport Security (ATS) settings permit network traffic to these endpoints.
Prepare user credentials and tokens
In the OpenIM architecture, userID uniquely identifies an account, and token authenticates that user session. Your business backend manages user authentication and issues matching userID and token pairs to the iOS client.
Refer to Prepare to use Platform API and Issue a session token for server-side generation details. Maintain a consistent 1:1 mapping between your internal user accounts and OpenIM user IDs, and verify that the issued token matches the requested userID.
Prepare the iOS project
Integrate the SDK using CocoaPods. The public OpenIMSDK.podspec specifies a minimum deployment target of iOS 11.0; ensure your app target's deployment target is set to iOS 11.0 or higher. Add permission descriptions to Info.plist for system capabilities you plan to use, such as camera, microphone, and photo library access.
Add the pod dependency to your Podfile:
pod 'OpenIMSDK'Run pod install, open the generated .xcworkspace, and import the module in your source files:
@import OpenIMSDK;Next steps
Once you finish prerequisites, proceed to Integrate for the runtime environment to initialize the SDK, followed by Authenticate and manage the session.
Was this page helpful?