Skip to content

onEvents/onSubscribe nothing happening #95

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rommansabbir opened this issue Jan 29, 2019 · 3 comments
Closed

onEvents/onSubscribe nothing happening #95

rommansabbir opened this issue Jan 29, 2019 · 3 comments

Comments

@rommansabbir
Copy link
Member

Here is my code:

    Parse.initialize(new Parse.Configuration.Builder(this)
            .applicationId(getString(R.string.back4app_app_id))
            // if defined
            .clientKey(getString(R.string.back4app_client_key))
            .server(getString(R.string.back4app_server_url))
            .build()
    );

    ParseInstallation.getCurrentInstallation().saveInBackground();

Main Activity:

    ParseLiveQueryClient parseLiveQueryClient = null;
    Log.d(TAG, "onCreate: ");
    parseLiveQueryClient = ParseLiveQueryClient.Factory.getClient();
    ParseQuery<ParseObject> parseQuery = ParseQuery.getQuery("Accident");

    SubscriptionHandling<ParseObject> subscriptionHandling = parseLiveQueryClient.subscribe(parseQuery);
    subscriptionHandling.handleSubscribe(new SubscriptionHandling.HandleSubscribeCallback<ParseObject>() {
        @Override
        public void onSubscribe(ParseQuery<ParseObject> query) {
            Log.d(TAG, "onSubscribe: ");
        }
    });
    subscriptionHandling.handleEvents(new SubscriptionHandling.HandleEventsCallback<ParseObject>() {
        @Override
        public void onEvents(ParseQuery<ParseObject> query, SubscriptionHandling.Event event, ParseObject object) {
            Log.d(TAG, "onEvents: ");
        }
    });

not getting any response or error from subscription. live query enabled on the server settings.

@mmimeault
Copy link
Contributor

Hello, did you find the issue/solution? If so, can you give some detail. Sometime it can help others that fall into the same problem. Thanks

@rommansabbir
Copy link
Member Author

Yes, sure. Currently, I'm working on it. I will post the github link here ASAP.

@rommansabbir
Copy link
Member Author

This is a working project. Check this out
https://github.com/rommansabbir/ParseLiveQueryAndroid/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants