0

I already have code in my Nativescript app that will open facebook to a specific page, using the Facebook app if it's installed or otherwise using the default browser.

Now I have a case where I have the name and address of a person, and I'd like to add a "Find on Facebook" function that will open the search results page, in Facebook, given that person's name, city, and state.

If I go into Facebook, do a simple search on name only, the results have a url such as

https://www.facebook.com/search/top/?q=Aaron%20Rider&epa=SEARCH_BOX

If I tap the Person tab and add a city and state, then the url becomes:

https://www.facebook.com/search/people/?q=Aaron%20Rider&epa=FILTERS&filters=eyJjaXR5Ijoie1wibmFtZVwiOlwidXNlcnNfbG9jYXRpb25cIixcImFyZ3NcIjpcIjEwNzc0MjQ2OTI1NDk3M1wifSJ9

And, in either case, using the Facebook scheme of fb:// with the url only opens the app but not to the search results.

So, is there a way to open the Facebook app or web site, via a url, to the search results for a given name, city, and state? My searches and testing to date haven't yielded any useful results.

Edit May 14, 2020:

To clarify further... my app determines whether the Facebook app is installed or not. If so, in invokes Facebook via a fb://... url, and if not, it opens a browser with an https://www.facebook.com/... url.

Based on this page, I discovered the http solution. For example, if the person in question is Andy Griffith in Raleigh, then the associated url would be https://www.facebook.com/search.php?type=users&q=Andy%20Griffith&lo=Raleigh. This brings up facebook's search results page with the location filter added. Yay!

What I'm still looking for is the equivalent fb:// url when opening the Facebook app. So far I can only bring up the search page, but without any input parameters or filters applied.

Edit May 15, 2020, for those following along at home...

Still searching. I happened to find this repository, which can create Facebook search urls with filters, and this page, which describes how the filters are created (base64 encoding of a JSON object).

I was able to compose a URL that worked with the Facebook web site, but that same url content with the fb:// scheme just takes me to the Facebook app's search home screen with no parameters passed.

Dang, this looked so promising!

David
  • 578
  • 3
  • 16
  • Does this answer your question? [What are all the custom URL schemes supported by the Facebook iPhone app?](https://stackoverflow.com/questions/5707722/what-are-all-the-custom-url-schemes-supported-by-the-facebook-iphone-app) – Manoj May 14 '20 at 22:02
  • @Manoj - as usual, thanks for the response. Your reply led me to [this page](https://www.facebook.com/notes/jon-steiger/how-to-filter-your-people-searches-on-facebook-using-the-address-bar/163272303758672/), which works for the web version of Facebook but not the app. (No surprise really, with ".php" in the url). Using the Facebook scheme of fb://search I could only open the search page, regardless of what parameters followed. I tried every imaginable option with no luck :-(. – David May 15 '20 at 02:05

0 Answers0