import { Anchor } from 'expo-linking';
<Anchor href="https://google.com">Go to Google</Anchor>
<Anchor href="mailto:support@expo.dev">Email support</Anchor>
import React, { Component } from 'react';
import { Button, Linking, View, StyleSheet } from 'react-native';
import * as WebBrowser from 'expo-web-browser';
import Constants from 'expo-constants';
export default class App extends Component {
render() {
return (
<View style={styles.container}>
<Button
title="Open URL with ReactNative.Linking"
onPress={this._handleOpenWithLinking}
style={styles.button}
/>
<Button
title="Open URL with Expo.WebBrowser"
onPress={this._handleOpenWithWebBrowser}
style={styles.button}
/>
</View>
);
}
_handleOpenWithLinking = () => {
Linking.openURL('https://expo.dev');
};
_handleOpenWithWebBrowser = () => {
WebBrowser.openBrowserAsync('https://expo.dev');
};
}
exp://
๋ฅผ ์ด์ฉํ๋ฉด expo ์ฑ์ ์ผค ์ ์๋ค.app.json
์ expo > schema > (์ฑ์ด๋ฆ)์ ์ค์ ํ๋ฉด (์ฑ์ด๋ฆ)://
๋ก ๋น์ ์ ์ฑ์ ์ผค ์ ์๋ค.ejected
๋ฅผ ํ ์ ์ด ์๋ค๋ฉด, app.json ์์ ๋ง์ผ๋ก (์ฑ์ด๋ฆ) ์ค์ ์ ๋ฐ๊ฟ ์ ์๋ค.CFBundleURLSchemes
in ios/<your-project-name>/Info.plist
data android:scheme
tag in android/app/src/main/AndroidManifest.xml
Linking.addEventListener('url', callback)
Linking.getInitialURL
-- it returns a Promise
Linking.createURL('path/into/app', {queryParams: {hello: 'world' }});
์ด๋ ๊ฒ!Linking.parse(url)
๋ก ํ๋ฉด ๋จA common use case for linking to your app is to redirect back to your app after opening a WebBrowser. For example, you can open a web browser session to your sign in screen and when the user has successfully signed in, you can have your website redirect back to your app by using the scheme and appending the authentication token and other data to the URL.
Note: if try to use Linking.openURL to open the web browser for authentication then your app may be rejected by Apple on the grounds of a bad or confusing user experience. WebBrowser.openBrowserAsync opens the browser window in a modal, which looks and feels good and is Apple approved.
To see a full example of using WebBrowser for authentication with Facebook, see examples/with-facebook-auth. Currently Facebook authentication requires that you deploy a small webserver to redirect back to your app (as described in the example) because Facebook does not let you redirect to custom schemes, Expo is working on a solution to make this easier for you. Try it out in Expo.
Another example of using WebBrowser for authentication can be found at examples/with-auth0.
/.well-known/apple-app-site-association
์ด๋ ๊ฒ ํ์ผ์ ์ฌ๋ฆฐ๋ค.intentFilters
๋ง ์ค์ ํ๋ฉด ๋๋ค. ("autoVerify": true
ํฌํจ)/.well-known/assetlinks.json
์ฌ๊ธฐ์ ๋ง์ฐฌ๊ฐ์ง๋ก JSON ํ์ผ์ ์ฌ๋ฆฐ๋ค.