public class AndroidAuthenticator extends FlattrAuthenticator
FlattrAuthenticator
that helps through the authentication
process on Android devices.Constructor and Description |
---|
AndroidAuthenticator(String host,
ConsumerKey consumerKey)
Constructs a new instance with the given
ConsumerKey . |
AndroidAuthenticator(String host,
String key,
String secret)
Constructs a new instance with the given consumer key and secret.
|
Modifier and Type | Method and Description |
---|---|
android.content.Intent |
createAuthenticateIntent()
Creates an
Intent for forwarding the user to the Flattr web page for
authentication. |
AccessToken |
fetchAccessToken(android.net.Uri uri)
When the authentication was completed, your activity is resumed.
|
authenticate, buildScopeString, createConnector, fetchAccessToken, getAccessTokenUrl, getCallbackUrl, getRequestTokenUrl, getResponseType, getScope, setAccessTokenUrl, setCallbackUrl, setRequestTokenUrl, setResponseType, setScope
public AndroidAuthenticator(String host, ConsumerKey consumerKey)
ConsumerKey
.host
- Host name that is configured in the manifestconsumerKey
- ConsumerKey
public AndroidAuthenticator(String host, String key, String secret)
host
- Host name that is configured in the manifestkey
- Consumer keysecret
- Consumer secretpublic android.content.Intent createAuthenticateIntent() throws FlattrException
Intent
for forwarding the user to the Flattr web page for
authentication.
When the returned activity is started, a browser is opened. It shows a Flattr web page asking the user to authenticate and grant the requested scopes for your application.
When the authentication completes successfully, your activity is resumed with your callback URL passed in.
Intent
FlattrException
public AccessToken fetchAccessToken(android.net.Uri uri) throws FlattrException
Intent
.uri
- Uri
that was passed in with the the Intent
, containing
the callback URL from Flattr. It is safe to pass null
here.AccessToken
, or null
if the Uri
did not provide a
valid code.FlattrException
Copyright © 2010–2017. All rights reserved.