{"id":36624005,"url":"https://github.com/memfault/memfault-cloud-ios","last_synced_at":"2026-01-12T09:29:48.805Z","repository":{"id":62447744,"uuid":"233815458","full_name":"memfault/memfault-cloud-ios","owner":"memfault","description":"Memfault iOS Cloud Library","archived":false,"fork":false,"pushed_at":"2025-04-11T15:12:03.000Z","size":103,"stargazers_count":0,"open_issues_count":1,"forks_count":3,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-07-24T02:10:01.523Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/memfault.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-14T10:25:17.000Z","updated_at":"2025-04-11T15:12:11.000Z","dependencies_parsed_at":"2022-11-01T23:06:24.332Z","dependency_job_id":null,"html_url":"https://github.com/memfault/memfault-cloud-ios","commit_stats":null,"previous_names":["memfault/memfault-ios-cloud"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/memfault/memfault-cloud-ios","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memfault%2Fmemfault-cloud-ios","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memfault%2Fmemfault-cloud-ios/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memfault%2Fmemfault-cloud-ios/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memfault%2Fmemfault-cloud-ios/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/memfault","download_url":"https://codeload.github.com/memfault/memfault-cloud-ios/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memfault%2Fmemfault-cloud-ios/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28337723,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T06:09:07.588Z","status":"ssl_error","status_checked_at":"2026-01-12T06:05:18.301Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-12T09:29:48.736Z","updated_at":"2026-01-12T09:29:48.794Z","avatar_url":"https://github.com/memfault.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MemfaultCloud iOS Library\n\n## Demo App\n\nThe Xcode workspace `Example/MemfaultCloud.xcworkspace` contains a `DemoApp`\ntarget. This is a very basic iOS app that demonstrates the functionality of this\nlibrary.\n\nBefore building the app, make sure to update the Project Key in\n`AppDelegate.swift`. To find your Project Key, log in to\nhttps://app.memfault.com/ and navigate to Settings.\n\n```swift\nclass AppDelegate: UIResponder, UIApplicationDelegate {\n\n    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -\u003e Bool {\n        // Enable debug logs:\n        gMFLTLogLevel = .debug\n\n        MemfaultApi.configureSharedApi([\n            kMFLTProjectKey: \"\u003cYOUR_PROJECT_KEY_HERE\u003e\",\n        ])\n        return true\n    }\n}\n```\n\n## Integration Guide\n\n### Adding MemfaultCloud to your project\n\n#### Swift Package Manager\n\nAdd this line to your dependencies list in your Package.swift:\n\n```\n.package(name: \"MemfaultCloud\", url: \"https://github.com/memfault/memfault-ios-cloud.git\", from: \"2.2.1\"),\n```\n\n#### CocoaPods\n\nIn case you are using CocoaPods, you can add `MemfaultCloud` as a dependency to\nyour `Podfile`:\n\n```\ntarget 'MyApp' do\n  pod 'MemfaultCloud'\nend\n```\n\nIt's probably a good idea to specify the version to use. See the [Podfile\ndocumentation] for more information.\n\nAfter adding the new dependency, run `pod install` inside your terminal, or from\nCocoaPods.app.\n\n#### Without dependency manager\n\nTo use `MemfaultCloud` without using a dependency manager such as CocoaPods,\njust clone this repo and add the `.h` and `.m` files inside `MemfaultCloud`\nfolder to your project.\n\n### Configuration\n\nThe `MemfaultApi` class is the main class of the MemfaultCloud library. It is\nrecommended to use the `MemfaultApi.sharedApi` property that returns the\nsingleton instance, instead of \"manually\" creating an instance. Using the\nsingleton ensures that requests to our servers are made sequentially, when\nrequired.\n\nBefore using `MemfaultApi.sharedApi`, you will need to configure it once and\nonly once by passing a configuration dictionary to\n`MemfaultApi.configureSharedApi([...])`\n\nThe Project Key is the only mandatory piece of configuration. To find your\nProject Key, log in to https://app.memfault.com/ and navigate to Settings.\n\n```swift\nMemfaultApi.configureSharedApi([\n    kMFLTProjectKey: \"\u003cYOUR_PROJECT_KEY_HERE\u003e\",\n])\n```\n\n### Getting the latest release\n\nThe `api.getLatestRelease` can be used to see if a device is up-to-date or\nwhether there is a new OTA update payload available for it.\n\nThe app is expected to be able to communicate with the device and fetch its\nserial number, hardware version, current software version and type. Create a\n`MemfaultDeviceInfo` object from that information and pass it to\n`api.getLatestRelease`:\n\n```swift\nlet deviceInfo = MemfaultDeviceInfo(\n  deviceSerial: \"DEMO_SERIAL\",\n  hardwareVersion: \"proto\",\n  softwareVersion: \"1.0.0\",\n  softwareType: \"main\")\n\nMemfaultApi.sharedApi.getLatestRelease(for: deviceInfo) { (package, isUpToDate, error) in\n  if error != nil {\n    print(\"There was an error, handle it here.\")\n    return\n  }\n  if package == nil {\n    print(\"Device is already up to date!\")\n    return\n  }\n  print(\"Update available: \\(package!.description)\")\n}\n```\n\nThe `MemfaultOtaPackage package` object has a `location` property, which\ncontains the URL to the OTA payload.\n\n### Uploading Chunks\n\nThe Memfault Firmware SDK packetizes data that needs to be sent back to\nMemfault's cloud into \"chunks\". See\n[this tutorial for more information on the device/firmware details](https://docs.memfault.com/docs/mcu/data-from-firmware-to-the-cloud).\n\nThis iOS library contains a high-level API to submit the chunks to Memfault.\n\nGetting the chunks out of the device and into the iOS app is part of the\nintegration work. The assumption is that you already have a communication\nmechanism between the device and iOS app that can be leveraged.\n\n```swift\n// Array with Data objects, each with chunk bytes\n// (produced by the Memfault Firmware SDK packetizer and sent\n// to the iOS app to be posted to the cloud):\nlet chunks = [...]\n\nMemfaultApi.shared.chunkSender(withDeviceSerial: \"DEMO_SERIAL\").postChunks(chunks)\n```\n\n### Custom Queue Implementations\n\nThe default queue implementation is RAM backed. Therefore, if the host app is\nkilled or the iOS device is shutdown or rebooted, the contents of the queue are\nlost. This can be a reason to override the default queue implementation.\n\nThe library provides a \"hook\" to override the default queue implementation, by\nsetting the `kMFLTChunkQueueProvider` configuration option to an object that\nconforms to `MemfaultChunkQueueProvider`.\n\nWhen using a disk-backed custom queue, we also recommend setting the\n`chunksMaxConsecutiveErrorCount` configuration option to `0` to never drop\nchunks when consecutive errors occur.\n\n```swift\nclass MyQueueProvider: MemfaultChunkQueueProvider {\n    func queue(withDeviceSerial deviceSerial: String) -\u003e MemfaultChunkQueue {\n        // Get or create a queue for the given deviceSerial.\n        // The queue object needs to implement\n        // the MemfaultChunkQueue protocol.\n        let queue = ...\n        return queue\n    }\n}\n\nfunc bootMemfault() {\n    let queueProvider = MyQueueProvider()\n\n    MemfaultApi.configureSharedApi([\n        kMFLTProjectKey: \"\u003cYOUR_PROJECT_KEY_HERE\u003e\",\n\n        // Pass the custom queue provider in the configuration:\n        kMFLTChunkQueueProvider: queueProvider,\n\n        // Never drop chunks on consecutive upload errors:\n        kMFLTChunksMaxConsecutiveErrorCount: 0,\n    ])\n\n    // If your queue implementation persists the contents of the\n    // queues between app restarts, you will need to call postChunks()\n    // after restarting the app. This re-registers the queues that were loaded\n    // from persistent storage and resumes the upload process again:\n\n    let deviceSerialsToResume = [ ... ]\n\n    for sn in deviceSerialsToResume {\n        MemfaultApi.shared.chunkSender(withDeviceSerial: sn).postChunks()\n    }\n}\n```\n\n## API Documentation\n\n`MemfaultCloud.h` contains detailed documentation for each API.\n\n## Unit Tests\n\nThe Xcode workspace `Example/MemfaultCloud.xcworkspace` also contains a\n`MemfaultCloud_Tests` scheme. To run the tests, select this scheme, then select\nProduct \u003e Test (cmd + U).\n\n## Changelog\n\nSee [CHANGELOG.md] file.\n\n[changelog.md]: CHANGELOG.md\n[podfile documentation]: https://guides.cocoapods.org/syntax/podfile.html#pod\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmemfault%2Fmemfault-cloud-ios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmemfault%2Fmemfault-cloud-ios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmemfault%2Fmemfault-cloud-ios/lists"}