0

有没有人尝试从应用程序配置页面的后端发送云消息?

我试过这样做,但从onBroadcastMessageReceived()未被调用GuestbookActivity。我在里面打开源码,CloudBackendActivity发现后端订阅了Topic id的云消息,Topic id_broadcast是后端配置页面的默认ID。肯定会调用该subscribeToCloudMessaging()调用,但处理程序似乎从未调用onComplete().

4

1 回答 1

0

我也有同样的问题onBroadcastMessageReceived()in GuestbookActivity。为了使其接收广播消息,我在CloudBackendActivity.

    private void _onPostCreate() {

    //      if (!isSubscribedToBroadcastMessage) {
    //          isSubscribedToBroadcastMessage = true;
        CloudCallbackHandler<List<CloudEntity>> handler = 
    new CloudCallbackHandler<List<CloudEntity>>() {
            @Override
            public void onComplete(List<CloudEntity> results) {
                onBroadcastMessageReceived(results);
            }
        };
        cloudBackend.subscribeToCloudMessage(
                CloudBackendMessaging.TOPIC_ID_BROADCAST, handler);
    //      }

    this.onPostCreate();
}

所以这个问题是错误的。

于 2013-09-20T10:41:39.483 回答