use of com.appspot.tbatv_prod_hrd.model.ModelsMobileApiMessagesRegistrationRequest in project the-blue-alliance-android by the-blue-alliance.
the class MyTbaDatafeed method unregister.
@WorkerThread
public boolean unregister() {
TbaLogger.d("Unregistering for GCM");
if (!ConnectionDetector.isConnectedToInternet(mApplicationContext)) {
return false;
}
String authHeader = mAuthController.getAuthHeader();
ModelsMobileApiMessagesRegistrationRequest request = new ModelsMobileApiMessagesRegistrationRequest();
request.mobile_id = mGcmController.getRegistrationId();
request.operating_system = GcmController.OS_ANDROID;
request.device_uuid = Utilities.getDeviceUUID(mApplicationContext);
Response<ModelsMobileApiMessagesBaseResponse> response = null;
try {
response = mTbaMobile.unregister(authHeader, request).execute();
} catch (IOException e) {
e.printStackTrace();
}
return (response != null && (response.code() == 200 || response.code() == 304));
}
use of com.appspot.tbatv_prod_hrd.model.ModelsMobileApiMessagesRegistrationRequest in project the-blue-alliance-android by the-blue-alliance.
the class MyTbaDatafeed method register.
@WorkerThread
public boolean register(String regId) {
TbaLogger.d("Registering for GCM");
if (!ConnectionDetector.isConnectedToInternet(mApplicationContext)) {
return false;
}
String authHeader = mAuthController.getAuthHeader();
ModelsMobileApiMessagesRegistrationRequest request = new ModelsMobileApiMessagesRegistrationRequest();
request.mobile_id = regId;
request.operating_system = GcmController.OS_ANDROID;
request.device_uuid = Utilities.getDeviceUUID(mApplicationContext);
if (BuildConfig.DEBUG) {
request.name = android.os.Build.MODEL + " (Debug)";
} else {
request.name = android.os.Build.MODEL;
}
Response<ModelsMobileApiMessagesBaseResponse> response = null;
try {
response = mTbaMobile.register(authHeader, request).execute();
TbaLogger.d("MyTBA Registration response: " + response);
} catch (IOException e) {
e.printStackTrace();
}
return (response != null && (response.code() == 200 || response.code() == 304));
}
Aggregations