2017-09-01 48 views
0

我目前正在爲網站上的Linkedin提供分享按鈕。一切正常,只是當我試圖把它分享給個別人(Share to individual people screenshot)與共享網址(https://www.linkedin.com/shareArticle?mini=true & URL = MYURL),他們通過看它 android應用程序。在android上,消息「我認爲你可能對 感興趣」在消息框中顯示,但沒有鏈接到該網站。我 也試圖做共享鏈接發生器(https://developer.linkedin.com/plugins/share)相同,看看我是否產生了一個錯誤的鏈接,但這會導致相同的問題。我已經測試了IOS應用程序,並且鏈接確實顯示並工作。是否有其他人有相同的問題,並知道發生了什麼問題以及如何解決?提前致謝。當在LinkedIn上分享網站或個人鏈接時,鏈接不會顯示在Linkedin Android應用程序

+1

份額問題 –

+0

你的代碼我使用自定義的URL像https://www.linkedin.com/shareArticle?mini=true&url=MYURL爲紐帶,以分享網頁。 (文檔:https://developer.linkedin.com/docs/share-on-linkedin) – MBE

回答

0

你可以試試這個

Intent linkedinIntent = new Intent(Intent.ACTION_SEND); 
linkedinIntent.putExtra(Intent.EXTRA_TEXT, edinputText.getText().toString().trim()); 
linkedinIntent.setType("text/plain"); 

boolean linkedinAppFound = false; 
List<ResolveInfo> matches2 = this.getPackageManager() 
         .queryIntentActivities(linkedinIntent, 0); 

for (ResolveInfo info : matches2) { 
    if (info.activityInfo.packageName.toLowerCase().startsWith(
          "com.linkedin")) { 
    linkedinIntent.setPackage(info.activityInfo.packageName); 
    linkedinAppFound = true; 
         break; 
        } 
     } 
    if (linkedinAppFound) { 
      startActivity(linkedinIntent); 
     } else { 

      Toast.makeText(MainActivity.this, "Please install the LinkedIn app to share your result", Toast.LENGTH_LONG).show(); 
    } 
相關問題