I am using the Parse Server(Back4app) I have read all the docs given by Parse and back4App but I can't seem to find why the live query is not working.
The Code:
ParseObject Pins = new ParseObject("Map_Pins");
Pins.put("latitude", -299);
Pins.put("longitude", -38);
Pins.saveInBackground(e -> {
if (e == null) {
Toast.makeText(MapsActivity.this, "Marker saved successfully!", Toast.LENGTH_SHORT).show();
} else {
Log.i("Error_39048", "onMapReady:"+e.getMessage());
}
});
ParseQuery<ParseObject> parseQuery = ParseQuery.getQuery("Map_Pins");
SubscriptionHandling<ParseObject> subscriptionHandling = parseLiveQueryClient.subscribe(parseQuery);
subscriptionHandling.handleEvents((query, event, object) -> {
Log.i("query_03842", event);
});
Parse dependencies:
// Parse SDK(back4app)
implementation "com.github.parse-community.Parse-SDK-Android:parse:4.1.0"
implementation 'com.github.parse-community:ParseLiveQuery-Android:1.2.2'
Parse Int(App):
public class App extends Application {
@Override
public void onCreate() {
super.onCreate();
Parse.initialize(new Parse.Configuration.Builder(this)
.applicationId(getString(R.string.back4app_app_id))
.clientKey(getString(R.string.back4app_client_key))
.server(getString(R.string.back4app_server_url))
.build());
}
}
Android Manifest:
android:name=".App"
***And on the Parse server side I did set the table Map_Pins to be live query ***
I tried to follow back4App guidelines but they are completely different from the Parse guidelines and none of them work i am not sure is this a code problem or a server problem.