Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo Plugins Support › Facebook onPostGrapRequestFinished

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #24111

    Carlos J Yu

    Hi,

    I’m getting ResultPermissionDenied on onPostGrapRequestFinished even though I added this line:

    publishPermissions: [ "publish_actions" ]

    Please advice.

     

    Best,

    Cyware

    #24112

    Alex
    Felgo Team

    Hi Carlos,

    what action are you trying to accomplish using the Graph API? I’ll then forward this to our plugin specialists to further investigate it. Any small code example will surely also help.

    Best,
    Alex

    #24113

    Carlos J Yu

    Hi Alex,

    I’m trying to post on Facebook, here’s some of my code.

    Facebook {
            id: facebook
            appId: "*************"
            readPermissions: [ "public_profile", "email", "user_friends" ]
            publishPermissions: [ "publish_actions" ]
    
            onSessionStateChanged: {
                 if (sessionState === Facebook.SessionOpened) {
                   console.debug("Session opened.");
                   shareToFb()
                 }
                 else if (sessionState === Facebook.SessionOpening) {
                   console.debug("Session opening...");
                 }
                 else if (sessionState === Facebook.SessionClosed) {
                   console.debug("Session closed.");
                 }
                 else if (sessionState === Facebook.SessionFailed) {
                   console.debug("Session failed.");
                 }
                 else if (sessionState === Facebook.SessionPermissionDenied) {
                   console.debug("User denied requested permissions.");
                 }
               }
    
            onPostGraphRequestFinished: {
                if(resultState == Facebook.ResultOk)
                    NativeDialog.confirm("Message Posted Successfully", "", function(){}, false)
                else if ( resultState == Facebook.ResultPermissionDenied )
                    NativeDialog.confirm("ResultPermissionDenied", "", function(){}, false)
                else if ( resultState == Facebook.ResultInvalidSession )
                    NativeDialog.confirm("ResultInvalidSession", "", function(){}, false)
                else if ( resultState == Facebook.ResultError )
                    NativeDialog.confirm("ResultError", "", function(){}, false)
            }
        }

    here’s how I post.

    function shareToFb() {
        console.log("sharing...")
        if (facebook.sessionState === Facebook.SessionOpened) {
            facebook.postGraphRequest( "me/feed",
                                     {   "link" : imgUrl ,
                                         "name" : shareTitle,
                                         "description": fbDesc,
                                         "message" : fbMessage } )
        }else {
            facebook.openSession()
       }
    }

    Thanks in advance for your help.

    Best,

    Cyware

    #24114

    Alex
    Felgo Team

    Hi Carlos,

    the “publish_action” permission to share a post using the Graph API only works for approved partners of Facebook now. There is a new API for this purpose, that is not yet implemented with the Facebook plugin. I will check back with the team to see if this is on the immediate roadmap and come back at you.

    Best,
    Alex

Viewing 4 posts - 1 through 4 (of 4 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded