use of com.fitpay.android.webview.events.DeviceStatusMessage in project fitpay-android-sdk by fitpay.
the class WebViewCommunicatorImpl method logout.
/**
* send logout message to JS
*/
public void logout() {
RxBus.getInstance().post(new RtmMessageResponse("logout"));
RxBus.getInstance().post(new DeviceStatusMessage(activity.getString(R.string.fp_connecting), deviceId, DeviceStatusMessage.PENDING));
}
use of com.fitpay.android.webview.events.DeviceStatusMessage in project fitpay-android-sdk by fitpay.
the class WebViewCommunicatorImpl method onTaskError.
private void onTaskError(@EventCallback.Command String command, String callbackId, String errorMessage) {
AppResponseModel failedResponse = new AppResponseModel.Builder().status(RESPONSE_FAILURE).reason(errorMessage).build();
FPLog.w(TAG, errorMessage);
if (null != callbackId) {
sendMessageToJs(callbackId, false, gson.toJson(failedResponse));
}
RxBus.getInstance().post(new DeviceStatusMessage(activity.getString(R.string.fp_sync_failed, errorMessage), deviceId, DeviceStatusMessage.ERROR));
EventCallback eventCallback = new EventCallback.Builder().setCommand(command).setStatus(EventCallback.STATUS_FAILED).setReason(errorMessage).build();
eventCallback.send();
}
Aggregations