{"id":15022409,"url":"https://github.com/contentful/contentful.objc","last_synced_at":"2025-10-19T17:30:39.729Z","repository":{"id":15103229,"uuid":"17830008","full_name":"contentful/contentful.objc","owner":"contentful","description":"Objective-C SDK for Contentful's Content Delivery API and Content Management API.","archived":true,"fork":false,"pushed_at":"2023-10-26T13:42:17.000Z","size":18441,"stargazers_count":50,"open_issues_count":12,"forks_count":28,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-10-29T17:20:04.263Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/contentful.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-03-17T14:05:15.000Z","updated_at":"2024-05-08T10:49:03.000Z","dependencies_parsed_at":"2024-06-18T21:19:14.767Z","dependency_job_id":"382c2faa-b2ba-46a0-a0ce-b72b38c7d264","html_url":"https://github.com/contentful/contentful.objc","commit_stats":{"total_commits":920,"total_committers":14,"mean_commits":65.71428571428571,"dds":"0.15000000000000002","last_synced_commit":"136bbc1a9f6b0517eec69036f6c1eb476d344ff5"},"previous_names":[],"tags_count":49,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contentful%2Fcontentful.objc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contentful%2Fcontentful.objc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contentful%2Fcontentful.objc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contentful%2Fcontentful.objc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/contentful","download_url":"https://codeload.github.com/contentful/contentful.objc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237172432,"owners_count":19266672,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-09-24T19:57:54.817Z","updated_at":"2025-10-19T17:30:38.880Z","avatar_url":"https://github.com/contentful.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# contentful.objc\n\n[![Version](https://img.shields.io/cocoapods/v/ContentfulDeliveryAPI.svg?style=flat)](http://cocoadocs.org/docsets/ContentfulDeliveryAPI)\n[![License](https://img.shields.io/cocoapods/l/ContentfulDeliveryAPI.svg?style=flat)](http://cocoadocs.org/docsets/ContentfulDeliveryAPI)\n[![Platform](https://img.shields.io/cocoapods/p/ContentfulDeliveryAPI.svg?style=flat)](http://cocoadocs.org/docsets/ContentfulDeliveryAPI)\n[![Build Status](https://img.shields.io/travis/contentful/contentful.objc/master.svg?style=flat)](https://travis-ci.org/contentful/contentful.objc)\n[![Coverage Status](https://img.shields.io/coveralls/contentful/contentful.objc.svg)](https://coveralls.io/github/contentful/contentful.objc)\n\n\n\u003e #### Deprecation notice for ContentfulDeliveryAPI SDK\n\u003e \n\u003e Contentful will stop supporting the ContentfulDeliveryAPI SDK **January 18, 2019**. The source code will still be available, but feature and support requests will no longer be addressed. Migrate to [contentful.swift](https://github.com/contentful/contentful.swift) to continue using Contentful on iOS, tvOS, watchOS, or macOS.\n\u003e \n\u003e #### Deprecation notice for ContentfulManagementAPI SDK\n\u003e \n\u003e Contentful stopped supporting the ContentfulManagementAPI SDK **JULY 13, 2018**. The source code is still available, but feature and support requests are no longer being addressed. If you must take advantage of a feature from the Content Management API, or fix a bug, it is recommended that you either fork this codebase, or implement API interaction your own. \n\u003e \n\n#### It is recommended to use [contentful.swift](https://github.com/contentful/contentful.swift) over contentful.objc as future development at Contentful will focus on Swift rather than Objective-C.\n\n#### Full feature comparison of contentful.swift \u0026 contentful.objc\n\n| CDA Features | contentful.swift | contentful.objc |\n| -----------  | ----------- | ----------- |\n| API coverage* | :white_check_mark: | :white_check_mark: |\n| Images API | :white_check_mark: | :white_check_mark: |\n| Search Parameters | :white_check_mark: | :no_entry_sign: |\n| Fallback locales for sync api | :white_check_mark: | :no_entry_sign: |\n| Rate limit handling | :white_check_mark: | :no_entry_sign: |\n| Space environments | :white_check_mark: | :no_entry_sign: |\n\n*API Coverage definition: all endpoints can be interfaced with and complex queries can be constructed by passing in dictionaries of http parameter/argument pairs. Note that the Swift SDK provides much more comprehensive coverage and takes advantage of type system, outdoing the \"stringly typed\" interface that the Objective-C SDK offers.\n\n\nObjective-C SDK's for [Contentful's][1] Content Delivery API.\n\n[Contentful][1] provides a content infrastructure for digital teams to power content in websites, apps, and devices. Unlike a CMS, Contentful was built to integrate with the modern software stack. It offers a central hub for structured content, powerful management and delivery APIs, and a customizable web app that enable developers and content creators to ship digital products faster.\n\n## Usage\n\nThe `CDAClient` manages all your interaction with the Contentful Delivery API.\n\n```objective-c\nCDAClient* client = [[CDAClient alloc] initWithSpaceKey:@\"cfexampleapi\" accessToken:@\"b4c0n73n7fu1\"];\n[client fetchEntryWithIdentifier:@\"nyancat\"\n                         success:^(CDAResponse *response, CDAEntry *entry) {\n                             NSLog(@\"%@\", entry.fields);\n                         }\n                         failure:^(CDAResponse *response, NSError *error) {\n                             NSLog(@\"%@\", error);\n                         }];\n```\n\nYou can query for entries, assets, etc. with query options similar to what is described in the [Delivery API Documentation][6]:\n\n```objective-c\n[client fetchEntriesMatching:@{ @\"content_type\": @\"cat\" }\n                     success:^(CDAResponse *response, CDAArray *entries) {\n                         NSLog(@\"%@\", [[entries.items firstObject] fields]);\n                     }\n                     failure:^(CDAResponse *response, NSError *error) {\n                         NSLog(@\"%@\", error);\n                     }];\n```\n\nResults are returned as object of classes `CDAEntry`, `CDAAsset`, `CDAContentType` or `CDASpace`, depending on the fetch method being called. If there are multiple results, they will be returned as a `CDAArray` instance, which encapsulates the actual resources in the *items* property.\n\nThis repository contains multiple examples, demonstrating the use in common real world\nscenarios and also showing the different ways you can integrate the SDK into your own project.\n\n### Using Custom Entry Classes\n\nYou might want to subclass `CDAEntry` to store additional data alongside Entries or to decouple the rest of your app from the Contentful SDK's API. For this purpose, it is possible to register your own custom classes for specific Content Types, like this:\n\n```objective-c\n[client registerClass:[MYSuperCoolClass class] forContentTypeWithIdentifier:@\"MyContentType\"];\n```\n\nEach time, the receiver needs to create a new Entry object of the given Content Type, it will create instances of `MYSuperCoolClass`. Make sure that the class inherits from `CDAEntry` or this mechanism will break at runtime.\n\n### Offline Support\n\nMobile devices will not always have a data connection, so it makes sense to cache data received from Contentful for offline use. The SDK brings two mechanisms which can help with that:\n\nAll Resource classes support `NSCoding` and bring convenience methods for storing and loading from flat files:\n\n```objective-c\n[someEntry writeToFile:@\"/some/path\"];\nCDAEntry* readEntry = [CDAEntry readFromFile:@\"/some/path\" client:client];\n```\n\nMost of the UIKit extensions have an `offlineCaching` property which transparently uses this mechanism for showing content when offline.\n\nIf you rather use another solution, there is the abstract `CDAPersistenceManager` class with a [sample implementation](https://github.com/contentful/contentful-persistence.objc/blob/master/Code/CoreDataManager.m) for Core Data. It supports mapping Resources to another method for managing your object graph easily and ties this to the Contentful synchronization API. Check out the Core Data example app for integrating it yourself.\n\nIn both cases, you can use the `offlineCaching_cda` property of the SDK's `UIImageView` category to make any image view transparently cache its contents in a flat file on disk. This will only cache images that the user has viewed once while the app was online.\n\n### Preview Mode\n\nThe Content Delivery API only returns published Entries. However, you might want to preview content in your app before making it public for your users. For this, you can use the preview mode, which will return **all** Entries, regardless of their published status:\n\n```objective-c\nCDAConfiguration* configuration = [CDAConfiguration defaultConfiguration];\nconfiguration.previewMode = YES;\n\nCDAClient* client = [[CDAClient alloc] initWithSpaceKey:@\"YourSpaceKey\"\n                                            accessToken:@\"YourAccessToken\"\n                                          configuration:configuration];\n```\n\nApart from the configuration option, you can use the SDK without modifications with one exception: you need to obtain a preview access token, which you can get in the \"API\" tab of the Contentful app. In preview mode, data can be invalid, because no validation is performed on unpublished entries. Your app needs to deal with that. Be aware that the access token should in no case be shipped with a production app.\n\n### UIKit Extensions\n\nThe SDK contains some extensions of UIKit classes for common use cases. You can see a lot of them in action in the examples or read [this blog post][11] with details on some of them.\n\n## Documentation\n\nFor further information, check out the [Developer Documentation][6] or browse the [API documentation][7]. The latter can also be loaded into Xcode as a Docset.\n\n## Installation\n\n### CocoaPods\n\n[CocoaPods][2] is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like the Contentful Delivery API in your projects.\n\n```ruby\nplatform :ios, '8.0'\npod 'ContentfulDeliveryAPI'\n```\n\nThis is the easiest way to keep your copy of the Contentful Delivery API updated.\n\nFor Swift support using iOS 8, you can enable framework support usage in [CocoaPods][2]:\n\n```ruby\nplatform :ios, '8.0'\nuse_frameworks!\npod 'ContentfulDeliveryAPI'\n```\n\n### Manual integration\n\nIn the case you prefer to manage your dependencies manually, you can just drag all files from the `Code` subdirectory into your project or integrate the `ContentfulDeliveryAPI` static library target into your build process. It might be a good idea to add this repository as a [Git submodule][5] if you choose this path.\n\nBe aware that the Contentful Delivery API requires both [AFNetworking][3] and [ISO8601][4] to compile successfully, so you need to provide these dependencies if you do manual integration.\n\n### Static Framework\n\nYou can [download][8] the Contentful Delivery API as an universal static framework for iOS. Integrate it into your project by unzipping and dragging the `ContentfulDeliveryAPI.framework` into the `Frameworks` group of your project. You can also [download][9] the UFO example application including the static framework, as an example of integrating it into an Xcode project.\n\nThe static framework contains [AFNetworking][3] and [ISO8601][4], but they are prefixed so that they do not clash with any copies that might already be part of your application.\n\nIt depends on the `SystemConfiguration.framework` not included by default in iOS projects, so open your project file on the `General` tab.\n\n![](Screenshots/GeneralTab.png)\n\nClick the `+` button in the `Linked Frameworks and Libraries` section at the bottom.\n\n![](Screenshots/Frameworks.png)\n\nSearch for *SystemConfiguration* and add the framework to your project.\n\n![](Screenshots/SearchForFramework.png)\n\nRepeat that with *MobileCoreServices*, as that framework is also required to be in your project.\n\n## Unit Tests\n\nThe Contentful Delivery API is fully unit tested.\n\nTo run the tests, do the following steps:\n\n    $ gem install xcpretty cocoapods cocoapods-testing\n    $ make test\n\nor run them directly from Xcode.\n\n## License\n\nCopyright (c) 2014, 2015 Contentful GmbH. See LICENSE for further details.\n\n\n[1]: https://www.contentful.com\n[2]: https://cocoapods.org/\n[3]: https://github.com/AFNetworking/AFNetworking\n[4]: https://github.com/soffes/ISO8601\n[5]: http://git-scm.com/docs/git-submodule\n[6]: https://www.contentful.com/developers/docs/references/content-delivery-api/\n[7]: http://cocoadocs.org/docsets/ContentfulDeliveryAPI/1.10.4/\n[8]: http://static.contentful.com/downloads/iOS/ContentfulDeliveryAPI-1.10.4.zip\n[9]: http://static.contentful.com/downloads/iOS/UFO.zip\n[11]: https://www.contentful.com/blog/2014/04/04/contentful-ios-sdk/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontentful%2Fcontentful.objc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcontentful%2Fcontentful.objc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontentful%2Fcontentful.objc/lists"}