如何使用Sinch API在同一设备上的2个用户之间切换

时间:2019-03-04 14:26:39

标签: android sinch android-sinch-api

我已经在我的应用中实现了Sinch API,但是我无法“注销”或在同一设备上的2个用户之间切换。即使我使用unregisterManagePush()方法,“注销”用户仍会收到来电(但无法应答)。我在Sinch的支持页面上进行了查询。但是支持团队要求我再次阅读文档。但是我完全按照文档所说的做了。这是我的代码:

if (MyFirebaseMessaging.sinchClient!=null) {
      MyFirebaseMessaging.sinchClient.stopListeningOnActiveConnection();
      MyFirebaseMessaging.sinchClient.unregisterManagedPush();
      MyFirebaseMessaging.sinchClient.terminateGracefully();
      MyFirebaseMessaging.sinchClient=null; }

更新1:我尝试过的代码

 if (MyFirebaseMessaging.sinchClient!=null) {
          MyFirebaseMessaging.sinchClient.stopListeningOnActiveConnection();
          MyFirebaseMessaging.sinchClient.unregisterManagedPush();
          MyFirebaseMessaging.sinchClient.terminateGracefully();
       }


 if (MyFirebaseMessaging.sinchClient!=null) {
          MyFirebaseMessaging.sinchClient.stopListeningOnActiveConnection();
          MyFirebaseMessaging.sinchClient.unregisterManagedPush();
          MyFirebaseMessaging.sinchClient.terminate();
          MyFirebaseMessaging.sinchClient=null; }



 if (MyFirebaseMessaging.sinchClient!=null) {
          MyFirebaseMessaging.sinchClient.stopListeningOnActiveConnection();
          MyFirebaseMessaging.sinchClient.unregisterManagedPush();
          MyFirebaseMessaging.sinchClient.terminate();
      }

=>它们都不起作用。保持呼叫前一个注销的用户。

0 个答案:

没有答案