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

Forums

OverviewFelgo Plugins Support › Facebook Plugin – login

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #16454

    John Croucher

     

    Using this example code.

    Facebook {
           id: facebook
           appId: "*removed*"
    
           onSessionStateChanged: {
             if (sessionState === Facebook.SessionOpened) {
               console.debug("Session opened.");
    
               // Session opened, you can now perform any Facebook actions with the plugin!
             }
             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.");
             }
           }
    
           Component.onCompleted: {
             facebook.openSession();
           }
    
         }

     

    It returns “Session opening” and nothing further. The Facebook Analytics shows the app is being hit though.

    Any thoughts on what I have missed?

    #16459

    John Croucher

    A side question to the Facebook plugin is there a recommended way of sharing the Facebook session between the app itself and embedded pages in a WebView?

    As in, if a user logs in using the Qt Facebook Plugin, if I load an embedded page can this also reflect the logged-in state?

    #16476

    Lorenz

    Hi John,

    Thanks for your post.

    I just tested your code inside our PluginDemo project which is available on github, and it works like a charm.

    Are you sure you correctly set up you app on facebook? If you are unsure how to configure your app, check out our guide.

    Let me know if that helps!

    All the best,

    Lorenz

    #16478

    Günther
    Felgo Team

    Hi John!

    As far as I know, the embedded WebView runs independent from the actual application, so sharing the same Facebook session of the WebView and the FB Plugin is not easily possible. You can try Lorenz’s suggestion to re-use the FB accessToken, though I don’t believe you can easily tweak the Facebook page within WebView to re-use this token.

    Is this feature important for your app?
    We generally recommend to not rely on WebView too much, as a special QML-based UI with Felgo is always better in terms of user-experience.

    Best,
    Günther

     

    #16479

    John Croucher

    Yes, it is important for our projects as we have complex ticket purchasing systems already developed which we don’t want to redevelop in an app. We also need the ability to quickly modify the purchasing system without going through the app deployment and approval process.

    I have gotten around it before but it’s just difficult and not very clean.

     

    Re the Facebook plugin. I have found that it works on the second button press.

    Push login, it comes up with the license message and it goes to opening session. Select the button again, I get the license message again, opening session then the opened session message with all the other details.

    #16481

    Günther
    Felgo Team

    Thanks for clarification John!

    In that case, you can try to go for a solution that shares the app accessToken with your custom ticket purchasing system. I can imagine some service to register the accessToken on the server-side for each unique device, and then use this token to handle the sessions.

    You can access a unique device identifier with the system.UDID property.

    Hope this helps!

    Best,
    Günther

    #16483

    Christian
    Felgo Team

    It should work if you use the accessToken and the facebook username, you won’t need an UDID.

    Cheers, Chris

Viewing 7 posts - 1 through 7 (of 7 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