Skip to content

Instantly share code, notes, and snippets.

@atetc
Created July 20, 2015 08:50
Show Gist options
  • Save atetc/34494a56cb7225260f67 to your computer and use it in GitHub Desktop.
Save atetc/34494a56cb7225260f67 to your computer and use it in GitHub Desktop.
RequestChatResponse requestChatResponse = null;
try {
requestChatResponse = mChatService.requestChat(
((AppDelegate) getContext().getApplicationContext()).getSecureToken(),
gmsUser,
mSettings.fixedAgentLogin().get(),
String.format(getContext().getString(R.string.clientDeviceOsPattern), Build.VERSION.RELEASE),
BuildConfig.VERSION_NAME,
"msc",
gmsUser,
DeviceInfo.getDeviceModel(getContext()),
cellPhone,
subscriptionId,
customerId);
mSettings.chatAuthorizationSuccess().set(true);
} catch (RetrofitError e) {
if (e.getResponse() != null && e.getResponse().getStatus() == HttpURLConnection.HTTP_UNAUTHORIZED) {
requestChatResponse = mChatService.requestChat(
null,
gmsUser,
mSettings.fixedAgentLogin().get(),
String.format(getContext().getString(R.string.clientDeviceOsPattern), Build.VERSION.RELEASE),
BuildConfig.VERSION_NAME,
"msc",
gmsUser,
DeviceInfo.getDeviceModel(getContext()),
cellPhone,
subscriptionId,
null);
mSettings.chatAuthorizationSuccess().set(false);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment