{"id":18544512,"url":"https://github.com/instructure/canvaskit","last_synced_at":"2025-04-09T19:30:47.781Z","repository":{"id":56905626,"uuid":"14379089","full_name":"instructure/CanvasKit","owner":"instructure","description":"Canvas library for Cocoa.","archived":false,"fork":false,"pushed_at":"2017-11-17T16:01:10.000Z","size":2346,"stargazers_count":37,"open_issues_count":3,"forks_count":14,"subscribers_count":38,"default_branch":"master","last_synced_at":"2024-10-05T10:47:14.917Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/instructure.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-11-13T23:04:33.000Z","updated_at":"2024-07-02T08:15:58.000Z","dependencies_parsed_at":"2022-08-21T02:20:52.627Z","dependency_job_id":null,"html_url":"https://github.com/instructure/CanvasKit","commit_stats":null,"previous_names":[],"tags_count":84,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instructure%2FCanvasKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instructure%2FCanvasKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instructure%2FCanvasKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instructure%2FCanvasKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/instructure","download_url":"https://codeload.github.com/instructure/CanvasKit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223407796,"owners_count":17140563,"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-11-06T20:16:45.947Z","updated_at":"2024-11-06T20:16:46.431Z","avatar_url":"https://github.com/instructure.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"## CanvasKit by Instructure iOS\n### End Of Life\n***\nCanvasKit is a Work in Progress—the architecture is still prone to change and not all off the API endpoints are implemented.\n***\n\nCanvasKit is a library that will help you integrate your own third party app with [Canvas by Instructure](https://instructure.com/).\n\nCanvasKit is built on the [Canvas API](https://canvas.instructure.com/doc/api/index.html). CanvasKit is designed to allow for great flexibility while providing an easy to use interface. You can use CanvasKit to build apps for open source versions of Canvas as well as instances hosted by Instructure.\n\n## How To Get Started\n\n- [Download CanvasKit](https://github.com/instructure/CanvasKit/archive/master.zip) and try out the included iPhone example app\n- Take a look at the [Canvas API](https://canvas.instructure.com/doc/api/index.html) for a complete list of endpoints\n\n### Installation with CocoaPods\n\n***\nNOTE: Canvas Kit is not yet a cocoapod but will be soon\n***\n\n[CocoaPods](http://cocoapods.org) is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like CanvasKit in your projects. See the [\"Getting Started\" guide for more information](https://github.com/AFNetworking/AFNetworking/wiki/Getting-Started-with-AFNetworking).\n\n#### Podfile\n\n```ruby\nplatform :ios, '7.0'\npod \"CanvasKit\", \"~\u003e 2.0\"\n```\n\n## 2.0\n\nCanvasKit 2.0 is a major refactor from the previous version of CanvasKit. Until now CanvasKit has only been used on internal projects at [Instructure](http://www.instructure.com/). One of our major goals of the recent refactor was to make CanvasKit open source and easy to use for third party developers.\n\n## Usage\n\n### Setup\n\nIn order to use CanvasKit with Instructure mangaged instances of [Canvas LMS](https://github.com/instructure/canvas-lms) you must obtain a Client ID and Shared Secret. CanvasKit uses [OAuth 2](https://canvas.instructure.com/doc/api/file.oauth.html) for authentication. Request your Client ID and Shared Secret by sending an email to \u003cmike@instructure.com\u003e. Make sure to give us your name, email, and what you are hoping to do with CanvasKit.\n\n### CKIClient\n\nThe `CKIClient` is in charge of all the networking in CanvasKit. Insantiate a `CKIClient` with your client ID and shared secret like so:\n\n```objc\nCKIClient *client = [CKIClient clientWithBaseURL:url clientID:ClientID sharedSecret:SharedSecret];\n```\n\n\nIf the client is not logged in, you may do so by calling `-login`. This method will handle displaying a\nmodal webview to the user and deal with the OAuth process for you. At the end you may look  \n\n```objc\n[[self.client login] subscribeError:^(NSError *error) {\n    // do somethign with the error\n} completed:^{\n    // login completed successfully. do something.\n}];\n```\n\nIf you would like to get information about the currently logged in user, you may do so by accessing the `client.currentUser` property. See `CKIUser` for more information.\n\n### Accessing the API\n\nCanvasKit includes classes for many of the objects found in the Canvas LMS. Along with these model classes CanvasKit includes networking categories on `CKIClient` for accessing the API endpoints. For example, to fetch all the courses for the current user, you would do this:\n\n```objc\n[[client fetchCoursesForCurrentUser] subscribeNext:^(NSArray *courses) {\n    // handle a page of courses\n}];\n```\n\nEach networking method begins with 'fetch' making it easy for you to see all available options with Xcode auto-complete.\n\nOne thing to note is that CanvasKit uses [ReactiveCocoa](https://github.com/ReactiveCocoa/ReactiveCocoa), however, it is not necessary to have any knowledge of ReactiveCocoa in order to use CanvasKit (although undertanding ReactiveCocoa will allow you to do much more powerful things). Each networking call returns a `RACSignal` object. Simply call `subscribeNext:` on that signal to process the data. Essentially the paginated data will be processed as a stream of pages, i.e. your `subscribeNext:` block will be called once for every page.\n\n### License\n\nCanvasKit is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstructure%2Fcanvaskit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finstructure%2Fcanvaskit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstructure%2Fcanvaskit/lists"}