Linking.openURL('https://www.facebook.com/walmart')
Linking.openURL('fb://profile/walmart');
Linking.openURL('fb://page/walmart');
Linking.openURL('fb://facewebmodal/f?href=walmart')
Linking.openURL('https://www.facebook.com/n/?walmart');
I've tried all of these but all open the web page instead of the app. fb://
opens the app, but doesn't go to the specific page.
React-native 0.61.1
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fb</string>
<string>instagram</string>
<string>twitter</string>
<string>whatsapp</string>
<string>linkedin</string>
<string>fbapi20130214</string>
<string>fbapi20130410</string>
<string>fbapi20130702</string>
<string>fbapi20131010</string>
<string>fbapi20131219</string>
<string>fbapi20140410</string>
<string>fbapi20140116</string>
<string>fbapi20150313</string>
<string>fbapi20150629</string>
<string>fbapi20160328</string>
<string>fbauth</string>
<string>fbauth2</string>
<string>fb-messenger-api20140430</string>
</array>
In order to open a specific facebook page in the facebook app, you need to have the unique identifier (PAGEID).
Option 1: Use some third party service like for example: https://findmyfbid.com/. Here you can just enter the facebook url of the page.
Option 2: Open the facebook url of the page in your browser, perform a right click on the profile image, and press COPY LINK ADDRESS.
Walmart's profile image address is:
www.facebook.com/159616034235/photos/10157225802004236/ The PAGEID is highlighted.
On iOS Devices: fb://profile/PAGEID
On Android Devices: fb://page/PAGEID
CODE EXAMPLE:
const pageID = 159616034235; // Waltmart's ID
const scheme = Platform.select({ ios: 'fb://profile/', android: 'fb://page/' });
const url = `${scheme}${pageID}`;
and then you can use:
Linking.openURL(url);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With