From 853ab7fd291d04e48fcbde7df9b01c3ec7b57519 Mon Sep 17 00:00:00 2001 From: Website Deployment Script Date: Mon, 29 Feb 2016 11:53:18 +0000 Subject: [PATCH] Updated docs for next --- releases/next/docs/intentandroid.html | 78 +------------------------- releases/next/docs/linking.html | 80 ++++++++++++++++++++++++++- 2 files changed, 80 insertions(+), 78 deletions(-) diff --git a/releases/next/docs/intentandroid.html b/releases/next/docs/intentandroid.html index 419282b3891..f0de92f8059 100644 --- a/releases/next/docs/intentandroid.html +++ b/releases/next/docs/intentandroid.html @@ -30,83 +30,7 @@ or the "choose application" dialog will be shown.

You can use ot or any other URL that can be opened with {@code Intent.ACTION_VIEW}.

NOTE: This method will fail if the system doesn't know how to open the specified URL. If you're passing in a non-http(s) URL, it's best to check {@code canOpenURL} first.

NOTE: For web URLs, the protocol ("http://", "https://") must be set accordingly!

@deprecated

static canOpenURL(url: string, callback: Function) #

Determine whether or not an installed app can handle a given URL.

You can use other URLs, like a location (e.g. "geo:37.484847,-122.148386"), a contact, or any other URL that can be opened with {@code Intent.ACTION_VIEW}.

NOTE: For web URLs, the protocol ("http://", "https://") must be set accordingly!

@param URL the URL to open

@deprecated

static getInitialURL(callback: Function) #

If the app launch was triggered by an app link with {@code Intent.ACTION_VIEW}, -it will give the link url, otherwise it will give null

Refer http://developer.android.com/training/app-indexing/deep-linking.html#handling-intents

@deprecated

Examples #

Edit on GitHub
'use strict'; - -var React = require('react-native'); -var { - IntentAndroid, - StyleSheet, - Text, - TouchableNativeFeedback, - View, -} = React; -var UIExplorerBlock = require('./UIExplorerBlock'); - -var OpenURLButton = React.createClass({ - - propTypes: { - url: React.PropTypes.string, - }, - - handleClick: function() { - IntentAndroid.canOpenURL(this.props.url, (supported) => { - if (supported) { - IntentAndroid.openURL(this.props.url); - } else { - console.log('Don\'t know how to open URI: ' + this.props.url); - } - }); - }, - - render: function() { - return ( - <TouchableNativeFeedback - onPress={this.handleClick}> - <View style={styles.button}> - <Text style={styles.text}>Open {this.props.url}</Text> - </View> - </TouchableNativeFeedback> - ); - } -}); - -var IntentAndroidExample = React.createClass({ - - statics: { - title: 'IntentAndroid', - description: 'Shows how to use Android Intents to open URLs.', - }, - - render: function() { - return ( - <UIExplorerBlock title="Open external URLs"> - <OpenURLButton url={'https://www.facebook.com'} /> - <OpenURLButton url={'http://www.facebook.com'} /> - <OpenURLButton url={'http://facebook.com'} /> - <OpenURLButton url={'geo:37.484847,-122.148386'} /> - </UIExplorerBlock> - ); - }, -}); - -var styles = StyleSheet.create({ - container: { - flex: 1, - backgroundColor: 'white', - padding: 10, - paddingTop: 30, - }, - button: { - padding: 10, - backgroundColor: '#3B5998', - marginBottom: 10, - }, - text: { - color: 'white', - }, -}); - -module.exports = IntentAndroidExample;
Next →