【问题标题】:Open chat screen Skype from other app从其他应用程序打开聊天屏幕 Skype
【发布时间】:2012-08-14 05:51:51
【问题描述】:

开发一个应用程序,其中我有很多用户的 account_id(skype id),现在我想要的是当我从我的应用程序中单击特定用户的 skype_id 时打开 Skype 的聊天屏幕(已经安装在设备中)。

我在网上搜索过,但没有成功 知道如何在 Skype 上开始通话但聊天的链接?

1) Link 1

2) Link 2

【问题讨论】:

    标签: android skype skypedeveloper


    【解决方案1】:

    您可以为此使用 Skype URI 方案 (Skype:echo123?chat)。

    您可以在此处找到有关 URI 方案的更多信息:https://dev.skype.com/skype-uri

    谢谢

    艾伦·史密斯 Skype 开发人员支持经理

    【讨论】:

    • 链接已失效。我在 uri 方案中到底放了什么?那里可以放电话号码吗?给定联系人 ID 或电话号码,我应该放什么?可以举个例子吗?
    • @androiddeveloper 你可能想参考这个答案。 stackoverflow.com/a/2841708/1567675
    • @BharatDodeja 你会如何在 Android 代码中使用它?
    • @androiddeveloper 在下面看到我的回答。
    【解决方案2】:

    这是打开 Skype 聊天对话的代码:

      private void openSkype(Context context) {
    
      // Make sure the Skype for Android client is installed
            if (!isSkypeClientInstalled(context)) {
                goToMarket(context);
    
                return;
            }
    
            final String mySkypeUri = "skype:echo123?chat";
                        // Create the Intent from our Skype URI.
                        Uri skypeUri = Uri.parse(mySkypeUri);
                        Intent myIntent = new Intent(Intent.ACTION_VIEW, skypeUri);
    
                        // Restrict the Intent to being handled by the Skype for Android client only.
                    myIntent.setComponent(new ComponentName("com.skype.raider", "com.skype.raider.Main"));
                    myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    
            try {
                        context.startActivity(myIntent);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
        }
    
    /**
         * Determine whether the Skype for Android client is installed on this device.
         */
        public boolean isSkypeClientInstalled(Context myContext) {
            PackageManager myPackageMgr = myContext.getPackageManager();
            try {
                myPackageMgr.getPackageInfo("com.skype.raider", PackageManager.GET_ACTIVITIES);
            } catch (PackageManager.NameNotFoundException e) {
                return (false);
            }
            return (true);
        }
    
    /**
         * Install the Skype client through the market: URI scheme.
         */
        public void goToMarket(Context myContext) {
            Uri marketUri = Uri.parse("market://details?id=com.skype.raider");
            Intent myIntent = new Intent(Intent.ACTION_VIEW, marketUri);
            myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            myContext.startActivity(myIntent);
        }
    

    【讨论】:

    • 没有参数去特定人的聊天。它只会以这种方式打开应用程序。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-12-08
    • 2020-01-21
    • 1970-01-01
    • 2018-11-06
    • 1970-01-01
    • 2016-09-13
    • 1970-01-01
    相关资源
    最近更新 更多