react-native-rnevents
Version:
The package was created for React Native. It allows to open webpages, make a phone call, call using Viber, Whatsapp and Telegram, take a keyboard event for hooks and make hooks components to work.
25 lines (22 loc) • 826 B
JavaScript
/************************************************************************
* Copyright (c) Amur
* https://github.com/AmurKhoyetsyan/react-native-rnevents.git
*
* React native open web url with react-native
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*************************************************************************/
import { Linking } from "react-native";
export const Web = url => {
Linking.canOpenURL(url).then(supported => {
if (supported) {
Linking.openURL(url).then(res => {}).catch(err => {
console.log("err ::", err);
});
} else {
console.log("Don't know how to open URI: " + url);
}
});
};
export default Web;