-
Notifications
You must be signed in to change notification settings - Fork 28
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
Decouple service creation from MobileCore #67
Conversation
@@ -70,7 +70,7 @@ OpenIDAuthenticationProvider provideAuthProvider(KeycloakAuthenticateProviderImp | |||
// tag::securityServiceInit[] | |||
@Provides @Singleton | |||
SecurityService provideSecurityService() { | |||
return MobileCore.getInstance().getService(SecurityService.class); | |||
return new SecurityService(); |
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.
👍 Cleaner and shows easier to be used.
@secondsun @wei-lee Wanna review before I move forward? |
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.
Just a very minor comment.
LGTM
AuthServiceConfiguration authServiceConfig = new AuthServiceConfiguration.AuthConfigurationBuilder() | ||
.withRedirectUri("com.aerogear.androidshowcase:/callback") | ||
.build(); | ||
|
||
authService.init(context, authServiceConfig); | ||
AuthService authService = new AuthService(authServiceConfig); | ||
return authService; |
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.
This could be changed to return new AuthService(authServiceConfig);
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.
Done!
Related issues:
PS: This PR depends on aerogear/aerogear-android-sdk#269