How to Open a FB App Using Intent and Show a Like Page in FB App?
Asked Answered
P

1

6

Actually i am calling a Fb App using Intent from my app and showing like page if the user has Fb app then i am using the app to show the like page otherwise i am showing the like page in browser but in fb app the user is not login means it shows fb login page then after login it showing feed page instead of like page can you help me to solve this answer :-) Right now i am using this code

 try { 
   context.getPackageManager().getPackageInfo("com.facebook.katana", 0); 
   return new Intent(Intent.ACTION_VIEW, Uri.parse("fb://page/1086017928736241")); 
 } catch (Exception e) { 
   return new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.facebook.com/Animgeek")); 
 }
Prothonotary answered 20/9, 2013 at 6:9 Comment(0)
G
-2

just thinking of others solutions:

1- why don't you open the page into your app in a webview so that you could scan the html to detect whether it's the facebook login page or the desired "Like" page ? I mean: Scan the page, flag a boolean if it is not the like page and when the login request is ok, ask your inner webClient to open the desire url. Maybe by using the shouldOverrideUrlLoading(WebView view, String url) method of the SDK or something like that.

2- why don't you use the facebook sdk to check the user facebook's connection and then, send him to your like page ? If he has the app installed, the sdk will automatically open the facebook app and log your user. Then when it returns to your app, push you "Like" page in the onSessionStateChange or else.

What do you think?

Gerena answered 10/2, 2014 at 8:32 Comment(3)
Yep this is the way. But seriously Facebook sdk just such a pain in the *** to use :/Shushubert
User session state checking is not that hard if you follow the facebook website tutorial.Gerena
Yes if you are used to it, once you have done it once there is no prob for the next timesShushubert

© 2022 - 2024 — McMap. All rights reserved.