How to open a direct url in facebook application?

-2

I have a webview where the social networks are registered through the links, example :( " link " etc etc ..)

But only for facebook it is open in the browser and not in the app. Can someone help me? I would like you to open this user's profile this way.

Thank you for your attention.

    
asked by anonymous 21.05.2018 / 18:52

1 answer

0
  

java

Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.addCategory(Intent.CATEGORY_BROWSABLE);
intent.setData(Uri.parse("https://www.facebook.com/HU.APP1/?fref=ts"));
startActivity(intent);
  

react

import React, { Component } from 'react';
import { WebView } from 'react-native';

class MyWeb extends Component {
  render() {
    return (
      <WebView
        source={{uri: 'https://www.facebook.com/HU.APP1/?fref=ts'}}
        style={{marginTop: 20}}
      />
    );
  }
}
  

IONIC

$ ionic cordova plugin add cordova-plugin-inappbrowser
$ npm install --save @ionic-native/in-app-browser


import { InAppBrowser } from '@ionic-native/in-app-browser';

constructor(private iab: InAppBrowser) { }


...


const browser = this.iab.create('https://www.facebook.com/HU.APP1/?fref=ts');

browser.executeScript(...);

browser.insertCSS(...);
browser.on('loadstop').subscribe(event => {
   browser.insertCSS({ code: "body{color: red;" });
});

browser.close();
    
21.05.2018 / 19:35