public class TunePushManager extends Object
Modifier and Type | Field and Description |
---|---|
protected String |
currentAppVersion |
static String |
PREFS_TMA_PUSH |
static String |
PROPERTY_NOTIFICATION_BUILDER |
Constructor and Description |
---|
TunePushManager(Context context) |
TunePushManager(Context context,
String currentAppVersion) |
Modifier and Type | Method and Description |
---|---|
TuneOptional<TunePushMessage> |
checkGetPushFromActivity(Activity activity) |
boolean |
didUserManuallyDisablePush() |
boolean |
ensureDeviceIsRegistered()
Check if this device is already registered (and if the registration is for this version of the app) this device.
|
String |
getDeviceToken() |
protected boolean |
isGooglePlayServicesAvailable() |
boolean |
isPushEnabled() |
void |
onEvent(TuneAppForegrounded event) |
void |
onEvent(TuneUpdateUserProfile event) |
protected void |
registerInBackground(boolean unregisterFirst)
Unregisters and Re-registers the application with GCM servers asynchronously.
|
void |
setOptedOutOfPush(boolean optedOut) |
void |
setPushNotificationRegistrationId(String registrationId) |
void |
setPushNotificationSenderId(String pushSenderId)
Publicly Exposed Methods *
|
void |
setTuneNotificationBuilder(TuneNotificationBuilder toStore) |
protected void |
storePushPrefs(String regId)
Stores the registration ID and app versionCode in the application's
SharedPreferences . |
public static final String PREFS_TMA_PUSH
public static final String PROPERTY_NOTIFICATION_BUILDER
protected String currentAppVersion
public TunePushManager(Context context)
public void onEvent(TuneAppForegrounded event)
public void onEvent(TuneUpdateUserProfile event)
public boolean ensureDeviceIsRegistered()
protected boolean isGooglePlayServicesAvailable()
protected void registerInBackground(boolean unregisterFirst)
Stores the registration ID, app versionCode, and Tune device id in the application's shared preferences.
unregisterFirst
- protected void storePushPrefs(String regId)
SharedPreferences
.regId
- registration IDpublic TuneOptional<TunePushMessage> checkGetPushFromActivity(Activity activity)
public boolean isPushEnabled()
public void setPushNotificationSenderId(String pushSenderId)
public void setPushNotificationRegistrationId(String registrationId)
public void setTuneNotificationBuilder(TuneNotificationBuilder toStore)
public void setOptedOutOfPush(boolean optedOut)
public String getDeviceToken()
public boolean didUserManuallyDisablePush()