[in-app-messaging] rename namespace to inAppMessaging() from fiam() (#2483)

* [in-app-messaging] rename namespace to `inAppMessaging()` from `fiam()`
This commit is contained in:
Mike Diarmid
2019-08-13 15:00:30 +01:00
committed by GitHub
parent df092b274f
commit 48ca0685c6
45 changed files with 1736 additions and 1736 deletions

View File

@@ -20,7 +20,7 @@ The following modules are completed and published to NPM and ready to be consume
| [Cloud Messaging](/packages/messaging) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/messaging.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/messaging) | [![badge](https://api.rnfirebase.io/coverage/messaging/badge)](https://api.rnfirebase.io/coverage/messaging/detail) |
| [Crashlytics](/packages/crashlytics) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/crashlytics.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/crashlytics) | [![badge](https://api.rnfirebase.io/coverage/crashlytics/badge)](https://api.rnfirebase.io/coverage/crashlytics/detail) |
| [Dynamic Links](/packages/dynamic-links) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/dynamic-links.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/dynamic-links) | [![badge](https://api.rnfirebase.io/coverage/dynamic-links/badge)](https://api.rnfirebase.io/coverage/dynamic-links/detail) |
| [In-app Messaging](/packages/fiam) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/fiam.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/fiam) | [![badge](https://api.rnfirebase.io/coverage/fiam/badge)](https://api.rnfirebase.io/coverage/fiam/detail) |
| [In-app Messaging](/packages/in-app-messaging) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/in-app-messaging.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/in-app-messaging) | [![badge](https://api.rnfirebase.io/coverage/in-app-messaging/badge)](https://api.rnfirebase.io/coverage/in-app-messaging/detail) |
| [Instance ID](/packages/iid) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/iid.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/iid) | [![badge](https://api.rnfirebase.io/coverage/iid/badge)](https://api.rnfirebase.io/coverage/iid/detail) |
| [ML Kit Natural Language](/packages/ml-natural-language) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/ml-natural-language.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/ml-natural-language) | [![badge](https://api.rnfirebase.io/coverage/ml-natural-language/badge)](https://api.rnfirebase.io/coverage/ml-natural-language/detail) |
| [ML Kit Vision ](/packages/ml-vision) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/ml-vision.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/ml-vision) | [![badge](https://api.rnfirebase.io/coverage/ml-vision/badge)](https://api.rnfirebase.io/coverage/ml-vision/detail) |
@@ -235,12 +235,12 @@ Cloud Firestore has undergone a complete overhaul of both JavaScript & native co
---
## In-App Messaging (fiam) - **[NEW]**
## In-App Messaging (inAppMessaging) - **[NEW]**
- [NEW] Added support for `firebase.fiam().isMessagesDisplaySuppressed: boolean;`
- [NEW] Added support for `firebase.fiam().setMessagesDisplaySuppressed(enabled: boolean): Promise<null>;`
- [NEW] Added support for `firebase.fiam().isAutomaticDataCollectionEnabled: boolean;`
- [NEW] Added support for `firebase.fiam().setAutomaticDataCollectionEnabled(enabled: boolean): Promise<null>;`
- [NEW] Added support for `firebase.inAppMessaging().isMessagesDisplaySuppressed: boolean;`
- [NEW] Added support for `firebase.inAppMessaging().setMessagesDisplaySuppressed(enabled: boolean): Promise<null>;`
- [NEW] Added support for `firebase.inAppMessaging().isAutomaticDataCollectionEnabled: boolean;`
- [NEW] Added support for `firebase.inAppMessaging().setAutomaticDataCollectionEnabled(enabled: boolean): Promise<null>;`
---

View File

@@ -55,24 +55,23 @@ The main package that you interface with is `App` (`@react-native-firebase/app`)
| [Cloud Storage](/packages/storage) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/storage.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/storage) | [![badge](https://api.rnfirebase.io/coverage/storage/badge)](https://api.rnfirebase.io/coverage/storage/detail) |
| [Crashlytics](/packages/crashlytics) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/crashlytics.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/crashlytics) | [![badge](https://api.rnfirebase.io/coverage/crashlytics/badge)](https://api.rnfirebase.io/coverage/crashlytics/detail) |
| [Dynamic Links](/packages/dynamic-links) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/dynamic-links.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/dynamic-links) | [![badge](https://api.rnfirebase.io/coverage/dynamic-links/badge)](https://api.rnfirebase.io/coverage/dynamic-links/detail) |
| [In-app Messaging](/packages/fiam) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/fiam.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/fiam) | [![badge](https://api.rnfirebase.io/coverage/fiam/badge)](https://api.rnfirebase.io/coverage/fiam/detail) |
| [In-app Messaging](/packages/in-app-messaging) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/in-app-messaging.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/in-app-messaging) | [![badge](https://api.rnfirebase.io/coverage/in-app-messaging/badge)](https://api.rnfirebase.io/coverage/in-app-messaging/detail) |
| [Instance ID](/packages/iid) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/iid.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/iid) | [![badge](https://api.rnfirebase.io/coverage/iid/badge)](https://api.rnfirebase.io/coverage/iid/detail) |
| [ML Kit Natural Language](/packages/ml-natural-language) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/ml-natural-language.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/ml-natural-language) | [![badge](https://api.rnfirebase.io/coverage/ml-natural-language/badge)](https://api.rnfirebase.io/coverage/ml-natural-language/detail) |
| [ML Kit Vision](/packages/ml-vision) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/ml-vision.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/ml-vision) | [![badge](https://api.rnfirebase.io/coverage/ml-vision/badge)](https://api.rnfirebase.io/coverage/ml-vision/detail) |
| [Notifications](/packages/notifications) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/notifications.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/notifications) | [![badge](https://api.rnfirebase.io/coverage/notifications/badge)](https://api.rnfirebase.io/coverage/notifications/detail) |
| [Performance Monitoring](/packages/perf) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/perf.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/perf) | [![badge](https://api.rnfirebase.io/coverage/perf/badge)](https://api.rnfirebase.io/coverage/perf/detail) |
| [Realtime Database](/packages/database) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/database.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/database) | [![badge](https://api.rnfirebase.io/coverage/database/badge)](https://api.rnfirebase.io/coverage/database/detail) |
| [Remote Config](/packages/remote-config) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/remote-config.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/remote-config) | [![badge](https://api.rnfirebase.io/coverage/remote-config/badge)](https://api.rnfirebase.io/coverage/remote-config/detail) |
| [Remote Config](/packages/remote-config) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/remote-config.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/remote-config) | [![badge](https://api.rnfirebase.io/coverage/remote-config/badge)](https://api.rnfirebase.io/coverage/remote-config/detail) |
| [Utils](/packages/utils) | [![badge](https://img.shields.io/npm/dm/@react-native-firebase/utils.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@react-native-firebase/utils) | [![badge](https://api.rnfirebase.io/coverage/utils/badge)](https://api.rnfirebase.io/coverage/utils/detail) |
## Other Packages
React Native Firebase also publishes other packages.
| Name | Description |
| -------------------------------- | :---------------------------------------------: |
| [common](/packages/common) | Common utilities used by all modules. |
| Name | Description |
| -------------------------- | :-----------------------------------: |
| [common](/packages/common) | Common utilities used by all modules. |
## Documentation

View File

@@ -38,6 +38,6 @@ messages that encourage them to use key app features. React Native Firebase prov
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)
- [Stack Overflow](https://stackoverflow.com/questions/tagged/react-native-firebase-inAppMessaging)
- [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)

View File

@@ -10,7 +10,7 @@ description: Getting started with Firebase In-App Messaging in React Native Fire
Install this module with Yarn:
```bash
yarn add @react-native-firebase/fiam
yarn add @react-native-firebase/in-app-messaging
```
> Integrating manually and not via React Native auto-linking? Check the setup instructions for <Anchor version group href="/android">Android</Anchor> & <Anchor version group href="/ios">iOS</Anchor>.
@@ -24,13 +24,13 @@ control of the displaying of these messages.
Once installed, import the FIAM package into your project:
```js
import fiam from '@react-native-firebase/fiam';
import inAppMessaging from '@react-native-firebase/in-app-messaging';
```
The package also provides access to the firebase instance:
```js
import { firebase } from '@react-native-firebase/fiam';
import { firebase } from '@react-native-firebase/in-app-messaging';
```
### Suppressing messages
@@ -43,15 +43,15 @@ 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';
import inAppMessaging from '@react-native-firebase/in-app-messaging';
async function bootstrap() {
await fiam().setMessagesDisplaySuppressed(true);
await inAppMessaging().setMessagesDisplaySuppressed(true);
}
async function onSetup(user) {
await setupUser(user);
// Allow user to receive messages now setup is complete
fiam().setMessagesDisplaySuppressed(false);
inAppMessaging().setMessagesDisplaySuppressed(false);
}
```

View File

@@ -23,25 +23,26 @@ for installation instructions on each individual module page.
> The main package that you interface with is <Anchor version href="/app">App</Anchor> (`@react-native-firebase/app`)
| Module | Downloads | Coverage |
| ---------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------- |
| <Anchor href="/admob">AdMob</Anchor> | <Badge type="downloads">@react-native-firebase/admob</Badge> | <Badge type="coverage">admob</Badge> |
| <Anchor href="/analytics">Analytics</Anchor> | <Badge type="downloads">@react-native-firebase/analytics</Badge> | <Badge type="coverage">analytics</Badge> |
| <Anchor href="/app">App</Anchor> | <Badge type="downloads">@react-native-firebase/app</Badge> | <Badge type="coverage">app</Badge> |
| <Anchor href="/indexing">App Indexing</Anchor> | <Badge type="downloads">@react-native-firebase/indexing</Badge> | <Badge type="coverage">indexing</Badge> |
| <Anchor href="/invites">App Invites</Anchor> | <Badge type="downloads">@react-native-firebase/invites</Badge> | <Badge type="coverage">invites</Badge> |
| <Anchor href="/auth">Authentication</Anchor> | <Badge type="downloads">@react-native-firebase/auth</Badge> | <Badge type="coverage">auth</Badge> |
| <Anchor href="/firestore">Cloud Firestore</Anchor> | <Badge type="downloads">@react-native-firebase/firestore</Badge> | <Badge type="coverage">firestore</Badge> |
| <Anchor href="/functions">Cloud Functions</Anchor> | <Badge type="downloads">@react-native-firebase/functions</Badge> | <Badge type="coverage">functions</Badge> |
| <Anchor href="/messaging">Cloud Messaging</Anchor> | <Badge type="downloads">@react-native-firebase/messaging</Badge> | <Badge type="coverage">messaging</Badge> |
| <Anchor href="/storage">Cloud Storage</Anchor> | <Badge type="downloads">@react-native-firebase/storage</Badge> | <Badge type="coverage">storage</Badge> |
| <Anchor href="/crashlytics">Crashlytics</Anchor> | <Badge type="downloads">@react-native-firebase/crashlytics</Badge> | <Badge type="coverage">crashlytics</Badge> |
| <Anchor href="/links">Dynamic Links</Anchor> | <Badge type="downloads">@react-native-firebase/dynamic-links</Badge> | <Badge type="coverage">links</Badge> |
| <Anchor href="/fiam">In-app Messaging</Anchor> | <Badge type="downloads">@react-native-firebase/fiam</Badge> | <Badge type="coverage">fiam</Badge> |
| <Anchor href="/iid">Instance ID</Anchor> | <Badge type="downloads">@react-native-firebase/iid</Badge> | <Badge type="coverage">iid</Badge> |
| <Anchor href="/mlkit">ML Kit</Anchor> | <Badge type="downloads">@react-native-firebase/mlkit</Badge> | <Badge type="coverage">mlkit</Badge> |
| <Anchor href="/notifications">Notifications</Anchor> | <Badge type="downloads">@react-native-firebase/notifications</Badge> | <Badge type="coverage">notifications</Badge> |
| <Anchor href="/perf">Performance Monitoring</Anchor> | <Badge type="downloads">@react-native-firebase/perf</Badge> | <Badge type="coverage">perf</Badge> |
| <Anchor href="/database">Realtime Database</Anchor> | <Badge type="downloads">@react-native-firebase/database</Badge> | <Badge type="coverage">database</Badge> |
| <Anchor href="/config">Remote Config</Anchor> | <Badge type="downloads">@react-native-firebase/remote-config</Badge> | <Badge type="coverage">config</Badge> |
| <Anchor href="/utils">Utils</Anchor> | <Badge type="downloads">@react-native-firebase/utils</Badge> | <Badge type="coverage">utils</Badge> |
| Module | Downloads | Coverage |
| ---------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------- |
| <Anchor href="/admob">AdMob</Anchor> | <Badge type="downloads">@react-native-firebase/admob</Badge> | <Badge type="coverage">admob</Badge> |
| <Anchor href="/analytics">Analytics</Anchor> | <Badge type="downloads">@react-native-firebase/analytics</Badge> | <Badge type="coverage">analytics</Badge> |
| <Anchor href="/app">App</Anchor> | <Badge type="downloads">@react-native-firebase/app</Badge> | <Badge type="coverage">app</Badge> |
| <Anchor href="/indexing">App Indexing</Anchor> | <Badge type="downloads">@react-native-firebase/indexing</Badge> | <Badge type="coverage">indexing</Badge> |
| <Anchor href="/invites">App Invites</Anchor> | <Badge type="downloads">@react-native-firebase/invites</Badge> | <Badge type="coverage">invites</Badge> |
| <Anchor href="/auth">Authentication</Anchor> | <Badge type="downloads">@react-native-firebase/auth</Badge> | <Badge type="coverage">auth</Badge> |
| <Anchor href="/firestore">Cloud Firestore</Anchor> | <Badge type="downloads">@react-native-firebase/firestore</Badge> | <Badge type="coverage">firestore</Badge> |
| <Anchor href="/functions">Cloud Functions</Anchor> | <Badge type="downloads">@react-native-firebase/functions</Badge> | <Badge type="coverage">functions</Badge> |
| <Anchor href="/messaging">Cloud Messaging</Anchor> | <Badge type="downloads">@react-native-firebase/messaging</Badge> | <Badge type="coverage">messaging</Badge> |
| <Anchor href="/storage">Cloud Storage</Anchor> | <Badge type="downloads">@react-native-firebase/storage</Badge> | <Badge type="coverage">storage</Badge> |
| <Anchor href="/crashlytics">Crashlytics</Anchor> | <Badge type="downloads">@react-native-firebase/crashlytics</Badge> | <Badge type="coverage">crashlytics</Badge> |
| <Anchor href="/links">Dynamic Links</Anchor> | <Badge type="downloads">@react-native-firebase/dynamic-links</Badge> | <Badge type="coverage">dynamic-links</Badge> |
| <Anchor href="/in-app-messaging">In-app Messaging</Anchor> | <Badge type="downloads">@react-native-firebase/in-app-messaging</Badge> | <Badge type="coverage">in-app-messaging</Badge> |
| <Anchor href="/iid">Instance ID</Anchor> | <Badge type="downloads">@react-native-firebase/iid</Badge> | <Badge type="coverage">iid</Badge> |
| <Anchor href="/mlkit">ML Kit Natural Language</Anchor> | <Badge type="downloads">@react-native-firebase/ml-natural-language</Badge> | <Badge type="coverage">ml-natural-language</Badge> |
| <Anchor href="/mlkit">ML Kit Vision</Anchor> | <Badge type="downloads">@react-native-firebase/ml-vision</Badge> | <Badge type="coverage">ml-vision</Badge> |
| <Anchor href="/notifications">Notifications</Anchor> | <Badge type="downloads">@react-native-firebase/notifications</Badge> | <Badge type="coverage">notifications</Badge> |
| <Anchor href="/perf">Performance Monitoring</Anchor> | <Badge type="downloads">@react-native-firebase/perf</Badge> | <Badge type="coverage">perf</Badge> |
| <Anchor href="/database">Realtime Database</Anchor> | <Badge type="downloads">@react-native-firebase/database</Badge> | <Badge type="coverage">database</Badge> |
| <Anchor href="/config">Remote Config</Anchor> | <Badge type="downloads">@react-native-firebase/remote-config</Badge> | <Badge type="coverage">remote-config</Badge> |
| <Anchor href="/utils">Utils</Anchor> | <Badge type="downloads">@react-native-firebase/utils</Badge> | <Badge type="coverage">utils</Badge> |

View File

@@ -140,7 +140,7 @@
- text: iOS Setup
to: '/ios'
- module: fiam
- module: in-app-messaging
group: In-App Messaging
children:
- text: Overview

3192
docs/typedoc.json vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -26,7 +26,7 @@ export const KNOWN_NAMESPACES = [
'remoteConfig',
'crashlytics',
'database',
'fiam',
'inAppMessaging',
'firestore',
'functions',
'iid',

View File

@@ -1 +0,0 @@
rootProject.name = '@react-native-firebase_fiam'

View File

@@ -6,9 +6,9 @@
</p>
<p align="center">
<a href="https://api.rnfirebase.io/coverage/fiam/detail"><img src="https://api.rnfirebase.io/coverage/fiam/badge?style=flat-square" alt="Coverage"></a>
<a href="https://www.npmjs.com/package/@react-native-firebase/fiam"><img src="https://img.shields.io/npm/dm/@react-native-firebase/fiam.svg?style=flat-square" alt="NPM downloads"></a>
<a href="https://www.npmjs.com/package/@react-native-firebase/fiam"><img src="https://img.shields.io/npm/v/@react-native-firebase/fiam.svg?style=flat-square" alt="NPM version"></a>
<a href="https://api.rnfirebase.io/coverage/in-app-messaging/detail"><img src="https://api.rnfirebase.io/coverage/in-app-messaging/badge?style=flat-square" alt="Coverage"></a>
<a href="https://www.npmjs.com/package/@react-native-firebase/in-app-messaging"><img src="https://img.shields.io/npm/dm/@react-native-firebase/in-app-messaging.svg?style=flat-square" alt="NPM downloads"></a>
<a href="https://www.npmjs.com/package/@react-native-firebase/in-app-messaging"><img src="https://img.shields.io/npm/v/@react-native-firebase/in-app-messaging.svg?style=flat-square" alt="NPM version"></a>
<a href="/LICENSE"><img src="https://img.shields.io/npm/l/react-native-firebase.svg?style=flat-square" alt="License"></a>
<a href="https://lerna.js.org/"><img src="https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg?style=flat-square" alt="Maintained with Lerna"></a>
</p>
@@ -31,15 +31,15 @@ Firebase In-App Messaging helps you engage users who are actively using your app
Requires `@react-native-firebase/app` to be installed.
```bash
yarn add @react-native-firebase/fiam
react-native link @react-native-firebase/fiam
yarn add @react-native-firebase/in-app-messaging
react-native link @react-native-firebase/in-app-messaging
```
## Documentation
- [Guides](https://invertase.io/oss/react-native-firebase/guides?tags=fiam)
- [Installation](https://invertase.io/oss/react-native-firebase/v6/fiam)
- [Reference](https://invertase.io/oss/react-native-firebase/v6/fiam/reference)
- [Guides](https://invertase.io/oss/react-native-firebase/guides?tags=in-app-messaging)
- [Installation](https://invertase.io/oss/react-native-firebase/v6/in-app-messaging)
- [Reference](https://invertase.io/oss/react-native-firebase/v6/in-app-messaging/reference)
## License

View File

@@ -2,7 +2,7 @@ require 'json'
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
Pod::Spec.new do |s|
s.name = "RNFBFiam"
s.name = "RNFBInAppMessaging"
s.version = package["version"]
s.description = package["description"]
s.summary = <<-DESC

View File

@@ -0,0 +1 @@
rootProject.name = '@react-native-firebase_inAppMessaging'

View File

@@ -15,12 +15,12 @@
*
*/
describe('fiam()', () => {
describe('inAppMessaging()', () => {
describe('namespace', () => {
it('accessible from firebase.app()', () => {
const app = firebase.app();
should.exist(app.fiam);
app.fiam().app.should.equal(app);
should.exist(app.inAppMessaging);
app.inAppMessaging().app.should.equal(app);
});
});
@@ -28,26 +28,26 @@ describe('fiam()', () => {
it('true', async () => {
if (Platform.ios) {
// android has this as false when Perf tests run prior - internally all share the same flag on the native SDK
should.equal(firebase.fiam().isAutomaticDataCollectionEnabled, true);
should.equal(firebase.inAppMessaging().isAutomaticDataCollectionEnabled, true);
}
await firebase.fiam().setAutomaticDataCollectionEnabled(true);
should.equal(firebase.fiam().isAutomaticDataCollectionEnabled, true);
await firebase.inAppMessaging().setAutomaticDataCollectionEnabled(true);
should.equal(firebase.inAppMessaging().isAutomaticDataCollectionEnabled, true);
await Utils.sleep(2000);
});
it('false', async () => {
await device.launchApp();
await firebase.fiam().setAutomaticDataCollectionEnabled(false);
should.equal(firebase.fiam().isAutomaticDataCollectionEnabled, false);
await firebase.inAppMessaging().setAutomaticDataCollectionEnabled(false);
should.equal(firebase.inAppMessaging().isAutomaticDataCollectionEnabled, false);
await Utils.sleep(1500);
await firebase.fiam().setAutomaticDataCollectionEnabled(true);
should.equal(firebase.fiam().isAutomaticDataCollectionEnabled, true);
await firebase.inAppMessaging().setAutomaticDataCollectionEnabled(true);
should.equal(firebase.inAppMessaging().isAutomaticDataCollectionEnabled, true);
await Utils.sleep(1500);
});
it('errors if not boolean', async () => {
try {
firebase.fiam().setAutomaticDataCollectionEnabled();
firebase.inAppMessaging().setAutomaticDataCollectionEnabled();
return Promise.reject(new Error('Did not throw'));
} catch (e) {
e.message.should.containEql('must be a boolean');
@@ -58,25 +58,25 @@ describe('fiam()', () => {
describe('setMessagesDisplaySuppressed()', () => {
it('false', async () => {
should.equal(firebase.fiam().isMessagesDisplaySuppressed, false);
await firebase.fiam().setMessagesDisplaySuppressed(false);
should.equal(firebase.fiam().isMessagesDisplaySuppressed, false);
should.equal(firebase.inAppMessaging().isMessagesDisplaySuppressed, false);
await firebase.inAppMessaging().setMessagesDisplaySuppressed(false);
should.equal(firebase.inAppMessaging().isMessagesDisplaySuppressed, false);
await Utils.sleep(2000);
});
it('true', async () => {
await device.launchApp();
await firebase.fiam().setMessagesDisplaySuppressed(true);
should.equal(firebase.fiam().isMessagesDisplaySuppressed, true);
await firebase.inAppMessaging().setMessagesDisplaySuppressed(true);
should.equal(firebase.inAppMessaging().isMessagesDisplaySuppressed, true);
await Utils.sleep(1500);
await firebase.fiam().setMessagesDisplaySuppressed(false);
should.equal(firebase.fiam().isMessagesDisplaySuppressed, false);
await firebase.inAppMessaging().setMessagesDisplaySuppressed(false);
should.equal(firebase.inAppMessaging().isMessagesDisplaySuppressed, false);
await Utils.sleep(1500);
});
it('errors if not boolean', async () => {
try {
firebase.fiam().setMessagesDisplaySuppressed();
firebase.inAppMessaging().setMessagesDisplaySuppressed();
return Promise.reject(new Error('Did not throw'));
} catch (e) {
e.message.should.containEql('must be a boolean');

View File

@@ -2,7 +2,7 @@ require 'json'
package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
Pod::Spec.new do |s|
s.name = "RNFBFiam"
s.name = "RNFBInAppMessaging"
s.version = package["version"]
s.description = package["description"]
s.summary = <<-DESC

View File

@@ -22,22 +22,22 @@ import { ReactNativeFirebase } from '@react-native-firebase/app';
*
* #### Example 1
*
* Access the firebase export from the `fiam` package:
* Access the firebase export from the `inAppMessaging` package:
*
* ```js
* import { firebase } from '@react-native-firebase/fiam';
* import { firebase } from '@react-native-firebase/in-app-messaging';
*
* // firebase.fiam().X
* // firebase.inAppMessaging().X
* ```
*
* #### Example 2
*
* Using the default export from the `fiam` package:
* Using the default export from the `in-app-messaging` package:
*
* ```js
* import fiam from '@react-native-firebase/fiam';
* import inAppMessaging from '@react-native-firebase/in-app-messaging';
*
* // fiam().X
* // inAppMessaging().X
* ```
*
* #### Example 3
@@ -46,14 +46,14 @@ import { ReactNativeFirebase } from '@react-native-firebase/app';
*
* ```js
* import firebase from '@react-native-firebase/app';
* import '@react-native-firebase/fiam';
* import '@react-native-firebase/in-app-messaging';
*
* // firebase.fiam().X
* // firebase.inAppMessaging().X
* ```
*
* @firebase fiam
* @firebase in-app-messaging
*/
export namespace Fiam {
export namespace InAppMessaging {
import FirebaseModule = ReactNativeFirebase.FirebaseModule;
export interface Statics {}
@@ -68,7 +68,7 @@ export namespace Fiam {
* Get the In-App Messaging service for the default app:
*
* ```js
* const defaultAppFiam = firebase.fiam();
* const defaultAppInAppMessaging = firebase.inAppMessaging();
* ```
*/
export class Module extends FirebaseModule {
@@ -78,7 +78,7 @@ export namespace Fiam {
* #### Example
*
* ```js
* const isSuppressed = firebase.fiam().isMessagesDisplaySuppressed;
* const isSuppressed = firebase.inAppMessaging().isMessagesDisplaySuppressed;
* ```
*/
isMessagesDisplaySuppressed: boolean;
@@ -93,7 +93,7 @@ export namespace Fiam {
*
* ```js
* // Suppress messages
* await firebase.fiam().setMessagesDisplaySuppressed(true);
* await firebase.inAppMessaging().setMessagesDisplaySuppressed(true);
* ```
*
* @param enabled Whether messages should be suppressed.
@@ -106,7 +106,7 @@ export namespace Fiam {
* #### Example
*
* ```js
* const isDataCollectionEnabled = firebase.fiam().isAutomaticDataCollectionEnabled;
* const isDataCollectionEnabled = firebase.inAppMessaging().isAutomaticDataCollectionEnabled;
* ```
*/
isAutomaticDataCollectionEnabled: boolean;
@@ -123,7 +123,7 @@ export namespace Fiam {
*
* ```js
* // Disable data collection
* firebase.fiam().setAutomaticDataCollectionEnabled(false);
* firebase.inAppMessaging().setAutomaticDataCollectionEnabled(false);
* ```
*
* @param enabled Whether automatic data collection is enabled.
@@ -132,14 +132,14 @@ export namespace Fiam {
}
}
declare module '@react-native-firebase/fiam' {
declare module '@react-native-firebase/in-app-messaging' {
import ReactNativeFirebaseModule = ReactNativeFirebase.Module;
import FirebaseModuleWithStatics = ReactNativeFirebase.FirebaseModuleWithStatics;
const firebaseNamedExport: {} & ReactNativeFirebaseModule;
export const firebase = firebaseNamedExport;
const module: FirebaseModuleWithStatics<Fiam.Module, Fiam.Statics>;
const module: FirebaseModuleWithStatics<InAppMessaging.Module, InAppMessaging.Statics>;
export default module;
}
@@ -150,11 +150,11 @@ declare module '@react-native-firebase/app' {
namespace ReactNativeFirebase {
import FirebaseModuleWithStatics = ReactNativeFirebase.FirebaseModuleWithStatics;
interface Module {
fiam: FirebaseModuleWithStatics<Fiam.Module, Fiam.Statics>;
inAppMessaging: FirebaseModuleWithStatics<InAppMessaging.Module, InAppMessaging.Statics>;
}
interface FirebaseApp {
fiam(): Fiam.Module;
inAppMessaging(): InAppMessaging.Module;
}
}
}
@@ -173,16 +173,16 @@ namespace ReactNativeFirebase {
* // <project-root>/firebase.json
* {
* "react-native": {
* "fiam_auto_collection_enabled": false
* "in_app_messaging_auto_collection_enabled": false
* }
* }
* ```
*
* ```js
* // Re-enable in-app messaging, e.g. once user has granted permission:
* await firebase.perf().setAutomaticDataCollectionEnabled(true);
* await firebase.inAppMessaging().setAutomaticDataCollectionEnabled(true);
* ```
*/
fiam_auto_collection_enabled: boolean;
in_app_messaging_auto_collection_enabled: boolean;
}
}

View File

@@ -27,7 +27,7 @@ import version from './version';
const statics = {};
const namespace = 'fiam';
const namespace = 'inAppMessaging';
const nativeModuleName = 'RNFBFiamModule';
@@ -49,7 +49,7 @@ class FirebaseFiamModule extends FirebaseModule {
setMessagesDisplaySuppressed(enabled) {
if (!isBoolean(enabled)) {
throw new Error(
"firebase.fiam().setMessagesDisplaySuppressed(*) 'enabled' must be a boolean.",
"firebase.inAppMessaging().setMessagesDisplaySuppressed(*) 'enabled' must be a boolean.",
);
}
@@ -60,7 +60,7 @@ class FirebaseFiamModule extends FirebaseModule {
setAutomaticDataCollectionEnabled(enabled) {
if (!isBoolean(enabled)) {
throw new Error(
"firebase.fiam().setAutomaticDataCollectionEnabled(*) 'enabled' must be a boolean.",
"firebase.inAppMessaging().setAutomaticDataCollectionEnabled(*) 'enabled' must be a boolean.",
);
}
@@ -69,11 +69,11 @@ class FirebaseFiamModule extends FirebaseModule {
}
}
// import { SDK_VERSION } from '@react-native-firebase/fiam';
// import { SDK_VERSION } from '@react-native-firebase/in-app-messaging';
export const SDK_VERSION = version;
// import fiam from '@react-native-firebase/fiam';
// fiam().X(...);
// import inAppMessaging from '@react-native-firebase/in-app-messaging';
// inAppMessaging().X(...);
export default createModuleNamespace({
statics,
version,
@@ -85,7 +85,7 @@ export default createModuleNamespace({
ModuleClass: FirebaseFiamModule,
});
// import fiam, { firebase } from '@react-native-firebase/fiam';
// fiam().X(...);
// firebase.fiam().X(...);
// import inAppMessaging, { firebase } from '@react-native-firebase/in-app-messaging';
// inAppMessaging().X(...);
// firebase.inAppMessaging().X(...);
export const firebase = getFirebaseRoot();

View File

@@ -27,7 +27,7 @@ export interface Module extends ReactNativeFirebaseModule {
* #### Example
*
* ```js
* const isSuppressed = firebase.fiam().isMessagesDisplaySuppressed;
* const isSuppressed = firebase.inAppMessaging().isMessagesDisplaySuppressed;
* ```
*/
isMessagesDisplaySuppressed: boolean;
@@ -42,7 +42,7 @@ export interface Module extends ReactNativeFirebaseModule {
*
* ```js
* // Suppress messages
* await firebase.fiam().setMessagesDisplaySuppressed(true);
* await firebase.inAppMessaging().setMessagesDisplaySuppressed(true);
* ```
*
* @param enabled Whether messages should be suppressed.
@@ -55,7 +55,7 @@ export interface Module extends ReactNativeFirebaseModule {
* #### Example
*
* ```js
* const isDataCollectionEnabled = firebase.fiam().isAutomaticDataCollectionEnabled;
* const isDataCollectionEnabled = firebase.inAppMessaging().isAutomaticDataCollectionEnabled;
* ```
*/
isAutomaticDataCollectionEnabled: boolean;
@@ -72,7 +72,7 @@ export interface Module extends ReactNativeFirebaseModule {
*
* ```js
* // Disable data collection
* firebase.fiam().setAutomaticDataCollectionEnabled(false);
* firebase.inAppMessaging().setAutomaticDataCollectionEnabled(false);
* ```
*
* @param enabled Whether automatic data collection is enabled.
@@ -80,7 +80,7 @@ export interface Module extends ReactNativeFirebaseModule {
setAutomaticDataCollectionEnabled(enabled: boolean): Promise<null>;
}
declare module '@react-native-firebase/fiam' {
declare module '@react-native-firebase/in-app-messaging' {
import type {
ReactNativeFirebaseNamespace,
ReactNativeFirebaseModuleAndStatics,
@@ -88,8 +88,8 @@ declare module '@react-native-firebase/fiam' {
/**
* @example
* ```js
* import { firebase } from '@react-native-firebase/fiam';
* firebase.fiam().X(...);
* import { firebase } from '@react-native-firebase/in-app-messaging';
* firebase.inAppMessaging().X(...);
* ```
*/
declare export var firebase: {} & ReactNativeFirebaseNamespace;
@@ -97,8 +97,8 @@ declare module '@react-native-firebase/fiam' {
/**
* @example
* ```js
* import fiam from '@react-native-firebase/fiam';
* fiam().X(...);
* import inAppMessaging from '@react-native-firebase/in-app-messaging';
* inAppMessaging().X(...);
* ```
*/
declare export default ReactNativeFirebaseModuleAndStatics<Module, Statics>;
@@ -116,7 +116,7 @@ declare module '@react-native-firebase/app-types' {
* them targeted and contextual messages that nudge them to complete key in-app actions - like
* beating a game level, buying an item, or subscribing to content.
*/
fiam: ReactNativeFirebaseModuleAndStatics<Module, Statics>;
inAppMessaging: ReactNativeFirebaseModuleAndStatics<Module, Statics>;
}
declare interface FirebaseApp {
@@ -125,6 +125,6 @@ declare module '@react-native-firebase/app-types' {
* them targeted and contextual messages that nudge them to complete key in-app actions - like
* beating a game level, buying an item, or subscribing to content.
*/
fiam(): Module;
inAppMessaging(): Module;
}
}

View File

@@ -1,5 +1,5 @@
{
"name": "@react-native-firebase/fiam",
"name": "@react-native-firebase/in-app-messaging",
"version": "0.1.5",
"author": "Invertase <oss@invertase.io> (http://invertase.io)",
"description": "React Native Firebase - In-App Messaging - Engage active app users with contextual messages.",
@@ -12,7 +12,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/invertase/react-native-firebase/tree/master/packages/fiam"
"url": "https://github.com/invertase/react-native-firebase/tree/master/packages/in-app-messaging"
},
"license": "Apache-2.0",
"keywords": [
@@ -24,7 +24,7 @@
"predictions",
"engage",
"active users",
"fiam"
"inAppMessaging"
],
"peerDependencies": {
"@react-native-firebase/app": "*"

View File

@@ -1,16 +1,16 @@
import firebase from '@react-native-firebase/app';
import defaultExport, { firebase as firebaseFromModule } from '@react-native-firebase/fiam';
import defaultExport, { firebase as firebaseFromModule } from '@react-native-firebase/in-app-messaging';
// checks module exists at root
console.log(firebase.fiam().app.name);
console.log(firebase.fiam().isMessagesDisplaySuppressed);
console.log(firebase.inAppMessaging().app.name);
console.log(firebase.inAppMessaging().isMessagesDisplaySuppressed);
// checks module exists at app level
console.log(firebase.app().fiam().app.name);
console.log(firebase.app().fiam().isMessagesDisplaySuppressed);
console.log(firebase.app().inAppMessaging().app.name);
console.log(firebase.app().inAppMessaging().isMessagesDisplaySuppressed);
// checks statics exist
console.log(firebase.fiam.SDK_VERSION);
console.log(firebase.inAppMessaging.SDK_VERSION);
// checks statics exist on defaultExport
console.log(defaultExport.SDK_VERSION);
@@ -25,7 +25,7 @@ console.log(firebase.SDK_VERSION);
console.log(firebaseFromModule.SDK_VERSION);
// checks multi-app support exists
// console.log(firebase.fiam(firebase.app()).app.name);
// console.log(firebase.inAppMessaging(firebase.app()).app.name);
// checks default export supports app arg
// console.log(defaultExport(firebase.app()).app.name);

View File

@@ -29,7 +29,7 @@ import '@react-native-firebase/remote-config';
import '@react-native-firebase/utils';
import '@react-native-firebase/dynamic-links';
import '@react-native-firebase/crashlytics';
import '@react-native-firebase/fiam';
import '@react-native-firebase/in-app-messaging';
import '@react-native-firebase/functions';
import '@react-native-firebase/messaging';
import '@react-native-firebase/ml-natural-language';

View File

@@ -38,7 +38,7 @@ const PACKAGES = [
'dynamic-links',
'iid',
'perf',
'fiam',
'inAppMessaging',
'functions',
'analytics',
'remote-config',
@@ -46,7 +46,7 @@ const PACKAGES = [
'utils',
'ml-natural-language',
'ml-vision',
'fiam',
'inAppMessaging',
'auth',
'database',
'storage',

View File

@@ -19,7 +19,7 @@
"TODO_ml_natural_language_translate_model" : true,
"TODO_analytics_auto_collection_enabled": true,
"TODO_perf_auto_collection_enabled": true,
"TODO_fiam_auto_collection_enabled": true,
"TODO_in_app_messaging_auto_collection_enabled": true,
"TODO_database_persistence_enabled": true,
"TODO_firestore_persistence_enabled": true,

View File

@@ -387,11 +387,6 @@ PODS:
- GoogleUtilities/AppDelegateSwizzler (~> 6.2.3)
- React
- RNFBApp
- RNFBFiam (0.1.5):
- Firebase/Core (~> 6.5.0)
- Firebase/InAppMessagingDisplay (~> 6.5.0)
- React
- RNFBApp
- RNFBFirestore (0.1.5):
- Firebase/Core (~> 6.5.0)
- Firebase/Firestore (~> 6.5.0)
@@ -405,6 +400,11 @@ PODS:
- Firebase/Core (~> 6.5.0)
- React
- RNFBApp
- RNFBInAppMessaging (0.1.5):
- Firebase/Core (~> 6.5.0)
- Firebase/InAppMessagingDisplay (~> 6.5.0)
- React
- RNFBApp
- RNFBMessaging (0.1.5):
- Firebase/Messaging (~> 6.5.0)
- React
@@ -476,10 +476,10 @@ DEPENDENCIES:
- "RNFBCrashlytics (from `../node_modules/@react-native-firebase/crashlytics/ios`)"
- "RNFBDatabase (from `../node_modules/@react-native-firebase/database/ios`)"
- "RNFBDynamicLinks (from `../node_modules/@react-native-firebase/dynamic-links/ios`)"
- "RNFBFiam (from `../node_modules/@react-native-firebase/fiam/ios`)"
- "RNFBFirestore (from `../node_modules/@react-native-firebase/firestore/ios`)"
- "RNFBFunctions (from `../node_modules/@react-native-firebase/functions/ios`)"
- "RNFBIid (from `../node_modules/@react-native-firebase/iid/ios`)"
- "RNFBInAppMessaging (from `../node_modules/@react-native-firebase/in-app-messaging/ios`)"
- "RNFBMessaging (from `../node_modules/@react-native-firebase/messaging/ios`)"
- "RNFBMLNaturalLanguage (from `../node_modules/@react-native-firebase/ml-natural-language/ios`)"
- "RNFBMLVision (from `../node_modules/@react-native-firebase/ml-vision/ios`)"
@@ -591,14 +591,14 @@ EXTERNAL SOURCES:
:path: "../node_modules/@react-native-firebase/database/ios"
RNFBDynamicLinks:
:path: "../node_modules/@react-native-firebase/dynamic-links/ios"
RNFBFiam:
:path: "../node_modules/@react-native-firebase/fiam/ios"
RNFBFirestore:
:path: "../node_modules/@react-native-firebase/firestore/ios"
RNFBFunctions:
:path: "../node_modules/@react-native-firebase/functions/ios"
RNFBIid:
:path: "../node_modules/@react-native-firebase/iid/ios"
RNFBInAppMessaging:
:path: "../node_modules/@react-native-firebase/in-app-messaging/ios"
RNFBMessaging:
:path: "../node_modules/@react-native-firebase/messaging/ios"
RNFBMLNaturalLanguage:
@@ -687,10 +687,10 @@ SPEC CHECKSUMS:
RNFBCrashlytics: 54ec6180ce596def52f5fcdba682e3e99717c366
RNFBDatabase: ad60ae224dfdd0d4b317bb383748e9e8a174cc2f
RNFBDynamicLinks: 4a84167b6f4950b98e8aa8ac3dae6ad9a7828807
RNFBFiam: 5c4e3163f7e846acbe8627adf5194fccdfb6c9a8
RNFBFirestore: 6d1b9faf7588829833088f814581e28dafaccd50
RNFBFunctions: 59ec6369801e09f978690005f4d5838e5741cc21
RNFBIid: 5bc47cee031d44ccb1344789c9ca1144b14b250f
RNFBInAppMessaging: 0fa3f6ef554a2ddf94ecbf4be775570c64f27dd8
RNFBMessaging: 902ffc83ba1ceb205bee1c1ab5cfd39926d82913
RNFBMLNaturalLanguage: a0c9cd14a7424bd42030625731c8ab7ee7fab318
RNFBMLVision: 8a85dfe317f680da54069f42fedf29da9294752d

View File

@@ -15,7 +15,7 @@
"@react-native-firebase/crashlytics": "0.1.5",
"@react-native-firebase/database": "0.1.5",
"@react-native-firebase/dynamic-links": "0.1.5",
"@react-native-firebase/fiam": "0.1.5",
"@react-native-firebase/in-app-messaging": "0.1.5",
"@react-native-firebase/firestore": "0.1.5",
"@react-native-firebase/functions": "0.1.5",
"@react-native-firebase/iid": "0.1.5",