使用ShareSDK在Unity3d截屏分享到QQ

在前篇<<使用ShareSDK在Unity3d截屏分享到微信>>隨筆的基礎,增長分享圖片到QQhtml

  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);                 //指定平臺直接分享
        }
相關文章
相關標籤/搜索