Swift Package Manager (SPM) wrapper for the M-Pesa Multiplatform SDK.
This repository provides a Swift Package Manager-compatible distribution of the M-Pesa Multiplatform SDK so that iOS/macOS/tvOS/watchOS projects can easily consume the SDK without needing to build or embed the raw Kotlin Multiplatform sources directly.
It ships the prebuilt Kotlin/Native XCFramework produced by the core SDK and exposes them as an SPM binary target.
The M-Pesa Multiplatform SDK is an unofficial Kotlin Multiplatform SDK that simplifies integration with the Vodacom Mozambique M-Pesa APIs for Customer-to-Business (C2B) checkout flow, providing UI flow, encryption, and reactive transaction status reporting.
This Swift package wraps that SDK distribution (the XCFramework) so native Swift projects can depend on it using SPM.
- Open your Xcode project
- Go to File → Add Packages…
- Paste this package URL:
https://github.com/nand-industries/mpesa-multiplatform-sdk-swift-package - Select a version: recommended: use the latest tag
- See how to initialize the SDK and use its APIs in the docs
You should load resources manually due to this issue (KT-66790) otherwise you may run into a MissingResourcesException when launching the checkout flow in your iOS app.
A similar approach to this comment is required.
- Download the asset
MpesaMultiplatformSdk.xcframework.zipfrom the corresponding release here. - Unzip the file and copy the directory
composeResourcesand move it to a directorycompose-resources - In Xcode add the
compose-resourcesdirectory to the Copy Bundle Resources build phase
CADisableMinimumFrameDurationOnPhone is an iOS app setting (in Info.plist) that developers add to enable smooth, high refresh rates (like 120Hz ProMotion) on compatible iPhones, preventing the system from capping animations at 60Hz.
Make sure to turn ON this setting in your Info.plist, to avoid a low performance UI or even a crash.
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>