-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(installations): implement Firebase Installations module
In particular Installations.delete() is needed for GDPR compliance
- Loading branch information
Showing
37 changed files
with
1,521 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,7 @@ Fastlane | |
FCM | ||
firebase | ||
Firebase | ||
FirebaseApp | ||
firebase-ios-sdk | ||
Firestore | ||
getIdToken | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
title: Installations | ||
description: Installation and getting started with Installations. | ||
icon: //static.invertase.io/assets/social/firebase-logo.png | ||
next: /ml/usage | ||
previous: /in-app-messaging/usage | ||
--- | ||
|
||
# Installation | ||
|
||
This module requires that the `@react-native-firebase/app` module is already setup and installed. To install the "app" | ||
module, view the [Getting Started](/) documentation. | ||
|
||
```bash | ||
# Install & setup the app module | ||
yarn add @react-native-firebase/app | ||
|
||
# Install the installations module | ||
yarn add @react-native-firebase/installations | ||
|
||
# If you're developing your app using iOS, run this command | ||
cd ios/ && pod install | ||
``` | ||
|
||
# What does it do | ||
|
||
The Firebase installations service: | ||
|
||
- provides a unique identifier for a Firebase installation | ||
- provides an auth token for a Firebase installation | ||
- provides an API to perform GDPR-compliant deletion of a Firebase installation. | ||
|
||
Each configured `FirebaseApp` has a corresponding single instance of Installations. An instance of the class provides access to the installation info for the FirebaseApp as well as the ability to delete it. A Firebase Installation is unique by `FirebaseApp.name` and `FirebaseApp.options.googleAppID` | ||
|
||
# Usage | ||
|
||
Please see the API Reference for detailed usage information on the available APIs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Built application files | ||
android/*/build/ | ||
|
||
# Crashlytics configuations | ||
android/com_crashlytics_export_strings.xml | ||
|
||
# Local configuration file (sdk path, etc) | ||
android/local.properties | ||
|
||
# Gradle generated files | ||
android/.gradle/ | ||
|
||
# Signing files | ||
android/.signing/ | ||
|
||
# User-specific configurations | ||
android/.idea/gradle.xml | ||
android/.idea/libraries/ | ||
android/.idea/workspace.xml | ||
android/.idea/tasks.xml | ||
android/.idea/.name | ||
android/.idea/compiler.xml | ||
android/.idea/copyright/profiles_settings.xml | ||
android/.idea/encodings.xml | ||
android/.idea/misc.xml | ||
android/.idea/modules.xml | ||
android/.idea/scopes/scope_settings.xml | ||
android/.idea/vcs.xml | ||
android/*.iml | ||
|
||
# Xcode | ||
*.pbxuser | ||
*.mode1v3 | ||
*.mode2v3 | ||
*.perspectivev3 | ||
*.xcuserstate | ||
ios/Pods | ||
ios/build | ||
*project.xcworkspace* | ||
*xcuserdata* | ||
|
||
# OS-specific files | ||
.DS_Store | ||
.DS_Store? | ||
._* | ||
.Spotlight-V100 | ||
.Trashes | ||
ehthumbs.db | ||
Thumbs.dbandroid/gradle | ||
android/gradlew | ||
android/build | ||
android/gradlew.bat | ||
android/gradle/ | ||
|
||
.idea | ||
coverage | ||
yarn.lock | ||
e2e/ | ||
.github | ||
.vscode | ||
.nyc_output | ||
android/.settings | ||
*.coverage.json | ||
.circleci | ||
.eslintignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
Apache-2.0 License | ||
------------------ | ||
|
||
Copyright (c) 2016-present Invertase Limited <[email protected]> & Contributors | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this library except in compliance with the License. | ||
|
||
You may obtain a copy of the Apache-2.0 License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
|
||
|
||
Creative Commons Attribution 3.0 License | ||
---------------------------------------- | ||
|
||
Copyright (c) 2016-present Invertase Limited <[email protected]> & Contributors | ||
|
||
Documentation and other instructional materials provided for this project | ||
(including on a separate documentation repository or it's documentation website) are | ||
licensed under the Creative Commons Attribution 3.0 License. Code samples/blocks | ||
contained therein are licensed under the Apache License, Version 2.0 (the "License"), as above. | ||
|
||
You may obtain a copy of the Creative Commons Attribution 3.0 License at | ||
|
||
https://creativecommons.org/licenses/by/3.0/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<p align="center"> | ||
<a href="https://rnfirebase.io"> | ||
<img width="160px" src="https://i.imgur.com/JIyBtKW.png"><br/> | ||
</a> | ||
<h2 align="center">React Native Firebase - Installations</h2> | ||
</p> | ||
|
||
<p align="center"> | ||
<a href="https://api.rnfirebase.io/coverage/installations/detail"><img src="https://api.rnfirebase.io/coverage/installations/badge?style=flat-square" alt="Coverage"></a> | ||
<a href="https://www.npmjs.com/package/@react-native-firebase/installations"><img src="https://img.shields.io/npm/dm/@react-native-firebase/installations.svg?style=flat-square" alt="NPM downloads"></a> | ||
<a href="https://www.npmjs.com/package/@react-native-firebase/installations"><img src="https://img.shields.io/npm/v/@react-native-firebase/installations.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> | ||
|
||
<p align="center"> | ||
<a href="https://invertase.link/discord"><img src="https://img.shields.io/discord/295953187817521152.svg?style=flat-square&colorA=7289da&label=Chat%20on%20Discord" alt="Chat on Discord"></a> | ||
<a href="https://twitter.com/rnfirebase"><img src="https://img.shields.io/twitter/follow/rnfirebase.svg?style=flat-square&colorA=1da1f2&colorB=&label=Follow%20on%20Twitter" alt="Follow on Twitter"></a> | ||
<a href="https://www.facebook.com/groups/rnfirebase"><img src="https://img.shields.io/badge/Follow%20on%20Facebook-4172B8?logo=facebook&style=flat-square&logoColor=fff" alt="Follow on Facebook"></a> | ||
</p> | ||
|
||
---- | ||
|
||
Entry point for Firebase installations. | ||
|
||
The Firebase installations service: | ||
|
||
- provides a unique identifier for a Firebase installation | ||
- provides an auth token for a Firebase installation | ||
- provides a API to perform GDPR-compliant deletion of a Firebase installation. | ||
|
||
|
||
[> Learn More](https://firebase.google.com/docs/projects/manage-installations) | ||
|
||
## Installation | ||
|
||
Requires `@react-native-firebase/app` to be installed. | ||
|
||
```bash | ||
yarn add @react-native-firebase/installations | ||
``` | ||
|
||
## Documentation | ||
|
||
- [Guides](https://rnfirebase.io/installations/usage/) | ||
- [Reference](https://rnfirebase.io/reference/installations) | ||
|
||
## License | ||
|
||
- See [LICENSE](/LICENSE) | ||
|
||
---- | ||
|
||
<p> | ||
<img align="left" width="75px" src="https://static.invertase.io/assets/invertase-logo-small.png"> | ||
<p align="left"> | ||
Built and maintained with 💛 by <a href="https://invertase.io">Invertase</a>. | ||
</p> | ||
</p> | ||
|
||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
require 'json' | ||
package = JSON.parse(File.read(File.join(__dir__, 'package.json'))) | ||
appPackage = JSON.parse(File.read(File.join('..', 'app', 'package.json'))) | ||
|
||
coreVersionDetected = appPackage['version'] | ||
coreVersionRequired = package['peerDependencies'][appPackage['name']] | ||
firebase_sdk_version = appPackage['sdkVersions']['ios']['firebase'] | ||
if coreVersionDetected != coreVersionRequired | ||
Pod::UI.warn "NPM package '#{package['name']}' depends on '#{appPackage['name']}' v#{coreVersionRequired} but found v#{coreVersionDetected}, this might cause build issues or runtime crashes." | ||
end | ||
|
||
Pod::Spec.new do |s| | ||
s.name = "RNFBInstallations" | ||
s.version = package["version"] | ||
s.description = package["description"] | ||
s.summary = <<-DESC | ||
A well tested feature rich Firebase implementation for React Native, supporting iOS & Android. | ||
DESC | ||
s.homepage = "http://invertase.io/oss/react-native-firebase" | ||
s.license = package['license'] | ||
s.authors = "Invertase Limited" | ||
s.source = { :git => "https://github.com/invertase/react-native-firebase.git", :tag => "v#{s.version}" } | ||
s.social_media_url = 'http://twitter.com/invertaseio' | ||
s.ios.deployment_target = "10.0" | ||
s.source_files = 'ios/**/*.{h,m}' | ||
|
||
# React Native dependencies | ||
s.dependency 'React-Core' | ||
s.dependency 'RNFBApp' | ||
|
||
if defined?($FirebaseSDKVersion) | ||
Pod::UI.puts "#{s.name}: Using user specified Firebase SDK version '#{$FirebaseSDKVersion}'" | ||
firebase_sdk_version = $FirebaseSDKVersion | ||
end | ||
|
||
# Firebase dependencies | ||
s.dependency 'Firebase/Installations', firebase_sdk_version | ||
|
||
if defined?($RNFirebaseAsStaticFramework) | ||
Pod::UI.puts "#{s.name}: Using overridden static_framework value of '#{$RNFirebaseAsStaticFramework}'" | ||
s.static_framework = $RNFirebaseAsStaticFramework | ||
else | ||
s.static_framework = false | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { firebase } from '../lib'; | ||
|
||
describe('installations()', function () { | ||
describe('namespace', function () { | ||
it('accessible from firebase.app()', function () { | ||
const app = firebase.app(); | ||
expect(app.installations).toBeDefined(); | ||
expect(app.installations().app).toEqual(app); | ||
}); | ||
|
||
it('supports multiple apps', async function () { | ||
expect(firebase.installations().app.name).toEqual('[DEFAULT]'); | ||
expect(firebase.installations(firebase.app('secondaryFromNative')).app.name).toEqual( | ||
'secondaryFromNative', | ||
); | ||
expect(firebase.app('secondaryFromNative').installations().app.name).toEqual( | ||
'secondaryFromNative', | ||
); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# editorconfig | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true |
Oops, something went wrong.