How to open the FB application using intention and show the page you like in the FB application?

Actually, I call the Fb application using Intent from my application and show how the page is if the user has the Fb application and then I use the application to show a similar page, otherwise I show a similar page in the browser, but in the application fb user is not logged in, it shows fb login page and then after logging in it shows channel page and not as page, you can help me 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")); } 
+6
source share
1 answer

just thinking about other solutions:

1- why don't you open the page in your application in a web browser so that you can scan the html to determine if it is a facebook login page or a desired β€œLike” page? I mean: crawl the page, indicate a boolean if it is not like a page, and when the login request is approved, ask your internal web client to open the url of desire. Perhaps using the shouldOverrideUrlLoading (WebView view, String url) SDK method or something like that.

2. Why don't you use facebook sdk to check your Facebook connection and then send it to your page? If he has the application installed, sdk will automatically open the facebook application and register the user. Then, when it returns to your application, click the Like button in onSessionStateChange or more.

What do you think?

-2
source

Source: https://habr.com/ru/post/954227/


All Articles