使用ShareSDK在Unity3d截屏分享到QQ

在前篇<<使用ShareSDK在Unity3d截屏分享到微信>>随笔的基础,增加分享图片到QQ

  1. 到腾讯开放平台注册账号open.qq.com并申请应用并取得AppId和AppKey
  2. 在ShareSDK脚本输入                                                                                                                                                          
  3. 打开AndroidManifest.xml,在QQ对应的activity下的<data android:scheme="tencentXXX" />的XXX替换为AppId

     

  4.  注释掉部分代码content.SetTitle("标题title");
        public void OnShareClick()
        {
            ShareContent content = new ShareContent();
    
            ScreenCapture.CaptureScreenshot("capture.png");
            content.SetImagePath(Application.persistentDataPath + "/capture.png");
            //content.SetTitle("标题title");
            //content.SetTitleUrl("www.qq.com");  
            content.SetShareType(ContentType.Image);
            shareSdk.ShowPlatformList(null, content, 100, 100);                      //弹出分享菜单选择列表
            //shareSdk.ShowShareContentEditor(PlatformType.WeChat, content);                 //指定平台直接分享
        }

     

posted @ 2018-04-09 22:51    阅读(911)  评论(0编辑  收藏  举报