Skip to content
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

Fix subscribe method with IMqttMessageListener #451

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ public IMqttToken subscribe(String[] topicFilters, int[] qos, Object userContext
String activityToken = storeToken(token);
mqttService.subscribe(clientHandle, topicFilters, qos, null, activityToken, messageListeners);

return null;
return token;
Copy link
Contributor

@hannesa2 hannesa2 Mar 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

@ididdidi ididdidi Mar 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Hannes, I saw your solution and tested it, but unfortunately it didn't help me.

I make a call to this method:

client.subscribe(topic, qos, new IMqttMessageListener() {
            @Override
            public void messageArrived(String topic, MqttMessage message) throws Exception {
                Log.i(topic, message.toString());
            }
 });

When publishing messages in, nothing happens.

However, the message sent from the device under test appears in the TextView (in a different implementation) after the screen is turned off and on. But other messages don't go through like that.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}


Expand Down