Zendesk回调投放问题

时间:2018-08-14 04:01:24

标签: android zendesk zendesk-api zendesk-app

我正在将Zendesk集成到我的应用中,以允许用户向我发送电子邮件。

我遇到以下问题:

ContactUsFragment: java.lang.ClassCastException: com.zendesk.service.RetrofitZendeskCallbackAdapter cannot be cast to retrofit.Callback
08-13 23:36:25.920  3319  3319 E ContactUsFragment:     at retrofit.RestAdapter$RestHandler.invoke(RestAdapter.java:275)
08-13 23:36:25.920  3319  3319 E ContactUsFragment:     at java.lang.reflect.Proxy.invoke(Proxy.java:913)
08-13 23:36:25.920  3319  3319 E ContactUsFragment:     at $Proxy24.getSettings(Unknown Source)
08-13 23:36:25.920  3319  3319 E ContactUsFragment:     at com.zendesk.sdk.network.impl.ZendeskSdkSettingsService.getSettings(ZendeskSdkSettingsService.java:37)
08-13 23:36:25.920  3319  3319 E ContactUsFragment:     at com.zendesk.sdk.network.impl.ZendeskSdkSettingsProvider.getSettings(ZendeskSdkSettingsProvider.java:57)
08-13 23:36:25.920  3319  3319 E ContactUsFragment:     at com.zendesk.sdk.network.impl.ZendeskBaseProvider.getSdkSettings(ZendeskBaseProvider.java:92)
08-13 23:36:25.920  3319  3319 E ContactUsFragment:     at com.zendesk.sdk.network.impl.ZendeskBaseProvider.configureSdk(ZendeskBaseProvider.java:51)
08-13 23:36:25.920  3319  3319 E ContactUsFragment:     at com.zendesk.sdk.network.impl.ZendeskRequestProvider.createRequest(ZendeskRequestProvider.java:76)
08-13 23:36:25.920  3319  3319 E ContactUsFragment:     at com..app.ui.fragments.ContactUsFragment.sendTicket(ContactUsFragment.java:328)
08-13 23:36:25.920  3319  3319 E ContactUsFragment:     at com..app.ui.fragments.ContactUsFragment.lambda$submit$5$ContactUsFragment(ContactUsFragment.java:267)

我使用Zendesk提供的代码示例使其有效,但万一:

CreateRequest request = new CreateRequest();
        request.setEmail(email);
        request.setSubject(subject);
        request.setDescription(message + "\n" + email);
        request.setCustomFields(Collections.singletonList(issueTypeField));
        request.setTags(tags);

        RequestProvider provider = new ZendeskRequestProvider();
        showLoader();
        provider.createRequest(request, new ZendeskCallback<CreateRequest>() {
            @Override
            public void onSuccess(CreateRequest createRequest) {
                toast(getString(R.string.ticket_sent));
                hideLoader();
                getActivity().onBackPressed();
            }

            @Override
            public void onError(ErrorResponse errorResponse) {
                hideLoader();
                showError(errorResponse.getReason());
            }
        });

我看不到new ZendeskCallback<CreateRequest>()的问题或解决方法。

有什么主意如何解决演员表问题?

谢谢

0 个答案:

没有答案