https://github.com/guillaumealgis/simplemdm-swift
Swift bindings for the SimpleMDM API
https://github.com/guillaumealgis/simplemdm-swift
mdm rest-api simplemdm
Last synced: 11 days ago
JSON representation
Swift bindings for the SimpleMDM API
- Host: GitHub
- URL: https://github.com/guillaumealgis/simplemdm-swift
- Owner: guillaumealgis
- License: mit
- Created: 2018-10-21T22:21:45.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2022-05-11T21:36:13.000Z (about 4 years ago)
- Last Synced: 2025-10-09T18:41:07.810Z (10 months ago)
- Topics: mdm, rest-api, simplemdm
- Language: Swift
- Homepage: https://simplemdm.com/docs/api
- Size: 2.47 MB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# SimpleMDM-Swift
[](https://tldrlegal.com/license/mit-license)
[](https://travis-ci.org/guillaumealgis/SimpleMDM-Swift)
[](https://codecov.io/gh/guillaumealgis/SimpleMDM-Swift)
[](https://swift.org/package-manager/)
[](https://cocoapods.org/pods/SimpleMDM-Swift)
[](https://github.com/Carthage/Carthage)
[](https://swiftpackageindex.com/guillaumealgis/SimpleMDM-Swift)
[](https://swiftpackageindex.com/guillaumealgis/SimpleMDM-Swift)
SimpleMDM-Swift is a cross-platform (iOS, macOS, tvOS, watchOS) SDK to access the SimpleMDM API written in Swift.
**Please Note**: This library is not officially supported by SimpleMDM. It does not currently wrap the complete functionality of the SimpleMDM API. Use at your own risk.
## Features
- Read-only access to all exposed resources (Device, App, etc.) of the REST API
- Supports the pagination API introduced August 15, 2018
- Type-safe
- Asynchronous API, relying on async / await
- High test coverage
- 100% documented
##### System requirements
- Deployment target of iOS 15.0+ / macOS 12+ / tvOS 15+ / watchOS 8+
- Xcode 13.2+
- Swift 5.5+
## Usage
📘 Full documentation is available here: [https://guillaumealgis.github.io/SimpleMDM-Swift/](https://guillaumealgis.github.io/SimpleMDM-Swift/)
```swift
// Just set this once in your applicationDidBecomeActive method
SimpleMDM.APIKey = "233b7a3058694652ae6f62acfcba8be7"
// Get the device with id 42
Device.get(id: 42) { result in
switch result {
case let .failure(error):
print("Could not get device: \(error)")
case let .success(device):
print(device.name)
}
}
// Get all device groups
DeviceGroup.getAll { result in
switch result {
case let .failure(error):
print("Could not get device groups: \(error)")
case let .success(deviceGroups):
print(deviceGroups.map { $0.name })
}
}
```
## Installation
### Swift Package Manager
The [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler and Xcode (starting at version 11).
Adding SimpleMDM-Swift as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`:
```swift
dependencies: [
.package(url: "https://github.com/guillaumealgis/SimpleMDM-Swift.git", .upToNextMajor(from: "0.10.0"))
]
```
Or you can use [Xcode's menu](https://wwdcbysundell.com/2019/xcode-swiftpm-first-look/) in File > Swift Packages > Add Package Dependency.
---
### CocoaPods
To integrate SimpleMDM-Swift into your Xcode project using [CocoaPods](https://cocoapods.org), specify it in your `Podfile`:
```ruby
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '12.0'
target '' do
pod 'SimpleMDM-Swift', '~> 0.10.0'
end
```
Then, run the following command:
```bash
$ pod install
```
---
### Carthage
To integrate SimpleMDM-Swift into your Xcode project using [Carthage](https://github.com/Carthage/Carthage), specify it in your Cartfile:
```python
github "guillaumealgis/SimpleMDM-Swift" == 0.10.0
```
Run `carthage update` to build the framework and drag the built SimpleMDM-Swift.framework into your Xcode project and update your run scripts as appropriate. For additional support, please visit the Carthage [documentation](https://github.com/Carthage/Carthage#if-youre-building-for-ios-tvos-or-watchos).
## Apps using SimpleMDM-Swift
I'd love to hear what you have used SimpleMDM-Swift for, if you would like your app displayed here, please send a pull request!
## License
SimpleMDM-Swift is released under the MIT license. See LICENSE.md for details.
## Related Projects
- [The SimpleMDM REST API documentation](https://simplemdm.com/docs/api/)
- [SimpleMDM/simplemdm-ruby](https://github.com/SimpleMDM/simplemdm-ruby) - Ruby library
- [SteveKueng/simpleMDMpy](https://github.com/SteveKueng/simpleMDMpy) - Python library
## Contact
Guillaume Algis ([@guillaumealgis](https://twitter.com/guillaumealgis))