1

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.

mr_dark
  • 21
  • 1
  • 1
    Have you already checked their template? It can help you with that: https://github.com/templates-back4app/ParseLiveQueryJava/blob/9ba856f3d3956a61b88d5ba6188167ac35481e50/app/src/main/java/com/emre/parselivequeryjava/MainActivity.java#L99 – Charles Feb 08 '23 at 23:19

0 Answers0