Package com.batch.android.core
Class GooglePlayServicesHelper
- java.lang.Object
-
- com.batch.android.core.GooglePlayServicesHelper
-
public final class GooglePlayServicesHelper extends java.lang.ObjectHelper to get GooglePlayServices data with introspection
-
-
Constructor Summary
Constructors Constructor Description GooglePlayServicesHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.IntegergetGooglePlayServicesAvailabilityInteger(android.content.Context context)static java.lang.StringgetGooglePlayServicesAvailabilityString(java.lang.Integer availability)retrieve the google play services' isGooglePlayServicesAvailable result as a stringstatic java.lang.IntegergetGooglePlayServicesLibVersion(android.content.Context context)retrieve the google play services version if the lib regardless if it is available on rutime or notstatic java.lang.StringgetInstancePushToken(android.content.Context context, java.lang.String senderID)Get the instance token (not the instance id itself), usable with GCMstatic java.lang.StringgetPushToken(android.content.Context context, java.lang.String senderID)Get the push token from GCM.static booleanisAdvertisingIDAvailable(android.content.Context context)Check if the advertising ID is available by checking the version of the libstatic java.lang.IntegerisFCMAvailable(android.content.Context context)Check if FCM is availablestatic java.lang.IntegerisInstanceIdPushAvailable(android.content.Context context)Check if InstanceID based GCM is availablestatic java.lang.IntegerisPushAvailable(android.content.Context context)Check if GCM is available
-
-
-
Method Detail
-
getGooglePlayServicesAvailabilityString
public static java.lang.String getGooglePlayServicesAvailabilityString(java.lang.Integer availability)
retrieve the google play services' isGooglePlayServicesAvailable result as a string- Parameters:
availability-- Returns:
- version of the lib if available, null if the lib is unavailable
-
getGooglePlayServicesAvailabilityInteger
public static java.lang.Integer getGooglePlayServicesAvailabilityInteger(android.content.Context context)
-
getGooglePlayServicesLibVersion
public static java.lang.Integer getGooglePlayServicesLibVersion(android.content.Context context)
retrieve the google play services version if the lib regardless if it is available on rutime or not- Parameters:
context-- Returns:
- version of the lib if available, null if the lib is not here
-
isAdvertisingIDAvailable
public static boolean isAdvertisingIDAvailable(android.content.Context context)
Check if the advertising ID is available by checking the version of the lib- Parameters:
context-- Returns:
-
isPushAvailable
public static java.lang.Integer isPushAvailable(android.content.Context context)
Check if GCM is available- Parameters:
context-- Returns:
- Integer errorID. The error's ID. 0 if the library is available both at integration and runtime. Can be null.
-
getPushToken
public static java.lang.String getPushToken(android.content.Context context, java.lang.String senderID)Get the push token from GCM. Be careful, this method is synchronous and can take a long time.- Parameters:
context- Application context- Returns:
- Push token or null if unavailable
-
isInstanceIdPushAvailable
public static java.lang.Integer isInstanceIdPushAvailable(android.content.Context context)
Check if InstanceID based GCM is available- Parameters:
context-- Returns:
- Integer errorID. The error's ID. 0 if the library is available both at integration and runtime. Can be null.
-
getInstancePushToken
public static java.lang.String getInstancePushToken(android.content.Context context, java.lang.String senderID)Get the instance token (not the instance id itself), usable with GCM
-
isFCMAvailable
public static java.lang.Integer isFCMAvailable(android.content.Context context)
Check if FCM is available- Parameters:
context-- Returns:
- Integer errorID. The error's ID. 0 if the library is available both at integration and runtime. Can be null.
-
-