Sakai 0.2.0

Sakai 0.2.0

Maintained by Alastair Hendricks.



 
Depends on:
Moya= 13.0.1
SwiftSoup= 2.3.2
 

Sakai 0.2.0

Sakai-iOS

Travis-CI CocoaPods Twitter: @ali_hen

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

Want to see Sakai-iOS in action? Download Nounce - Sakai e-Learning on the Go

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")!)
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 Site Announcements
  • Get Sites
  • Get Site by ID
  • Get Session
  • Get Site Resources
  • Get User Profile
  • Get Chat Channels
  • Get Chat Messages
  • Post Chat Messages
  • Get Site Calendar
  • Get Calendar Events
  • Get User Calendar
  • Get Site Assginments
  • Get Single Assignment
  • Get User Assignments

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
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
export SAKAI_TEST_FOLDER_NAME=a-folder-name-in-the-test-sites-resources
export SAKAI_TEST_CHAT_CHANNEL_ID=valid-chat-channel-id
export SAKAI_TEST_EVENT_ID=valid-calendar-event-id
export SAKAI_TEST_ASSIGNMENT_ID=valid-assignment-id

Examples

Requirements

  • Swift 5
  • Tested on Sakai 11, 12 & 19

Installation

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

pod 'Sakai', '~> 0.2.0'

Author

Alastair Hendricks - @ali_hen

License

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