Before you start
Prepare OpenIMServer, user credentials, and the iOS project environment before authenticating or sending messages.
Before integrating OpenIM SDK into an iOS application, prepare an accessible OpenIMServer deployment, a trusted user authentication flow, and a project that can install the Objective-C SDK.
Prepare OpenIMServer
If OpenIMServer is not yet available, follow the Docker deployment guide, then confirm that both physical devices and simulators can reach these endpoints:
| Field | Description |
|---|---|
apiAddr | OpenIMServer HTTP API endpoint used for login, synchronization, and resource requests. |
wsAddr | OpenIMServer WebSocket endpoint used for persistent connections and real-time events. |
Production environments should use valid HTTPS and WSS certificates. Do not verify access only from the development machine; also test mobile networks, enterprise proxies, and the application's App Transport Security configuration.
Prepare the user and token
userID identifies an OpenIMSDK user, and the token authenticates that user. User creation, token issuance, and business authorization must be handled by a trusted backend. The iOS application must not store administrator tokens, secrets, or other server credentials.
For the backend flow, see Prepare to use Platform API and Issue a session token. Maintain a stable mapping between the business account and OpenIMSDK userID, and ensure the token belongs to that same userID.
Prepare the iOS project
Integrate the SDK through CocoaPods. The public OpenIMSDK.podspec declares iOS 11.0 as its minimum deployment version, so the application's deployment target cannot be earlier than iOS 11.0. The project must also be able to reach OpenIMServer and include usage descriptions for any system capabilities it actually uses, such as the photo library, camera, microphone, or file access.
pod 'OpenIMSDK'After installing dependencies, open the .xcworkspace and import the module in Objective-C files:
@import OpenIMSDK;Continue the integration
After completing these preparations, read Integrate for the runtime environment to initialize the SDK, then continue with Authenticate and manage the session.
Was this page helpful?