我正在使用Android版的Sinch Messaging API。所有其他更改都已就位,如AndroidManifest中的更改已就位。
我在我的Sinch客户端初始化中添加了以下内容。
sinchClient.setSupportMessaging(true);
sinchClient.setSupportManagedPush(true);现在,当我发送消息时,它是无异常发送的,因为我确实看到消息发送计数在我的Sinch仪表板上增加。然而,在我的发送器代码中,我没有收到任何关于消息失败或消息传递的回调。我确实收到了有关发送消息的消息。此外,接收器永远不会收到任何回调。
我假设我正在使用Sinch,我不需要任何类型的服务器来连接到GCM。Sinch会自动将查询路由到我的接收器。
此外,发送者和接收者都使用相同的API密钥/Secret/Env登录。
任何人以前都曾遇到过这种情况。
发布于 2016-02-29 11:49:06
所以我让它工作了,不确定哪一步对我有帮助,但下面是我做的事情:
sinchClient = Sinch.getSinchClientBuilder().context(this).userId(username).applicationKey(ApplicationConstants.SINCH_SANDBOX_API_KEY) .applicationSecret(ApplicationConstants.SINCH_SANDBOX_API_SECRET).environmentHost(ApplicationConstants.SINCH_SANDBOX_API_URL).build();sinchClient.addSinchClientListener(此);sinchClient.setSupportMessaging(真);sinchClient.setSupportManagedPush(真);sinchClient.checkManifest();sinchClient.start();sinchClient.getMessageClient().addMessageClientListener(messageClientListener);
至
sinchClient = Sinch.getSinchClientBuilder().context(this).userId(username).applicationKey(ApplicationConstants.SINCH_SANDBOX_API_KEY)
.applicationSecret(ApplicationConstants.SINCH_SANDBOX_API_SECRET).environmentHost(ApplicationConstants.SINCH_SANDBOX_API_URL).build();
sinchClient.setSupportMessaging(true);
sinchClient.setSupportManagedPush(true);
sinchClient.checkManifest();
sinchClient.addSinchClientListener(this);
sinchClient.getMessageClient().addMessageClientListener(messageClientListener);
sinchClient.start();https://stackoverflow.com/questions/35636010
复制相似问题