Forums

#1 2009-11-02 06:06:11

theStranger
New Member
Registered: 2009-11-02
Posts: 5

FB.Connect.streamPublish auto_publish not working for Pages

Hi All,
I am using following code :

Code:

<body>
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_US" type="text/javascript"></script>
<script type="text/javascript">
function publish2FB()
{

var message = 'This is the status update'; 
var attachment = {'name':'title text','href':'http://mysite.com','href':'http://mysite.com', 'caption':'Source:fb.myTestApp','description':'tempor. Proin vitae lectus ut massa sagittis congue. Phasellus feugiat vehicula ultricies. Integer neque ante, ullamcorper at aliquet eu, ultricies quis metus. Nullam placerat congue enim, quis cursus dui pellentesque vel.','media': [{'type': 'video', 'video_src': 'http://www.youtube.com/watch?v=7nfsiDFOYL0', 'preview_img':'http://i4.ytimg.com/vi/7nfsiDFOYL0/default.jpg', 'video_link': 'http://www.thestranger.co.nr','video_title': 'Smack That'}]}; 

FB.Connect.streamPublish(message, attachment, null,'',null,null,true,'page_id');
}
</script>
<fb:login-button onlogin="publish2FB()" ></fb:login-button>
<script type="text/javascript">  
    FB.init("API_key", "xd_receiver.htm"); 
</script>

</body>

I have accepted the publish_stream permission for the Page. But still when I want publish to my page's stream I get the prompt dialog before publishing.
I want to publish a feed story to the Page without the prompt dialog. Please anybody help.

Offline

 

#2 2009-11-03 02:08:53

theStranger
New Member
Registered: 2009-11-02
Posts: 5

Re: FB.Connect.streamPublish auto_publish not working for Pages

nebody to answer what i am missing actually ?! Please. I'm so stuck :-S

Offline

 

#3 2009-11-03 04:28:37

theStranger
New Member
Registered: 2009-11-02
Posts: 5

Re: FB.Connect.streamPublish auto_publish not working for Pages

Yes I can publish to the Page feed now.
But I want to publish on behalf of the Page and Without Prompt dialog !!
Please somebody reply something :-S

Offline

 

#4 2009-11-03 04:42:36

Hems
New Member
Registered: 2009-10-29
Posts: 10

Re: FB.Connect.streamPublish auto_publish not working for Pages

w're u were wrong? still i cant post my feed.. is this code correct ?

Offline

 

#5 2009-11-03 05:50:19

donachy
Member
Registered: 2009-01-14
Posts: 128

Re: FB.Connect.streamPublish auto_publish not working for Pages

before you can publish automatically to stream you have to prompt for extended_permission (publish_stream permission)

see there
http://wiki.developers.facebook.com/ind … ermissions

Offline

 

#6 2009-11-03 06:01:49

theStranger
New Member
Registered: 2009-11-02
Posts: 5

Re: FB.Connect.streamPublish auto_publish not working for Pages

Hi donachy,
Thanks for your reply.
I did prompt for the extended permission. And when I check the application setting of the my application at my page I do see that it has the permission to publish to stream.
Can you please tell me what actually I'm missing or can you share some working example code ?

Thanks again.

Hems,

Hems wrote:

w're u were wrong? still i cant post my feed.. is this code correct ?

Please check the demo I'm checking at the following url. as it is JS you shud be able to see the source code:

http://ourgroup.isgreat.org/fbTest/testConnect.html

Last edited by theStranger (2009-11-03 06:09:49)

Offline

 

#7 2009-11-03 10:03:54

donachy
Member
Registered: 2009-01-14
Posts: 128

Re: FB.Connect.streamPublish auto_publish not working for Pages

sorry but I don't use FB.Connect, I have a canvas application, I've just assumed  that could be the problem...

Offline

 

#8 2009-11-06 23:00:59

simpletext
New Member
Registered: 2009-11-06
Posts: 2

Re: FB.Connect.streamPublish auto_publish not working for Pages

Did you figure out the issue, theStranger? I'm experiencing a very similar issue.

Offline

 

#9 2009-11-08 21:50:53

theStranger
New Member
Registered: 2009-11-02
Posts: 5

Re: FB.Connect.streamPublish auto_publish not working for Pages

simpletext,
I'm afraid,nope I din get anyway out yet :-S Please let me know if you got anything. However. I'll be posting if I I can manage it.

Offline

 

#10 2009-11-09 10:21:15

gotogroupbuy.com
New Member
Registered: 2009-07-08
Posts: 6

Re: FB.Connect.streamPublish auto_publish not working for Pages

I have the same problem as everybody else. Is there a bug open for this yet?

Offline

 

#11 2009-11-27 03:36:15

jethroma
New Member
Registered: 2009-11-23
Posts: 6
Website

Re: FB.Connect.streamPublish auto_publish not working for Pages

Hi all,

As some of you may have noticed, if you perform the auto streamPublish immediately after getting the publish_stream permission from the user (e.g. in the callback of showPermissionDialog), you need to refresh the JS session first to allow JS to see thisnew permission.

Example:

Code:

    function permissionHandler(permStr) {
      var perms = permStr.split(',');
      for (var i=0; i<perms.length; i++) {
        if (perms[i] == 'publish_stream') {
          FB.Connect.forceSessionRefresh(function() {
            var attachment = /* your stuff here */;
            FB.Connect.streamPublish('hello world', attachment, null, null, null, null, true, null);
          });
        }
      }
    }

Hope that helps you.


diPoll - social voting platform

Offline

 

#12 2009-11-30 11:20:58

samiujan
Member
Registered: 2007-10-22
Posts: 21

Re: FB.Connect.streamPublish auto_publish not working for Pages

having the same problem... but did u make sure u have all arguments in correct order - i had that prob, plus if u don't define stream_callback func, it throws an error

function stream_callback(){}
var attachment = {'media': [{'type':'image',
'src':'http://bit.ly/AJTnf',
'href':'http://bit.ly/hifZk'}]};

FB.Connect.streamPublish("hello from facebook connect!, with auto-permissions", attachment, null, null, "", stream_callback, true, null);

This is how http://developers.facebook.com/docs/?u= … eamPublish defines it:

streamPublish(String user_message,  Object attachment,  Object action_links,  String target_id,  String user_message_prompt,  Function callback,  Boolean auto_publish,  String actor_id)

My problem is that the request is never sent/response-received... not sure why

Offline

 

#13 2009-12-02 03:54:51

hardik
New Member
Registered: 2009-11-24
Posts: 5

Re: FB.Connect.streamPublish auto_publish not working for Pages

hello,
I am completely new to FB development.Can anybody help me how to use FB.ConneCt.streamPublish.
I am creating an iphone application.I want that my user is playing the game on iphone and he wants to put his or her highest score on his or her wall on Facebook or on his or her friends wall in Facebook.Currently the problem I am facing is that after the login I have to click the _feedbutton and then i get a text book where I have to type what is to be publish on my wall.But I don't want that.I want that after login it should directly give me the publish screen.I am using the same sample code which is given under the Facebook developer section.I have also succeed in creating the extended permission that is publish_stream.Please Help me.PLEASE....Thanks in advance.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson