From 2e9c7a273b581967d1db5fd20953ef556c620f67 Mon Sep 17 00:00:00 2001 From: Elliot Hesp Date: Wed, 21 Aug 2019 09:42:56 +0100 Subject: [PATCH 1/8] Update android.md --- docs/analytics/android.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/analytics/android.md b/docs/analytics/android.md index ec492cbb..5fa94982 100644 --- a/docs/analytics/android.md +++ b/docs/analytics/android.md @@ -31,7 +31,7 @@ dependencies { #### Add Analytics to Main Android Application: -**`android/app/src/main/java/**/MainApplication.java`\*\*: +**`android/app/src/main/java/**/MainApplication.java`**: ```java{2,8} // .. From 4c30c8558f274dc8d5ec7f0ad56ce64d853e991c Mon Sep 17 00:00:00 2001 From: ehesp Date: Wed, 21 Aug 2019 10:07:13 +0100 Subject: [PATCH 2/8] Update docs to match module rename --- docs/{fiam => in-app-messaging}/android.md | 0 docs/{fiam => in-app-messaging}/index.md | 0 docs/{fiam => in-app-messaging}/ios.md | 0 .../{fiam => in-app-messaging}/quick-start.md | 0 docs/indexing/android.md | 32 ------ docs/indexing/index.md | 46 -------- docs/indexing/ios.md | 44 ------- docs/indexing/quick-start.md | 107 ------------------ docs/{config => remote-config}/android.md | 0 docs/{config => remote-config}/index.md | 0 docs/{config => remote-config}/ios.md | 0 docs/{config => remote-config}/quick-start.md | 0 docs/sidebar.yaml | 2 +- 13 files changed, 1 insertion(+), 230 deletions(-) rename docs/{fiam => in-app-messaging}/android.md (100%) rename docs/{fiam => in-app-messaging}/index.md (100%) rename docs/{fiam => in-app-messaging}/ios.md (100%) rename docs/{fiam => in-app-messaging}/quick-start.md (100%) delete mode 100644 docs/indexing/android.md delete mode 100644 docs/indexing/index.md delete mode 100644 docs/indexing/ios.md delete mode 100644 docs/indexing/quick-start.md rename docs/{config => remote-config}/android.md (100%) rename docs/{config => remote-config}/index.md (100%) rename docs/{config => remote-config}/ios.md (100%) rename docs/{config => remote-config}/quick-start.md (100%) diff --git a/docs/fiam/android.md b/docs/in-app-messaging/android.md similarity index 100% rename from docs/fiam/android.md rename to docs/in-app-messaging/android.md diff --git a/docs/fiam/index.md b/docs/in-app-messaging/index.md similarity index 100% rename from docs/fiam/index.md rename to docs/in-app-messaging/index.md diff --git a/docs/fiam/ios.md b/docs/in-app-messaging/ios.md similarity index 100% rename from docs/fiam/ios.md rename to docs/in-app-messaging/ios.md diff --git a/docs/fiam/quick-start.md b/docs/in-app-messaging/quick-start.md similarity index 100% rename from docs/fiam/quick-start.md rename to docs/in-app-messaging/quick-start.md diff --git a/docs/indexing/android.md b/docs/indexing/android.md deleted file mode 100644 index 3e434717..00000000 --- a/docs/indexing/android.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: Android Setup | App Indexing -description: Setup your Android application to handle app indexed URLs. ---- - -# Android Manual Linking - -Your Android application needs to be setup to detect whether URLs which a user navigates to on your device are to be -handled by your application. - -To set this up, add a new `intent-filter` to your manifest file. The example below will trigger the app indexing module -to handle URLs from any `https://invertase.io/blog` URL. - -`android/app/src/main/AndroidManifest.xml`: - -```xml - - - - - - - - - - -``` diff --git a/docs/indexing/index.md b/docs/indexing/index.md deleted file mode 100644 index 3165de33..00000000 --- a/docs/indexing/index.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: App Indexing -description: Firebase App Indexing gets your app into Google Search. ---- - -# App Indexing - -Firebase App Indexing gets your app into Google Search. If users have your app installed, they can launch your app and -go directly to the content they're searching for. App Indexing reengages your app users by helping them find both public -and personal content right on their device, even offering query autocompletions to help them more quickly find what they -need. If users don’t yet have your app, relevant queries trigger an install card for your app in Search results. - -React Native Firebase provides functionality to handle events such as users opening the application via a URL which -has been indexed by Firebase. - - - -## Getting Started - - - - Setup your application to handle indexed URLs. - - - Understand how to handle indexed URLs in your application in the reference documentation. - - - -## Learn more - -Our documentation is a great place to start, however if you're looking for more help or want to help others, -check out the resources below: - -- [Stack Overflow](https://stackoverflow.com/questions/tagged/react-native-firebase-indexing) -- [Github Issues](https://github.com/invertase/react-native-firebase/issues?utf8=%E2%9C%93&q=is%3Aissue+sort%3Aupdated-desc+label%3Aindexing+) -- [Firebase Documentation](https://firebase.google.com/docs/firestore?utm_source=invertase&utm_medium=react-native-firebase&utm_campaign=indexing) diff --git a/docs/indexing/ios.md b/docs/indexing/ios.md deleted file mode 100644 index afd4a28f..00000000 --- a/docs/indexing/ios.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: iOS Setup | App Indexing -description: Setup your iOS application to handle app indexed URLs. ---- - -# iOS Manual Linking - -To handle indexed URLs within your iOS app, the URL definition needs to be added to your project using XCode. - -## Setup up with XCode - -Depending on your setup, open the following file with XCode: - -- Using Pods: `ios/.xcworkspace` -- None Pods Setup: `ios/.xcodeproj` - -### Navigate to URL Types - -Open the URL Types configuration for your project: - -1. Select your project on left hand side file tree -2. Select the Info tab on the middle pane -3. Expand the URL Types section header - -![Example](https://prismic-io.s3.amazonaws.com/invertase%2F6b3a9afc-bb0a-44da-b642-ab0da8c48eed_navigate-to-url-types.png) - -### Create a URL Type and Scheme - -After navigating to the URL Types section of your Xcode workspace you can now add a new URL type. - -#### Add new URL type (+) - -1. Click the Add items plus (+) icon at the bottom of the URL Types section: - -![Example](https://prismic-io.s3.amazonaws.com/invertase%2F806d79c8-3208-46db-9b38-7e5b5a13d7a2_add-item.png) - -#### Configure the new URL Type - -1. Input the `Identifier` value; The Identifier is normally the same as your Bundle Identifier which is usually the reverse of the domain for your app e.g. com.mycompany.app. -2. Input the `URL Schemes` value - this can be a comma delimited list of values; For example if you set this to myapp,foobar then your app will then accept urls from myapp://_ and foobar://_. - -`Icon` and `Role` can be left to use the defaults unless you need to change these. - -![Example](https://prismic-io.s3.amazonaws.com/invertase%2F5d66eb78-883f-4f87-b390-adcee22bbff0_configure-item.png) diff --git a/docs/indexing/quick-start.md b/docs/indexing/quick-start.md deleted file mode 100644 index 097aa10d..00000000 --- a/docs/indexing/quick-start.md +++ /dev/null @@ -1,107 +0,0 @@ ---- -title: App Indexing Quick Start -description: Getting started with App Indexing in React Native Firebase ---- - -# App Indexing Quick Start - -## Installation - -Install this module with Yarn: - -```bash -yarn add @react-native-firebase/indexing -``` - -Setup your application by following the platform specific instructions: - - - - Setup your Android application to handle app indexed URLs. - - - Setup your iOS application to handle app indexed URLs. - - - -## Module usage - -The app indexing module provides functionality to hook onto a user opening your application via an app indexed URL. - -Import the module: - -```js -import indexing from '@react-native-firebase/indexing'; -``` - -The package also provides access to the firebase instance: - -```js -import { firebase } from '@react-native-firebase/indexing'; -``` - -### Detecting app opens from a URL - -If a has your application installed, but in a closed state, opening an app indexed URL will cause the app to -open. Once the app has loaded, the `getInitialURL()` method can be called to detected whether the app was opened -by an app indexed URL. If your application was not opened via an app indexed URL, the value will be `null`. - -Note: All URLs which trigger the app to open will be passed to this method, therefore it is important to check -the domain of the URL to check it has come from an indexed source. - -```js -import indexing from '@react-native-firebase/indexing'; - -async function bootstrapApp() { - const url = await indexing.getInitialURL(); - - if (url && url.startsWith('https://invertase.io')) { - if (url === 'https://invertase.io/offers') { - // Handle the URL, e.g. using a react-navigation custom service: - NavigationService.navigate('OffersScreen', { from: 'indexing' }); - } - } -} -``` - -### Subscribe to URL events - -If a user has opened your app and it is open or in a background state, you must subscribe and handle the URL open -event directly within your application life cycle using the `onOpenURL()` method. - -Note: All URLs which trigger the app to handle it are passed to this method, therefore it is important to check -the domain of the URL to check it has come from an indexed source. - -```jsx -import React, { useEffect } from 'react'; -import indexing from '@react-native-firebase/indexing'; - -function App({ navigation }) { - // Listen to open URL events once ready - useEffect(() => { - const unsubscribe = indexing().onOpenURL(url => { - if (url.startsWith('https://invertase.io')) { - if (url === 'https://invertase.io/offers') { - // Handle the URL, e.g. using the react-navigation navigation prop: - navigation.navigate('OffersScreen', { from: 'indexing' }); - } - } - }); - - // Return the function to unsubscribe from - return unsubscribe; - }, []); - - return ; -} -``` diff --git a/docs/config/android.md b/docs/remote-config/android.md similarity index 100% rename from docs/config/android.md rename to docs/remote-config/android.md diff --git a/docs/config/index.md b/docs/remote-config/index.md similarity index 100% rename from docs/config/index.md rename to docs/remote-config/index.md diff --git a/docs/config/ios.md b/docs/remote-config/ios.md similarity index 100% rename from docs/config/ios.md rename to docs/remote-config/ios.md diff --git a/docs/config/quick-start.md b/docs/remote-config/quick-start.md similarity index 100% rename from docs/config/quick-start.md rename to docs/remote-config/quick-start.md diff --git a/docs/sidebar.yaml b/docs/sidebar.yaml index 48672509..bdb4c9ab 100644 --- a/docs/sidebar.yaml +++ b/docs/sidebar.yaml @@ -227,7 +227,7 @@ to: '/ios' - module: remote-config - group: Remote RemoteConfig + group: Remote Config children: - text: Overview to: '/' From e102174b5a6c63bb7145dbc91f4f9b47c1948d14 Mon Sep 17 00:00:00 2001 From: ehesp Date: Wed, 21 Aug 2019 10:09:26 +0100 Subject: [PATCH 3/8] Update docs to match module rename --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 40fb4e9d..dfc4a9a9 100644 --- a/docs/index.md +++ b/docs/index.md @@ -44,5 +44,5 @@ for installation instructions on each individual module page. | Notifications | @react-native-firebase/notifications | notifications | | Performance Monitoring | @react-native-firebase/perf | perf | | Realtime Database | @react-native-firebase/database | database | -| Remote Config | @react-native-firebase/remote-config | remote-config | +| Remote Config | @react-native-firebase/remote-config | remote-config | | Utils | @react-native-firebase/utils | utils | From 6d81cf8129b656538030b36fdeda948ba12a79ad Mon Sep 17 00:00:00 2001 From: ehesp Date: Wed, 21 Aug 2019 10:10:26 +0100 Subject: [PATCH 4/8] Update docs to match module rename --- docs/index.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index dfc4a9a9..d9631d7b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -28,7 +28,6 @@ for installation instructions on each individual module page. | AdMob | @react-native-firebase/admob | admob | | Analytics | @react-native-firebase/analytics | analytics | | App | @react-native-firebase/app | app | -| App Indexing | @react-native-firebase/indexing | indexing | | App Invites | @react-native-firebase/invites | invites | | Authentication | @react-native-firebase/auth | auth | | Cloud Firestore | @react-native-firebase/firestore | firestore | From 17a9f10ab4be54b3c6c15663fcd6aede2436bcfb Mon Sep 17 00:00:00 2001 From: Elliot Hesp Date: Wed, 21 Aug 2019 10:12:38 +0100 Subject: [PATCH 5/8] Update quick-start.md --- docs/remote-config/quick-start.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/remote-config/quick-start.md b/docs/remote-config/quick-start.md index b732175d..25c6edf4 100644 --- a/docs/remote-config/quick-start.md +++ b/docs/remote-config/quick-start.md @@ -39,10 +39,10 @@ import remoteConfig from '@react-native-firebase/remote-config'; async function getValues() { try { - const activated = await config().fetchAndActivate(); + const activated = await remoteConfig().fetchAndActivate(); if (activated) { - const experimentalFeatureEnabled = await config().getValue('experiment'); + const experimentalFeatureEnabled = await remoteConfig().getValue('experiment'); console.log('Experimental source: ', experimentalFeatureEnabled.source); console.log('Experimental value: ', experimentalFeatureEnabled.value); } @@ -62,7 +62,7 @@ have been fetched and activated, it is recommended you set default values using import remoteConfig from '@react-native-firebase/remote-config'; async function bootstrap() { - await config().setDefaults({ + await remoteConfig().setDefaults({ experiment: false, }); } @@ -77,7 +77,7 @@ which are applied in a production application. This can be done with the `setCon import remoteConfig from '@react-native-firebase/remote-config'; async function bootstrap() { - await config().setConfigSettings({ + await remoteConfig().setConfigSettings({ isDeveloperModeEnabled: __DEV__, }); } From cc34ad76e79e6150ef36e955b5ee8c58f931f02e Mon Sep 17 00:00:00 2001 From: Elliot Hesp Date: Wed, 21 Aug 2019 10:16:04 +0100 Subject: [PATCH 6/8] Update android.md --- docs/remote-config/android.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/remote-config/android.md b/docs/remote-config/android.md index eeda8490..2b2f8b58 100644 --- a/docs/remote-config/android.md +++ b/docs/remote-config/android.md @@ -31,7 +31,7 @@ dependencies { #### Add Remote Config to Main Android Application: -**`android/app/src/main/java/**/MainApplication.java`\*\*: +**`android/app/src/main/java/**/MainApplication.java`**: ```java{2,8} // .. From 355bfe4746e92a61470ed2c3330191c3fac7395e Mon Sep 17 00:00:00 2001 From: ehesp Date: Wed, 21 Aug 2019 10:42:47 +0100 Subject: [PATCH 7/8] Update utils docs --- docs/sidebar.yaml | 4 ---- docs/utils/android.md | 11 ----------- docs/utils/index.md | 4 ++-- docs/utils/ios.md | 11 ----------- docs/utils/quick-start.md | 34 ++++++++++++++++------------------ 5 files changed, 18 insertions(+), 46 deletions(-) delete mode 100644 docs/utils/android.md delete mode 100644 docs/utils/ios.md diff --git a/docs/sidebar.yaml b/docs/sidebar.yaml index bdb4c9ab..4259e2d3 100644 --- a/docs/sidebar.yaml +++ b/docs/sidebar.yaml @@ -257,7 +257,3 @@ to: '/' - text: Quick Start to: '/quick-start' - - text: Android Setup - to: '/android' - - text: iOS Setup - to: '/ios' diff --git a/docs/utils/android.md b/docs/utils/android.md deleted file mode 100644 index 5b580dad..00000000 --- a/docs/utils/android.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: Android Setup -description: Manually integrate Utils into your Android application. ---- - -# Android Manual Linking - -> The following steps are only required if your environment does not have access to React Native -> auto-linking. - -## TODO diff --git a/docs/utils/index.md b/docs/utils/index.md index 6d5f207a..a3195d15 100644 --- a/docs/utils/index.md +++ b/docs/utils/index.md @@ -17,7 +17,7 @@ development of the React Native Firebase library. title="Quick Start" to="/quick-start" > - Install & integrate the utils functionality into your app or tests. + Start using the utilities in your own application. - The API reference covers everything required to successfully monitor your apps performance. + The API reference covers everything required to use the utils within your own application. diff --git a/docs/utils/ios.md b/docs/utils/ios.md deleted file mode 100644 index 3adb02e5..00000000 --- a/docs/utils/ios.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: iOS Setup -description: Manually integrate Utils into your iOS application. ---- - -# iOS Manual Linking - -> The following steps are only required if your environment does not have access to React Native -> auto-linking. - -## TODO diff --git a/docs/utils/quick-start.md b/docs/utils/quick-start.md index 475874cf..2311b27e 100644 --- a/docs/utils/quick-start.md +++ b/docs/utils/quick-start.md @@ -5,28 +5,14 @@ description: Getting started with the Utils package in React Native Firebase # Utils Quick Start -## Installation - -Install this module with Yarn: - -```bash -yarn add @react-native-firebase/utils -``` - -> Integrating manually and not via React Native auto-linking? Check the setup instructions for Android & iOS. +The utils module comes installed with the `app` module. ## Module usage -Import the Performance Monitoring package into your project: +Import the Utils package into your project: ```js -import utils from '@react-native-firebase/utils'; -``` - -The package also provides access to the firebase instance: - -```js -import { firebase } from '@react-native-firebase/utils'; +import { utils } from '@react-native-firebase/app'; ``` ### Detect whether the app is running within TestL Lab @@ -40,7 +26,7 @@ It is useful to change the apps configuration if it is being run in Test Lab, fo data collection. Such functionality can be carried out by taking advantage of the `isRunningInTestLab` property: ```js -import utils from '@react-native-firebase/utils'; +import { utils } from '@react-native-firebase/app'; import analytics from '@react-native-firebase/analytics'; async function bootstrap() { @@ -49,3 +35,15 @@ async function bootstrap() { } } ``` + +### Access device file paths + +Some modules require access to your local device filesystem (such as Storage & ML Kit Vision). The utils +module access to the device directory locations, working cross platform on Android & iOS. + +```js +import { utils } from '@react-native-firebase/app'; + +// Access the device pictures directory +const picturesDir = utils.FilePath.PICTURES_DIRECTORY; +``` From 962db209b28822d29771fe333810ca6d4a21fc9f Mon Sep 17 00:00:00 2001 From: ehesp Date: Wed, 21 Aug 2019 10:44:12 +0100 Subject: [PATCH 8/8] Remove app indexing from sidebar --- docs/sidebar.yaml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/docs/sidebar.yaml b/docs/sidebar.yaml index 4259e2d3..673ad7a9 100644 --- a/docs/sidebar.yaml +++ b/docs/sidebar.yaml @@ -152,18 +152,6 @@ - text: iOS Setup to: '/ios' -- module: indexing - group: App Indexing - children: - - text: Overview - to: '/' - - text: Quick Start - to: '/quick-start' - - text: Android Setup - to: '/android' - - text: iOS Setup - to: '/ios' - - module: iid group: Instance ID children: