android - 我正在尝试在我的 Android 应用程序中执行 SOQL 查询,但每次都会收到 AuthFailureError

标签 android android-fragments android-studio salesforce salesforce-service-cloud

我也尝试简单地运行 salesforce sdk 中包含的模板应用程序,但我仍然遇到身份验证失败错误。

我的代码是: 使用的 api_version 是 v35.0。

sendRequest("SELECT Name From CONTACTS");

private void sendRequest(String soql) throws UnsupportedEncodingException {

RestRequest restRequest = RestRequest.getRequestForQuery(getString(R.string.api_version), soql);

if(restClient!=null) {
restClient.sendAsync(restRequest, new RestClient.AsyncRequestCallback() {

    @Override
    public void onSuccess(RestRequest request, RestResponse result) {
    }

    @Override public void onError(Exception exception) { exception.printStackTrace(); }

任何帮助将不胜感激。 谢谢

最佳答案

这已经解决了,我需要在 bootconfig 文件中赋予刷新 token 的权限,作为基于用户刷新 token 的 soql 查询授权。

关于android - 我正在尝试在我的 Android 应用程序中执行 SOQL 查询,但每次都会收到 AuthFailureError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36257435/

相关文章:

java - 从自定义 ArrayList 创建 Alear Dialog setSingleChoiceItems() 方法

java - 在android中将图像保存到SD卡

android-studio - 为什么我会收到此 Android Studio 错误 : "recompile with -fPIC"?

android - 是否有一种标准方法可以对来自每个屏幕的 API 请求进行建模?

android - Intent 的标志和 PendingIntent.getBroadcast

android - Cordova : Unable to install apk after upgrading android to 5. 1.1 Nexus 5

android - 静态 fragment

android - 单击按钮时以编程方式将 fragment 添加到 Activity

android - ./gradlew 没有这样的文件或目录 - Android studio 2.3

java - 检测动画结束(Android Studio)