From 51ab2af6dc222fc1855fc5447bda75fa2c7b577e Mon Sep 17 00:00:00 2001 From: ehesp Date: Mon, 29 Apr 2019 09:50:54 +0100 Subject: [PATCH] [skip ci] docs - fiam stub --- docs/fiam/android.md | 11 ++++++++ docs/fiam/index.md | 43 ++++++++++++++++++++++++++++++ docs/fiam/ios.md | 11 ++++++++ docs/fiam/quick-start.md | 57 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 122 insertions(+) create mode 100644 docs/fiam/android.md create mode 100644 docs/fiam/index.md create mode 100644 docs/fiam/ios.md create mode 100644 docs/fiam/quick-start.md diff --git a/docs/fiam/android.md b/docs/fiam/android.md new file mode 100644 index 00000000..bce0eea9 --- /dev/null +++ b/docs/fiam/android.md @@ -0,0 +1,11 @@ +--- +title: Android Setup +description: Manually integrate Firebase In-App Messaging into your Android application. +--- + +# Android Setup + +> The following steps are only required if your environment does not have access to React Native +auto-linking. + +## TODO diff --git a/docs/fiam/index.md b/docs/fiam/index.md new file mode 100644 index 00000000..b0d1d39c --- /dev/null +++ b/docs/fiam/index.md @@ -0,0 +1,43 @@ +--- +title: Firebase In-App Messaging (FIAM) +description: Firebase In-App Messaging helps you engage your app's active users by sending them targeted, contextual messages. +--- + +# Firebase In-App Messaging + +Firebase In-App Messaging helps you engage your app's active users by sending them targeted, contextual +messages that encourage them to use key app features. React Native Firebase provides support for both native Android +& iOS integration with a simple JavaScript API. + + + +## Getting Started + + + + Install & delivering In-App messages to your users. + + + The Cloud Firestore reference API mimics that of the Firebase Web SDK. Our reference documentation covers + every aspect of the module. + + + +## 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-fiam) +- [Github Issues](https://github.com/invertase/react-native-firebase/issues?utf8=%E2%9C%93&q=is%3Aissue+sort%3Aupdated-desc+label%3Afiam+) +- [Firebase Documentation](https://firebase.google.com/docs/in-app-messaging?utm_source=invertase&utm_medium=react-native-firebase&utm_campaign=fiam) diff --git a/docs/fiam/ios.md b/docs/fiam/ios.md new file mode 100644 index 00000000..9c569168 --- /dev/null +++ b/docs/fiam/ios.md @@ -0,0 +1,11 @@ +--- +title: iOS Setup +description: Manually integrateFirebase In-App Messaging into your iOS application. +--- + +# iOS Setup + +> The following steps are only required if your environment does not have access to React Native +auto-linking. + +## TODO diff --git a/docs/fiam/quick-start.md b/docs/fiam/quick-start.md new file mode 100644 index 00000000..b5ddfd65 --- /dev/null +++ b/docs/fiam/quick-start.md @@ -0,0 +1,57 @@ +--- +title: Firebase In-App Messaging Quick Start +description: Get to grips with the basics of Firebase In-App Messaging in React Native Firebase +--- + +# Firebase In-App Messaging Quick Start + +## Installation + +Install this module with Yarn: + +```bash +yarn add @react-native-firebase/fiam +``` + +> Integrating manually and not via React Native auto-linking? Check the setup instructions for Android & iOS. + +## Module usage + +Once installed, any published campaigns from the [Firebase console](https://console.firebase.google.com/?utm_source=invertase&utm_medium=fiam&utm_campaign=quick_start) +are automatically handled and displayed on your users device. The module provides a JavaScript API to allow greater +control of the displaying of these messages. + +Once installed, import the FIAM package into your project: + +```js +import fiam from '@react-native-firebase/fiam'; +``` + +The package also provides access to the firebase instance: + +```js +import { firebase } from '@react-native-firebase/fiam'; +``` + +### Suppressing messages + +The Firebase console campaign manager provides a few events to handle when messages are displayed to users. In some +situations you may want to handle this manually to only display messages at a chosen time, for example once a user +has completed an on-boarding process within your app. The `setMessagesDisplaySuppressed` method can be used to +achieve this. + +> The suppressed state is not persisted between restarts, so ensure it is called as early as possible. + +```js +import fiam from '@react-native-firebase/fiam'; + +async function bootstrap() { + await fiam().setMessagesDisplaySuppressed(true); +} + +async function onSetup(user) { + await setupUser(user); + // Allow user to receive messages now setup is complete + fiam().setMessagesDisplaySuppressed(false); +} +```