Latest 0.0.1
Homepage https://github.com/alihen/Sakai-iOS
License MIT
Platforms ios 10.0
Dependencies Moya, Alamofire, Result

Sakai-iOS


CocoaPods


Twitter: @ali_hen

Sakai-iOS provides an easy way to build out a Sakai LMS learning experience within an iOS app.

Sakai-iOS is currently in Alpha and has limited support for the Sakai /direct API. Refer to the docs and issues for more informations.

How to use Sakai-iOS

Initialize the Sakai instance with the instance configuration and a login details.

let configuration = SakaiConfiguration(baseURL: URL(string: "https://example-sakai.com/direct")!)
Sakai.shared.start(
    configuration: configuration,
    username: "STUDENT001",
    password: "password")

To ensure that the user’s details are valid, log the user in.

Sakai.shared.session.loginUser(
    username: "STUDENT001", 
    password: "password", 
    completion: { (sessionResult) in
                    // Get the result from sessionResult
    })

The following actions are currently supported:

  • Get Recent Announcements
  • Get Announcement by ID
  • Get Sites
  • Get Site by ID
  • Get Session

Don’t see an action that you need? First read our docs, and then submit an issue. If you feel like implementing the action yourself, go ahead and submit a PR. 🎉

Looking for more integration documentation? Check out the tests for end-to-end integration tests that demonstrate all the supported actions.

Testing compatibility with your Sakai Instance

You will be able to run the example project’s test suite in order to test compatibility with your Sakai instance.

The variables which the tests use are taken from environmental variables from the machine. Ensure you set the following environmental variables in the environment you run the tests in.

export SAKAI_TEST_BASE_URL=https://example-instance.com/direct
export SAKAI_TEST_USERNAME=STUDENT001
export SAKAI_TEST_PASSWORD=password
export SAKAI_TEST_SITE_ID=a-test-site-id
export SAKAI_TEST_ANNOUNCEMENT_ID=a-test-announcement-id-the-user-can-access

Example

Examples coming soon. Please refer to the test suite for end-to-end integration tests.

Requirements

  • Swift 4
  • Tested on Sakai 11 and Sakai 12

Installation

Sakai is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'Sakai', '~> 0.0.1'

Author

Alastair Hendricks – @ali_hen

License

Sakai is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "Sakai",
    "version": "0.0.1",
    "summary": "Sakai-iOS provides an easy way to build out a Sakai LMS learning experience.",
    "description": "Sakai-iOS provides an easy way to build out a Sakai LMS learning experience within an iOS app.nSakai-iOS is currently in Alpha and has limited support for the Sakai `/direct` API. Refer to the docs and issues for more informations.",
    "homepage": "https://github.com/alihen/Sakai-iOS",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": "Alastair Hendricks",
    "social_media_url": "http://twitter.com/ali_hen",
    "platforms": {
        "ios": "10.0"
    },
    "source": {
        "git": "https://github.com/alihen/Sakai-iOS.git",
        "tag": "0.0.1"
    },
    "source_files": "Sakai/**/*.{swift}",
    "dependencies": {
        "Moya": [
            "11.0.0"
        ],
        "Alamofire": [
            "~> 4.1"
        ],
        "Result": [
            "~> 3.0"
        ]
    },
    "swift_version": "4.0"
}

Pin It on Pinterest

Share This