Requirements
- Xcode 14.3+
- iOS 13.0+
- Swift 5.0+
Installation
Add the social.plus SDK to your project using Swift Package Manager:
- In Xcode, select File → Add Package Dependencies
- Enter the repository URL:
- Select Up to Next Major Version and click Add Package
- Choose AmitySDK and click Add Package
Use “Up to Next Major Version” to ensure compatibility with future updates.
Objective-C Integration
Starting with v6.0.0, AmitySDK for iOS is written in Pure Swift. You can still use it in Objective-C projects by creating a Mixed-Language Project.
We recommend integrating AmitySDK directly into your Objective-C project and using Swift language to call the SDK interfaces for better compatibility and performance.
Mixed Language Project Setup
Create Swift files with necessary interfaces/methods that interact with AmitySDK. These interfaces should be exposed with@objc
or @objcMembers
attributes.
When you add a new Swift file to your Objective-C project, Xcode automatically generates a bridging header file that exposes your Swift code to Objective-C.
📖 Learn More: Importing Swift into Objective-C - Apple Developer
Implementation Example
Create a Swift file that wraps AmitySDK functionality:
Key Considerations
Project Configuration
Project Configuration
Bridging Header: Xcode automatically creates a bridging header when you add Swift files to an Objective-C project.Import Statement: Use
#import "YourProjectName-Swift.h"
to access Swift classes in Objective-C.Target Membership: Ensure your Swift files are added to the correct target.Performance Tips
Performance Tips
Minimize Bridge Calls: Create comprehensive wrapper methods rather than making frequent cross-language calls.Error Handling: Properly handle Swift optionals and errors in your Objective-C code.Threading: Always dispatch UI updates to the main queue when handling completion callbacks.
Common Issues
Common Issues
Module Not Found: Ensure your project’s module name doesn’t contain special characters or spaces.Swift Version: Make sure your Objective-C project supports the Swift version used by AmitySDK.Linker Errors: Verify that both Objective-C and Swift files are properly linked to your target.
Next Steps
Authentication Guide
Learn about session management and secure authentication flows
Chat Features
Start building chat and messaging features
Social Features
Add posts, feeds, and social interactions
Video Streaming
Implement live video and streaming features
Troubleshooting
Build Issues
Build Issues
Framework not found: Ensure you’ve added all required frameworks and set them to “Embed & Sign”M1 Mac Simulator Issues: Enable Rosetta for your application in XcodeSwift version conflicts: Ensure your project uses Swift 5.0 or later
Runtime Issues
Runtime Issues
SDK not initialized: Make sure you call
AmityClient.setup(...)
in application
delegateAuthentication failures: Verify your API key and region settingsPermission denied: Check that required permissions are added to Info.plist