Quickblox android QBCustomObjects.deleteObjects 不工作
Quickblox android QBCustomObjects.deleteObjects is not working
我正在使用 Quickblox
SDK 3.3.0
sdk 有问题还是我用错了?
int count = QBCustomObjects.countObjects("tbl_taxi_gps", req).perform();
if (count > 30) {
req = new QBRequestGetBuilder();
req.eq("uid", qbUser.getId());
ArrayList<QBCustomObject> list = QBCustomObjects.getObjects("tbl_taxi_gps", req, new Bundle()).perform();
final StringifyArrayList<String> rem = new StringifyArrayList<String>();
for (int i = 0; i == 31; i++)
//QBCustomObjects.deleteObject("tbl_taxi_gps", list.get(i).getCustomObjectId());
rem.add(list.get(i).getCustomObjectId());
QBCustomObjects.deleteObjects("tbl_taxi_gps", rem).perform();
Log.w("LocationService", "deleted");
}
当我使用 QBCustomObjects.deleteObject("tbl_taxi_gps", list.get(i).getCustomObjectId());
它工作正常,但如果我尝试删除多个对象,就会发生这种情况:
=========================================================
=== REQUEST ==== 15e62680-8979-4d7c-8d36-9e3eef421fcf ===
REQUEST
DELETE https://api.quickblox.com/data/tbl_taxi_gps/.json
HEADERS
QuickBlox-REST-API-Version=0.1.1
QB-SDK=Android 3.3.0
QB-Token=704c5e5a589xxf8a24bxx78xx850ddexx900cd6b
PARAMETERS
INLINE
DELETE https://api.quickblox.com/data/tbl_taxi_gps/.json
02-26 08:55:42.001 7063-7319/com.sss.taxi:main D/QBASDK: *********************************************************
*** RESPONSE *** 15e62680-8979-4d7c-8d36-9e3eef421fcf ***
STATUS : 404
HEADERS
X-Runtime=0.007143
Cache-Control=no-cache
X-Rack-Cache=invalidate, pass
QuickBlox-REST-API-Version=0.1.1
X-Android-Selected-Protocol=http/1.1
X-UA-Compatible=IE=Edge,chrome=1
Status=404 Not Found
X-Request-Id=8bdc1f2e9ead87d9a91dfef128735b2b
X-Android-Response-Source=NETWORK 404
Connection=Close
X-Android-Sent-Millis=1488128141405
Content-Type=application/json; charset=utf-8
Date=Sun, 26 Feb 2017 16:55:44 GMT
Server=openresty/1.9.15.1
Content-Length=44
X-Android-Received-Millis=1488128141999
Access-Control-Allow-Origin=*
BODY
'{"code":null,"message":"Resource not found"}'
02-26 08:55:42.002 7063-7319/com.sss.taxi:main W/System.err: com.quickblox.core.exception.QBResponseException: Entity you are looking for was not found.,Resource not found
02-26 08:55:42.003 7063-7319/com.sss.taxi:main W/System.err: at com.quickblox.core.parser.QBJsonParser.parse(Unknown Source)
02-26 08:55:42.003 7063-7319/com.sss.taxi:main W/System.err: at com.quickblox.auth.session.Query.perform(Unknown Source)
02-26 08:55:42.003 7063-7319/com.sss.taxi:main W/System.err: at com.sss.taxi.GPS.LocationService.run(LocationService.java:93)
02-26 08:55:42.003 7063-7319/com.sss.taxi:main W/LocationService: errr
问题出在请求地址上。
在其他请求中它指向正确的地址:https://api.quickblox.com/data/tbl_taxi_gps.json
但如果我使用 QBCustomObjects.deleteObjects(...)
它将指向:https://api.quickblox.com/data/tbl_taxi_gps/.json
这是一个错误吗?
有什么办法可以解决这个问题吗?
经过大量调试和尝试不同的方法后我发现
这应该是我的输出 /classname/id1,id2,id3.json
我有 /classname/.json
所以问题是从 list
获取 ID
我正在使用 Quickblox
SDK 3.3.0
sdk 有问题还是我用错了?
int count = QBCustomObjects.countObjects("tbl_taxi_gps", req).perform();
if (count > 30) {
req = new QBRequestGetBuilder();
req.eq("uid", qbUser.getId());
ArrayList<QBCustomObject> list = QBCustomObjects.getObjects("tbl_taxi_gps", req, new Bundle()).perform();
final StringifyArrayList<String> rem = new StringifyArrayList<String>();
for (int i = 0; i == 31; i++)
//QBCustomObjects.deleteObject("tbl_taxi_gps", list.get(i).getCustomObjectId());
rem.add(list.get(i).getCustomObjectId());
QBCustomObjects.deleteObjects("tbl_taxi_gps", rem).perform();
Log.w("LocationService", "deleted");
}
当我使用 QBCustomObjects.deleteObject("tbl_taxi_gps", list.get(i).getCustomObjectId());
它工作正常,但如果我尝试删除多个对象,就会发生这种情况:
=========================================================
=== REQUEST ==== 15e62680-8979-4d7c-8d36-9e3eef421fcf ===
REQUEST
DELETE https://api.quickblox.com/data/tbl_taxi_gps/.json
HEADERS
QuickBlox-REST-API-Version=0.1.1
QB-SDK=Android 3.3.0
QB-Token=704c5e5a589xxf8a24bxx78xx850ddexx900cd6b
PARAMETERS
INLINE
DELETE https://api.quickblox.com/data/tbl_taxi_gps/.json
02-26 08:55:42.001 7063-7319/com.sss.taxi:main D/QBASDK: *********************************************************
*** RESPONSE *** 15e62680-8979-4d7c-8d36-9e3eef421fcf ***
STATUS : 404
HEADERS
X-Runtime=0.007143
Cache-Control=no-cache
X-Rack-Cache=invalidate, pass
QuickBlox-REST-API-Version=0.1.1
X-Android-Selected-Protocol=http/1.1
X-UA-Compatible=IE=Edge,chrome=1
Status=404 Not Found
X-Request-Id=8bdc1f2e9ead87d9a91dfef128735b2b
X-Android-Response-Source=NETWORK 404
Connection=Close
X-Android-Sent-Millis=1488128141405
Content-Type=application/json; charset=utf-8
Date=Sun, 26 Feb 2017 16:55:44 GMT
Server=openresty/1.9.15.1
Content-Length=44
X-Android-Received-Millis=1488128141999
Access-Control-Allow-Origin=*
BODY
'{"code":null,"message":"Resource not found"}'
02-26 08:55:42.002 7063-7319/com.sss.taxi:main W/System.err: com.quickblox.core.exception.QBResponseException: Entity you are looking for was not found.,Resource not found
02-26 08:55:42.003 7063-7319/com.sss.taxi:main W/System.err: at com.quickblox.core.parser.QBJsonParser.parse(Unknown Source)
02-26 08:55:42.003 7063-7319/com.sss.taxi:main W/System.err: at com.quickblox.auth.session.Query.perform(Unknown Source)
02-26 08:55:42.003 7063-7319/com.sss.taxi:main W/System.err: at com.sss.taxi.GPS.LocationService.run(LocationService.java:93)
02-26 08:55:42.003 7063-7319/com.sss.taxi:main W/LocationService: errr
问题出在请求地址上。
在其他请求中它指向正确的地址:https://api.quickblox.com/data/tbl_taxi_gps.json
但如果我使用 QBCustomObjects.deleteObjects(...)
它将指向:https://api.quickblox.com/data/tbl_taxi_gps/.json
这是一个错误吗?
有什么办法可以解决这个问题吗?
经过大量调试和尝试不同的方法后我发现
这应该是我的输出 /classname/id1,id2,id3.json
我有 /classname/.json
所以问题是从 list