-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add profile api #68
Add profile api #68
Conversation
fix comments in top of file and minor changes
# Conflicts: # Source/BluemixAppID/api/UserAttributeDelegate.swift # Source/BluemixAppID/internal/AuthorizationManager.swift
@@ -178,6 +178,7 @@ internal class AppIDConstants { | |||
internal static let USER_IDENTITY_LABEL = "userIdentity" | |||
// labels | |||
|
|||
internal static let AnonymousIdpName = "appid_anon" | |||
internal static let BMSSecurityErrorDomain = "com.ibm.mobilefirstplatform.clientsdk.swift.bmssecurity" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the BMSSecurityErrorDomain property used for? It is part of MCA SDK, there shouldn't be any mentioning of com.ibm.mobilefirstplatform at all in AppID SDK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know about this. It is not related to the profiles API, and I am sure there are more of those hiding. Let's finish this, and then we'll do sweep around the code and remove any such "old" constants
Source/BluemixAppID/api/AppID.swift
Outdated
self.loginAnonymously(accessTokenString: accessTokenString, allowCreateNewAnonymousUsers: true, authorizationDelegate: authorizationDelegate) | ||
} | ||
|
||
public func loginAnonymously(accessTokenString:String?, allowCreateNewAnonymousUsers: Bool, authorizationDelegate:AuthorizationDelegate) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to have three signatures. You can use Swift optional arguments with default values. Talked to @motyd about this.
@@ -11,7 +11,6 @@ import Foundation | |||
|
|||
public protocol UserAttributeDelegate { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UserAttributes APIs are simple APIs that return true/false. We should use completionHandlers instead of delegates.
} | ||
|
||
public func launch(accessTokenString: String?, delegate: AuthorizationDelegate) { | ||
self.oauthManager.authorizationManager?.launchAuthorizationUI(accessTokenString: accessTokenString, authorizationDelegate: delegate) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
having one method signature with optional arguments with default value should be enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments
@@ -14,5 +14,5 @@ | |||
import Foundation | |||
|
|||
public protocol LoginWidget { | |||
func launch(delegate:AuthorizationDelegate) | |||
func launch(accessTokenString: String?, delegate: AuthorizationDelegate) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default accessTokenString to nil
No description provided.