2

I am trying to open Facebook with URI scheme and have a predefined text.
I cannot achieve what I want, I can only open the Facebook but without predefined text.

I tried the following:

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

Any idea how to achieve it? (I am using nexus 5 if it matters)

Ron
  • 3,975
  • 17
  • 80
  • 130
  • You are not supposed to pre-fill the message a user is posting in any way. Platform Policies explicitly say so. – CBroe Sep 24 '14 at 09:57
  • @CBroe, what is that? I am not posting on his behalf, just filling his message. – Ron Sep 24 '14 at 10:04
  • And exactly that is what you are _not allowed to do_ - https://developers.facebook.com/policy, point 2.3: _"Ensure that all content in the user message parameter **is entered by the user. Don’t pre-fill.**"_ – CBroe Sep 24 '14 at 10:20
  • @CBroe, if you watch the video https://developers.facebook.com/docs/apps/review/prefill you will see that they are talking about appending text that the user cant see in the post dialog, that's not what I want.. I want to allow the user to see the message and to let him edit it if he wants.. lets take twitter for example: twitter://post?message=test, it opens twitter with the message test but the user can still delete/edit it... – Ron Sep 24 '14 at 10:28
  • 3
    **You are not allowed to pre-fill the message, period.** It does not matter what another platform like twitter allows or not, or what you think the linked video shows. I quoted it from platform policies already, but again: _"Ensure that all content in the user message parameter is entered by the user. Don’t pre-fill."_ - that should be absolutely clear in itself, and doesn't need any further discussion. And it doesn't matter whether or not the user can edit or delete what you pre-filled - that is not the point, the point is that you are not allowed to pre-fill no matter what. – CBroe Sep 24 '14 at 10:40

2 Answers2

4

As @CBroe said,

"You are not supposed to pre-fill the message a user is posting in any way. Platform Policies explicitly say so."

https://developers.facebook.com/policy

Ron
  • 3,975
  • 17
  • 80
  • 130
3

I haven't worked on it, but let me try to help you out in this what I have found is

Facebook custom URL scheme.

Here’s what I’ve found Thanks to 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

Below is the Example by 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));
}
Community
  • 1
  • 1
swiftBoy
  • 35,607
  • 26
  • 136
  • 135
  • 1
    I have the following http://wiki.akosma.com/IPhone_URL_Schemes#Facebook but it doesnt really answer my question/problem. I cant use java because I am using web (html/javascript) – Ron Sep 24 '14 at 10:05
  • [This](http://stackoverflow.com/questions/19942236/what-are-the-updated-2013-facebook-uri-schemes-for-ios-and-android) guy is talking about Html/iOS/Android please have a look. – swiftBoy Sep 24 '14 at 10:17