public final class DeepLinkAuthUtil extends Object
LevelUpDeepLinkIntegrator
.Modifier and Type | Class and Description |
---|---|
static class |
DeepLinkAuthUtil.LevelUpNotInstalledException
Thrown if LevelUp is not installed.
|
Modifier and Type | Field and Description |
---|---|
static String |
ACTION_REQUEST_PERMISSIONS
Intent action for a permissions request.
|
static String |
EXTRA_STRING_ACCESS_TOKEN
Intent extra containing the access token.
|
static String |
URI_QUERY_PARAMETER_APP_ID
The authorization request query parameter containing the web service ID of the app
requesting the permissions.
|
static String |
URI_QUERY_PARAMETER_PERMISSION
The authorization request query parameter containing one of the permissions to be requested.
|
Modifier and Type | Method and Description |
---|---|
static String |
getPackageSignature(Context context,
Intent request) |
static String |
getPackageSignature(Context context,
String packageName)
Given a package, retrieves the Google Maps-style API key signature.
|
static Intent |
getRequestPermissionsIntent(Context context,
int appId,
Collection<String> permissions)
Makes a request for permissions, verifying that the target of the Intent is authentically
LevelUp.
|
static boolean |
isLevelUpAvailable(Context context) |
public static final String ACTION_REQUEST_PERMISSIONS
public static final String EXTRA_STRING_ACCESS_TOKEN
public static final String URI_QUERY_PARAMETER_APP_ID
public static final String URI_QUERY_PARAMETER_PERMISSION
public static String getPackageSignature(Context context, Intent request)
context
- an Application context.request
- the intent in question.getPackageSignature(android.content.Context, String)
public static String getPackageSignature(Context context, String packageName) throws IllegalArgumentException
SIGNATURE;PACKAGE
where SIGNATURE
is the signature of the package, in upper
case hexadecimal characters, grouped in bytes by ":". PACKAGE
is the provided
package name.context
- an Application context.packageName
- the name of the package.IllegalArgumentException
- if the provided package has no signatures or is otherwise
unusable.public static boolean isLevelUpAvailable(Context context)
context
- application context.public static Intent getRequestPermissionsIntent(Context context, int appId, Collection<String> permissions) throws DeepLinkAuthUtil.LevelUpNotInstalledException
context
- application context.appId
- the web service ID of the app requesting the permissions.permissions
- the set of permissions.startActivityForResult()
.DeepLinkAuthUtil.LevelUpNotInstalledException
- if LevelUp is not installed.