Open the link in facebook in a browser or on a native application correctly IOS cordova

The previous question on this topic does not work for me, and most of them did not answer.

I want the user on the facebook page to click the button. The updated facebook is installed on the iphone, the last cord is installed, the inappbrowser plugin is used. Now my code

window.open('https://www.facebook.com/latechnologies', '_system','location=yes'); 

This works great on Android. But in the IOS link the nation’s facebook application is posted and take me to the Facebook wall, not to the page. This means that it simply opens its own application, but does not take on any page.

Then I searched and tried some suggestions

 window.open('fb://facebook.com/latechnologies', '_system','location=yes'); window.open('fb://pages/latechnologies', '_system','location=yes'); window.open('fb://pages', '_system','location=yes'); 

None of them work. Every time this happens on the user's wall. How can I just take the user to the facebook page? The native application or browser does not matter. Just want to take the user to the page .....................

+6
source share
5 answers

For me it is better to use the Facebook page name instead of the page name, for example

 window.open('https://www.facebook.com/1401408870089080', '_system'); 
+8
source

Open the MainViewController.m file.

Paste this code after @implementation and before @end MainViewController.

 - (BOOL) webView:(UIWebView*)theWebView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType { NSURL *url = [request URL]; // Intercept the external http requests and forward to Safari.app // Otherwise forward to the PhoneGap WebView if ([[url scheme] isEqualToString:@"http"] || [[url scheme] isEqualToString:@"https"]){ [[UIApplication sharedApplication] openURL:url]; return NO; } else { return [super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType]; } } 
0
source

You need to install a plugin to open applications: org.apache.cordova.inappbrowser 0.5.4 "InAppBrowser"

After that, you should know what a Facebook page identifier is, for this: https://graph.facebook.com/latechnologies

Take the ID number and replace the username of the fan page: https://www.facebook.com/1382616721988023

That's all ...;)

How Jonas answer! Different method! :)

0
source

After trying a few iterations and a few suggestions above, the following code worked for me. window.open ('fb: // pages /,' _system ');

The above information is intended to open the page in the facebook application (if installed).

Of course, I installed the corappa inappbrowser plugin.

0
source

I know this is old, but I had this problem too, and the accepted answer is through the browser, and not through the FB application.

Answer = fb://profile/12323435435

The iOS pages are under the profile

 fb://profile/ - FOR IOS fb://page/ - FOR ANDROID <a onclick="window.open('fb://profile/INSERT_FB_ID_HERE','_system')"> Your text or button here </a> 

You can find the FB profile or page here: https://findmyfbid.com

0
source

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


All Articles