diff --git a/.env b/.env index d830863..b92d7af 100644 --- a/.env +++ b/.env @@ -1 +1 @@ -WIA_SDK_VERSION=0.1.1 +WIA_SDK_VERSION=0.1.2 diff --git a/.envrc b/.envrc index 2bac86f..66dfee1 100644 --- a/.envrc +++ b/.envrc @@ -1 +1 @@ -export WIA_SDK_VERSION=0.1.1 +export WIA_SDK_VERSION=0.1.2 diff --git a/Config.xcconfig b/Config.xcconfig index afc1f41..b2cb7a5 100755 --- a/Config.xcconfig +++ b/Config.xcconfig @@ -1,2 +1,2 @@ -WIA_SDK_VERSION=0.1.1 +WIA_SDK_VERSION=0.1.2 PRODUCT_NAME=WiaSwift diff --git a/Sources/WiaSwift/Client.swift b/Sources/WiaSwift/Client.swift index 66f33c0..47080d4 100644 --- a/Sources/WiaSwift/Client.swift +++ b/Sources/WiaSwift/Client.swift @@ -23,7 +23,8 @@ open class Wia { open var accessToken: String? open var baseURL: String open var spaceId: String? - + open var currentUser: User? + public init(appKey: String? = nil, clientKey: String? = nil, accessToken: String? = nil, diff --git a/Tests/UserTests.swift b/Tests/UserTests.swift index 5a3c11f..927e3dd 100644 --- a/Tests/UserTests.swift +++ b/Tests/UserTests.swift @@ -154,5 +154,23 @@ class UserTests: XCTestCase { waitForExpectations(timeout: 10.0, handler: nil) } + + func testRetrieveAndSetCurrentUser() { + let expectation = self.expectation(description: "Retrieve the currently authenticated user") + + UserTests.client.retrieveUser(id: "me", onSuccess: { user in + expect(user).to(beAKindOf(User.self)) + expect(user.id).toNot(beNil()) + UserTests.client.currentUser = user + expectation.fulfill() + }, onFailure: { error in + expect(error).to(beAKindOf(WiaError.self)) + fail("Error status code \(error.status!)") + expectation.fulfill() + }) + + waitForExpectations(timeout: 10.0, handler: nil) + } + }