stefun
stefun

Reputation: 1551

Facebook page app in mobile

I have few question related to facebook page app.

I have created facebook page app. In my facebook page I have added my app as favorite in my page. So through desktop browser everyone can easily access it. But how we can do same thing for facebook page in mobile (app & browser)?

Also, I want to open my app through QR code. It should open inside facebook app if fb app already installed else should open in browser. What is the url should use for QR code.

I have went through many queries related to this.but many solutions are related to redirecting to pages,not to apps. I tried these solution by changing parameters to app id. But no improvement on this.

Any solutions?

Upvotes: 0

Views: 345

Answers (2)

Ben
Ben

Reputation: 2651

Facebook will help you do the redirection if you use a Canvas App. Any users who go to your canvas app url will be redirected to the mobile url you have configured in your app settings, you can then set the canvas app to redirect to your page tab for desktop users.

Detailed instructions here: https://stackoverflow.com/a/15860533/121285

Upvotes: 1

Fabio Antunes
Fabio Antunes

Reputation: 22862

This a bit tricky, but for your app to work both on mobile devices and page tabs, must have two platforms, Page Tab and Website.

This picture shows a possible configuration for your app: facebook app config

Now that you've done that, somewhere on your server side you will have to create a gateway, that redirects users based on their browser's user agent (notice that this isn't 100% bullet proof)

You could have something like this https://mydomain.com/gateway

And this will also be the url for your QR code

And the server code will be something this:

if(user_browser_is_mobile==true)
  header( 'Location: http://mydomain.com/mobile' );
else
  header( 'Location: https://www.facebook.com/YOUR_PAGE_ID?sk=app_YOUR_APP_ID' );

I'm guessing your coding in PHP, if you're using some framework probably they have some function to guess if the user_agent is from a mobile device

If your using plain PHP I advise you to download this library that does the trick for you: https://code.google.com/p/php-mobile-detect/

Upvotes: 1

Related Questions