Android Question How you can open facebook page inside application?

BitsAndBytes

Active Member
Licensed User
I want to open a facebook page with button on the exit of my application
B4X:
Dim fURI As String
Dim FacebookPage As Intent

     fURI = "https://www.facebook.com/agronote/"
     FacebookPage.Initialize(FacebookPage.ACTION_VIEW,fURI)
     StartActivity (FacebookPage)

When i run that the programm opens the brower, how i can open the user facebook application instead?

Thank you, great forum and great help :)
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Try this:
B4X:
Sub Activity_Click
   Dim fURI As String =  "https://www.facebook.com/agronote/"
   Dim in As Intent
   in.Initialize(in.ACTION_VIEW, "fb://facewebmodal/f?href=" & fURI)
   Try
     StartActivity(in)
   Catch
     Log(LastException)
     Dim FacebookPage As Intent
     FacebookPage.Initialize(FacebookPage.ACTION_VIEW,fURI)
     StartActivity (FacebookPage)
   End Try
End Sub

It is based on this answer: http://stackoverflow.com/questions/...-page-in-facebook-app-if-installed-on-android
 
Upvote 0

appie21

Active Member
Licensed User
Longtime User
Hi if i try this code and I change the
https://www.facebook.com/agronote/ to my own page something goes wrong (also by this page)

It open the app but it is not the main screen of the facebookpage (where you can like it anf follow it (is looks like it show one of the last post of that page)

How can I fix this?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Please create a new thread for any question you have.
Posting to an old thread is the wrong way.
 
Upvote 0
Top