UNPKG

one

Version:

One is a React framework for web, iOS, and Android apps.

34 lines (31 loc) • 671 B
import { Linking, Platform, Share } from "react-native"; async function openURL(url) { await Linking.openURL(url); } async function openShare(param) { var { title, message, url } = param; if (url != null && Platform.OS === "ios") { await Share.share({ title, message, url }); return; } var text = [message, url].filter(Boolean).join(" "); if (!text) throw new Error("openShare: pass a message or a url"); await Share.share({ title, message: text }); } async function openSettings() { await Linking.openSettings(); } var Open = Object.freeze({ openURL, openShare, openSettings }); export { Open }; //# sourceMappingURL=index.native.js.map