-
Notifications
You must be signed in to change notification settings - Fork 11
Swift Package Manager integration
Starting from plugin version 8.5.0, the iOS side of the Mobile Messaging Cordova plugin supports Swift Package Manager (SPM) as the dependency manager, in addition to the existing CocoaPods integration.
CocoaPods will still be fully supported until December 2nd, 2026, when they will be scheduled to become permanently read-only. If you are not ready to migrate or your toolchain requires cordova-ios v7, you can continue using CocoaPods and will receive all plugin updates as before. Until then, no action is required. After December 2nd, the iOS side of the plugin will only be updated with Swift Package Manager.
The plugin now ships both a Package.swift manifest (for SPM) and a <podspec> block in plugin.xml (for CocoaPods). Which one is used depends entirely on your version of cordova-ios:
| cordova-ios version | Dependency manager used |
|---|---|
| v7.x | CocoaPods (<podspec>) |
| v8.x and above | Swift Package Manager (Package.swift) |
- No changes to your
config.xmlor plugin configuration are needed, as the correct path is selected automatically atcordova platform add iostime. - In case Swift Package Manager is not available in application, CocoaPods will be used.
To use SPM you need:
- cordova-ios v8.0.0 or higher
- Xcode 16 or higher
- NodeJS 20.17 or higher
-
iOS deployment target 15.0 or higher (set in your
config.xml)
The official release notes for Cordova iOS v8 can be found here.
In your project's package.json, update the cordova-ios and the com-infobip-plugins-mobilemessaging plugin version:
"devDependencies": {
"cordova-ios": "^8.0.0",
"com-infobip-plugins-mobilemessaging": "^8.5.0" // or above
}Then install:
npm install<platform name="ios">
<preference name="SwiftVersion" value="5.0" />
<preference name="deployment-target" value="15.0" />
</platform>In case the application was using cordova-ios@7.x.x previously, the iOS platform needs to be removed and re-added to the project.
Remove and re-add the iOS platform so cordova-ios v8 sets up SPM instead of CocoaPods:
cordova platform remove ios
cordova platform add iosDuring cordova platform add ios, messages from SPM resolving packages instead of CocoaPods running pod install will be shown, along with the Notification Service Extension (NSE) being added to the new project.
The MobileMessaging SDK and its dependencies are fetched via SPM from the mobile-messaging-sdk-ios repository.
Open the generated App.xcworkspace in Xcode and build normally. No Podfile or pod install is involved.
| CocoaPods (cordova-ios v7) | SPM (cordova-ios v8+) | |
|---|---|---|
| Dependency resolution |
pod install at prepare time |
Xcode resolves packages at build time |
| Lockfile | Podfile.lock |
Package.resolved |
| Workspace structure |
Pods/ directory alongside the project |
packages/ directory inside the platform folder |
If you use the Notification Service Extension (for delivery improvements and rich push), the setup is the same regardless of which dependency manager you use. The IOS_EXTENSION_APP_GROUP configuration in the application's config.xml file needs to be set, and the plugin handles the rest automatically.
With CocoaPods, the extension pod is added to the Podfile. With SPM, the extension dependency is resolved through the same Package.swift.
If you are not ready to migrate, simply keep cordova-ios v7 in your project. No changes to the plugin are needed. The <podspec> block remains in plugin.xml and CocoaPods will continue to be used exactly as before.
"devDependencies": {
"cordova-ios": "^7.1.1"
}The plugin will receive updates, including new features and bug fixes with the CocoaPods integration, until the official CocoaPods Trunk becomes permanently read-only. After that period, the iOS part of the plugin will receive regular updates only via Swift Package Manager.
Ensure you have a stable internet connection when running cordova platform add ios for the first time, as Xcode needs to fetch packages from GitHub.
If you see a warning about deployment target being too low (e.g. 11.0), ensure your config.xml has deployment-target set to 15.0 or higher inside <platform name="ios">.
Run a full platform remove/add to ensure the platform directory is regenerated with the new cordova-ios version:
cordova platform remove ios
cordova platform add iosIf you have any questions or suggestions, feel free to send an email to support@infobip.com or create an issue.
- Library events
- Server errors
- Users and installations
- Messages and notifications management
- Inbox
GeofencingDEPRECATED- Privacy settings
- In-app chat
- Migration guides
- Migration guide to version 8.5.x
- Migration guide to version 8.3.x
- Migration guide to version 8.1.x
- Migration guide to version 7.9.x
- Migration guide to version 7.x.x
- Migration guide to version 6.2.x
- Migration guide to version 6.1.x
- Migration guide to version 6.x.x
- Migration guide to version 1.x.x
- Migration guide to version 2.2.x
- Migration guide to version 3.x.x
- Migration guide to version 4.x.x
- Migration guide to version 4.1.x
- Swift Package Manager integration
- Troubleshooting
- JSON Web Token (JWT) structure and generation example
- Trusted Domains Security