2014-09-24 92 views
2

我想打開Facebook的URI模式,並有一個預定義的文本。
我無法實現我想要的功能,我只能打開Facebook,但沒有預定義的文本。打開Facebook使用URI發佈狀態計劃

我試過如下:

fb://publish/profile/me?text=test 
fb://publish/?text=#test# 
fb://post/?message=test 
fb://composer?text=test 

任何想法如何實現的呢? (我用的Nexus 5,如果它的事項)

+0

您不應該預先填寫用戶以任何方式發佈的消息。平臺政策明確地這樣說。 – CBroe 2014-09-24 09:57:56

+0

@CBroe,那是什麼?我不代表他發佈信息,只是填寫他的信息。 – Ron 2014-09-24 10:04:39

+0

這就是你不能做的事 - https://developers.facebook.com/policy,點2.3:_「確保用戶信息參數**中的所有內容都是由用戶輸入的。預先填寫。**「_ – CBroe 2014-09-24 10:20:10

回答

3

我還沒有它的工作,但讓我嘗試幫助你在這個什麼我發現是

Facebook的自定義URL方案。

這裏是我發現由於Robert Strojan

fb://profile – Open Facebook app to the user’s profile 
fb://friends – Open Facebook app to the friends list 
fb://notifications – Open Facebook app to the notifications list (NOTE: there appears to be a bug with this URL. The Notifications page opens. However, it’s not possible to navigate to anywhere else in the Facebook app) 
fb://feed – Open Facebook app to the News Feed 
fb://events – Open Facebook app to the Events page 
fb://requests – Open Facebook app to the Requests list 
fb://notes- Open Facebook app to the Notes page 
fb://albums – - Open Facebook app to Photo Albums list 

下面是Jared Rummler

String facebookUrl = "https://www.facebook.com/rdcworld"; 
try { 
     int versionCode = getPackageManager().getPackageInfo("com.facebook.katana", 0).versionCode; 
     if (versionCode >= 3002850) { 
      Uri uri = Uri.parse("fb://facewebmodal/f?href=" + facebookUrl); 
      startActivity(new Intent(Intent.ACTION_VIEW, uri));; 
     } else { 
      // open the Facebook app using the old method (fb://profile/id or fb://pro 
     } 
} catch (PackageManager.NameNotFoundException e) { 
    // Facebook is not installed. Open the browser 
    startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(facebookUrl)); 
} 
+1

我有以下http://wiki.akosma.com/IPhone_URL_Schemes#Facebook但它並不真正回答我的問題。我不能使用Java,因爲我使用網絡(HTML/JavaScript) – Ron 2014-09-24 10:05:58

+0

[This](http://stackoverflow.com/questions/19942236/what-are-the-updated-2013-facebook-uri-schemes-for-ios - 和 - 機器人)傢伙正在談論Html/iOS/Android請看看。 – swiftBoy 2014-09-24 10:17:28