0
我試圖從設備本身發送地理圍欄通知。這是我的代碼。解析GeoPoint查詢不適用於Android SDK中的PushQuery
ParseQuery pushQuery = ParseInstallation.getQuery();
pushQuery.whereNear("currentLoc", parseGeoPoint);
ParsePush push = new ParsePush();
push.setQuery(pushQuery); // Set our Installation query
push.setMessage("geo push");
push.sendInBackground();
我從服務中添加了currentLoc和testText屬性,它在解析控制檯中顯示出來。代碼如下。現在
ParseInstallation installation = ParseInstallation.getCurrentInstallation();
installation.put("currentLoc", parseGeoPoint);
installation.put("testText", "text");
installation.saveInBackground();
,如果我在查詢中使用pushQuery.whereEqualTo("testText", "texto");
代替pushQuery.whereNear("currentLoc", parseGeoPoint);
,通知被觸發。
但隨着whereWithin
或whereNear
查詢中使用時,它失敗並解析推控制檯會產生以下錯誤
ERROR:
Unable to execute query: error processing query: ns=appdata1109.app_ded5349f-37a1-4227-a4cc-62eccd9f8a07:_Installation limit=0 skip=0 Tree: GEONEAR field=currentLoc maxdist=1.79769e+308 isNearSphere=1 Sort: {} Proj: {} planner returned error: unable to find index for $geoNear query