Skip to content

How I could subscribe to changes like Javascript does #55

@cbedoy

Description

@cbedoy

Hi everyone!

To be honest I see that you have a little docs outdated and some cases merged docs between clients, so thats why my question. For example in the docs you have the option for subscribe to changes from any notification feed, but it's only for javascript.

So I'd like to know if exist any way to listening flat feed changes? or to listening reactions, comments or those kind of changes? I know you have React Native component but all our core app is on Kotlin and java, so that's why need a native.

You have this:

Subscribe to realtime updates via API client

let notificationFeed = client.feed('notification', '1');

function callback(data) {
    console.log(data);
}

function successCallback() {
    console.log('now listening to changes in realtime');
}

function failCallback(data) {
    alert('something went wrong, check the console logs');
    console.log(data);
}

user1.subscribe(callback).then(successCallback, failCallback);

And

Subscribe to realtime updates using UMD script

<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/getstream/dist/js_min/getstream.js">
</script>

<script type="text/javascript">
    var client = stream.connect('n6dqxby6gcfa', userToken, '49021');
    var notificationFeed = client.feed('notification', '1');

    function callback(data) {
        console.log(data);
    }

    function successCallback() {
        console.log('now listening to changes in realtime');
    }

    function failCallback(data) {
        alert('something went wrong, check the console logs');
        console.log(data);
    }

    notificationFeed.subscribe(callback).then(successCallback, failCallback);
</script>

Exist any way to implement with java?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions