Search in sources :

Example 1 with RtmMessageResponse

use of com.fitpay.android.webview.events.RtmMessageResponse in project fitpay-android-sdk by fitpay.

the class RtmParserV5 method parseMessage.

@Override
public void parseMessage(RtmMessage msg) {
    switch(msg.getType()) {
        case RtmType.ID_VERIFICATION_REQUEST:
            RxBus.getInstance().post(new IdVerificationRequest(msg.getCallbackId()));
            break;
        case RtmType.SUPPORTS_ISSUER_APP_VERIFICATION:
            RxBus.getInstance().post(new RtmMessageResponse(msg.getCallbackId(), true, new A2AIssuerAppVerification(impl.supportsAppVerification()), RtmType.SUPPORTS_ISSUER_APP_VERIFICATION));
            break;
        case RtmType.APP_TO_APP_VERIFICATION:
            if (impl.supportsAppVerification()) {
                A2AVerificationRequest appToAppVerification = Constants.getGson().fromJson(msg.getData(), A2AVerificationRequest.class);
                appToAppVerification.setCallbackId(msg.getCallbackId());
                RxBus.getInstance().post(appToAppVerification);
            } else {
                RxBus.getInstance().post(new RtmMessageResponse(msg.getCallbackId(), false, new A2AVerificationFailed(A2AVerificationError.NOT_SUPPORTED), RtmType.APP_TO_APP_VERIFICATION));
            }
            break;
        default:
            super.parseMessage(msg);
    }
}
Also used : A2AVerificationRequest(com.fitpay.android.webview.events.a2a.A2AVerificationRequest) RtmMessageResponse(com.fitpay.android.webview.events.RtmMessageResponse) A2AVerificationFailed(com.fitpay.android.webview.events.a2a.A2AVerificationFailed) IdVerificationRequest(com.fitpay.android.webview.events.IdVerificationRequest) A2AIssuerAppVerification(com.fitpay.android.webview.models.a2a.A2AIssuerAppVerification)

Example 2 with RtmMessageResponse

use of com.fitpay.android.webview.events.RtmMessageResponse 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));
}
Also used : RtmMessageResponse(com.fitpay.android.webview.events.RtmMessageResponse) DeviceStatusMessage(com.fitpay.android.webview.events.DeviceStatusMessage)

Aggregations

RtmMessageResponse (com.fitpay.android.webview.events.RtmMessageResponse)2 DeviceStatusMessage (com.fitpay.android.webview.events.DeviceStatusMessage)1 IdVerificationRequest (com.fitpay.android.webview.events.IdVerificationRequest)1 A2AVerificationFailed (com.fitpay.android.webview.events.a2a.A2AVerificationFailed)1 A2AVerificationRequest (com.fitpay.android.webview.events.a2a.A2AVerificationRequest)1 A2AIssuerAppVerification (com.fitpay.android.webview.models.a2a.A2AIssuerAppVerification)1