React Native 打开 Facebook 页面 [英] React Native open Facebook page

查看:35
本文介绍了React Native 打开 Facebook 页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试使用 React Native Linking API 打开 Facebook 页面.它对我不起作用.我确实安装了 Facebook 应用程序.这是我尝试过的:

I've been trying to open Facebook page using React Native Linking API. It doesn't work for me. I do have Facebook app installed. Here is what I tried:

Linking.openURL('fb://page/<page_name>');
Linking.openURL('fb://profile/<profile_name>');
Linking.openURL('http://facebook.com/<page_name>');

我也尝试使用 Communications 库:Communications.web(url).没有一个适用于 Facebook 和 Instagram.然而,它对谷歌地图、苹果地图、Twitter 和其他大公司来说就像一个魅力.

I also tried to use Communications library: Communications.web(url). None works for Facebook and Instagram. However it works like a charm for Google Maps, Apple Maps, Twitter and other big guys.

我想知道我是不是做错了什么,或者我们应该向 Facebook 的那些人发送一些关于如何在他们的应用程序中正确实施深层链接的 Android 文章?他们显然不知道自己在做什么.

I was wondering if I was doing something wrong or maybe we should send some Android articles to those people from Facebook on how to properly implement deep linking in their apps? They clearly don't know what they are doing.

推荐答案

好的,找到了打开 Facebook 的方法:

Ok, found one way to open Facebook:

Linking.openURL('fb://page/PAGE_ID');
Linking.openURL('http://instagram.com/_u/USER_NAME');
Linking.openURL('http://instagram.com/_p/PICTURE');

这篇关于React Native 打开 Facebook 页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆