【问题标题】:Android skype intent to automatically make a callAndroid Skype 意图自动拨打电话
【发布时间】:2020-07-29 08:07:37
【问题描述】:

我正在尝试开发一个应用程序,其中一部分无需进一步的用户输入即可调用 Skype。跟随 sn-p 不会自己拨打电话,而只会将我带到 Skype 联系页面。我仍然必须按下通话按钮。我该怎么做才能自动拨打电话?我已经请求了 CALL_PHONE 权限。

        Intent intent = new Intent();
        intent.setAction(Intent.ACTION_VIEW);
        intent.setData(Uri.parse("skype:" + contactId + "?call"));
        startActivity(intent);

提前致谢!

【问题讨论】:

标签: android android-intent skype auto


【解决方案1】:

请查看 Skype 开发人员文档。 他们为 Skype 通话提供 Mobile SDK 和 API。 请参考Microsoft doc for Starting a call from an Android mobile device For Business

Button skypeButton = (Button) findViewById(R.id.button);
   final EditText SIPAddress = (EditText) findViewById(R.id.SIPAddress) ;
   final CheckBox videoCall = (CheckBox) findViewById(R.id.videoCheck);
   skypeButton.setOnClickListener(new View.OnClickListener() {
       @Override
       public void onClick(View view) {

           String uriString = "ms-sfb://call?id="+SIPAddress.getText().toString();
           if (videoCall.isChecked()){
               uriString +="&video=true";
           }
           Uri uri = Uri.parse(uriString);
           Intent callIntent = new Intent(Intent.ACTION_VIEW, uri);
           startActivity(callIntent);
       }
   } );

对于Skype SDK for Android,根据文档,您可以使用它来调用。

try { 
SkypeApi skypeApi = new SkypeApi(getApplicationContext()); 

    skypeApi.startConversation(skypeName.toString(), 
     Modality.AudioCall); 
  } catch (SkypeSdkException e) { 
    // Exception handling logic here 
} 

您也可以使用 URI 来调用这些参考此链接 Skype URI tutorial: Android apps 并回答 How to start a Skype call from an Android app?

【讨论】:

  • 您好,这是 Skype for business。我的问题处理正常的Skype(不一样)
  • 好的。我更新了答案。你能检查并告诉我。我还添加了一个链接,因此它可能对您有所帮助。
  • stackoverflow.com/a/61245298/6041365 这里还提到了使用 URI 进行 Skype 呼叫的答案
  • 我关注了docs.microsoft.com/en-us/skype-sdk/skypeuris/…,但我上面的示例代码也映射了它。它把我带到一个屏幕,我仍然需要说我想连接。所以我的问题是,有没有人使用 is 以及它在哪里工作?
  • 我刚刚发现它与 Skype 版本本身有关。使用 Skype V8.15.0.430,它可以按预期工作。只有在以后的版本中,它在某个地方放弃了这种自动呼叫功能或其他东西。我们应该问谁?在某处是否有更改说明?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-11-26
  • 1970-01-01
  • 1970-01-01
  • 2023-03-04
  • 1970-01-01
  • 2020-04-08
  • 1970-01-01
相关资源
最近更新 更多