public class SmartcarAuth
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
SmartcarAuth.AuthUrlBuilder
A builder used for generating Smartcar Connect authorization URLs.
|
Constructor and Description |
---|
SmartcarAuth(java.lang.String clientId,
java.lang.String redirectUri,
java.lang.String[] scope,
boolean testMode,
SmartcarCallback callback)
Constructs an instance with the given parameters.
|
SmartcarAuth(java.lang.String clientId,
java.lang.String redirectUri,
java.lang.String[] scope,
SmartcarCallback callback)
Constructs an instance with the given parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
addClickHandler(android.content.Context context,
android.view.View view)
Attaches a click listener to a view to launch Smartcar Connect.
|
void |
addClickHandler(android.content.Context context,
android.view.View view,
java.lang.String authUrl)
Attaches a click listener to a view to launch Smartcar Connect.
|
SmartcarAuth.AuthUrlBuilder |
authUrlBuilder()
Build a Smartcar Connect authorization URL.
|
void |
launchAuthFlow(android.content.Context context)
Starts the launch of Smartcar Connect.
|
void |
launchAuthFlow(android.content.Context context,
java.lang.String authUrl)
Starts the launch of Smartcar Connect.
|
public SmartcarAuth(java.lang.String clientId, java.lang.String redirectUri, java.lang.String[] scope, SmartcarCallback callback)
clientId
- The client's IDredirectUri
- The client's redirect URIscope
- An array of authorization scopescallback
- Handler to a Callback for receiving the Smartcar Connect responsepublic SmartcarAuth(java.lang.String clientId, java.lang.String redirectUri, java.lang.String[] scope, boolean testMode, SmartcarCallback callback)
clientId
- The client's IDredirectUri
- The client's redirect URIscope
- An array of authorization scopestestMode
- Set to true to run Smartcar Connect in test modecallback
- Handler to a Callback for receiving the Smartcar Connect responsepublic SmartcarAuth.AuthUrlBuilder authUrlBuilder()
launchAuthFlow(Context, String)
or addClickHandler(Context, View, String)
.public void addClickHandler(android.content.Context context, android.view.View view)
context
- The client application's contextview
- The view to attach the click listenerpublic void addClickHandler(android.content.Context context, android.view.View view, java.lang.String authUrl)
context
- The client application's contextview
- The view to attach the click listenerauthUrl
- Use SmartcarAuth.AuthUrlBuilder
to generate the authorization urlpublic void launchAuthFlow(android.content.Context context)
context
- The client application's contextpublic void launchAuthFlow(android.content.Context context, java.lang.String authUrl)
context
- The client application's contextauthUrl
- Use SmartcarAuth.AuthUrlBuilder
to generate the authorization url