连接AWSIotMqttManager时,我订阅了影子主题
mMqttManager.subscribeToTopic("$aws/things/4/shadow/update/delta", AWSIotMqttQos.QOS1, new AWSIotMqttNewMessageCallback() {
@Override
public void onMessageArrived(String topic, byte[] data) {
Log.d("DEBUG", "onMessageArrived: " + topic);
}
});
mMqttManager.subscribeToTopic("$aws/things/4/shadow/get/accepted", AWSIotMqttQos.QOS1, new AWSIotMqttNewMessageCallback() {
@Override
public void onMessageArrived(String topic, byte[] data) {
Log.d("DEBUG", "onMessageArrived: " + topic);
}
});
然后发布空消息,为stated in docs
mMqttManager.publishString("", "$aws/things/4/shadow/get", AWSIotMqttQos.QOS1);
我没有回调。
当我删除订阅delta时,我明白了。
为什么呢?如何在app start上订阅两个主题?