Break out Auth docs

This commit is contained in:
ehesp
2019-09-03 17:04:01 +01:00
parent cca499dc2b
commit 98ce9b8165
6 changed files with 137 additions and 89 deletions

View File

@@ -0,0 +1,56 @@
---
title: Android Installation
description: Manually integrate Authentication into your Android application.
---
# Android Manual Installation
The following steps are only required if you are using React Native <= 0.59 or need to manually integrate the library.
#### Update Gradle Settings
Add the following to your projects `/android/settings.gradle` file:
```groovy
include ':@react-native-firebase_auth'
project(':@react-native-firebase_auth').projectDir = new File(rootProject.projectDir, './../node_modules/@react-native-firebase/auth/android')
```
#### Update Gradle Dependencies
Add the React Native Firebase module dependency to your `/android/app/build.gradle` file:
```groovy{3}
dependencies {
...
implementation project(path: ":@react-native-firebase_auth")
}
```
#### Add package to the Android Application
Import and apply the React Native Firebase module package to your `/android/app/src/main/java/**/MainApplication.java` file:
Import the package:
```java
import io.invertase.firebase.analytics.ReactNativeFirebaseAuthPackage;
```
Add the package to the registry:
```java{4}
protected List<ReactPackage> getPackages() {
return Arrays.asList(
new MainReactPackage(),
new ReactNativeFirebaseAuthPackage(),
```
#### Rebuild the project
Once the above steps have been completed, rebuild your Android project:
```bash
react-native run-android
```

View File

@@ -1,46 +0,0 @@
---
title: Android Setup
description: Manually integrate Authentication 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.
#### Add Authentication to Gradle Settings
**`android/settings.gradle`**:
```groovy
include ':@react-native-firebase_auth'
project(':@react-native-firebase_auth').projectDir = new File(rootProject.projectDir, './../node_modules/@react-native-firebase/auth/android')
```
#### Add Authentication to App Gradle Dependencies
**`android/app/build.gradle`**:
```groovy{4}
// ..
dependencies {
// ..
implementation project(path: ":@react-native-firebase_auth")
}
```
#### Add Authentication to Main Android Application:
**`android/app/src/main/java/**/MainApplication.java`\*\*:
```java{2,8}
// ..
import io.invertase.firebase.auth.ReactNativeFirebaseAuthPackage;
// ..
protected List<ReactPackage> getPackages() {
return Arrays.asList(
new MainReactPackage(),
new ReactNativeFirebaseAuthPackage(),
// ..
```

View File

@@ -0,0 +1,45 @@
---
title: iOS Setup
description: Manually integrate Authentication into your iOS application.
---
# iOS Manual Installation
The following steps are only required if you are using React Native <= 0.59 or need to manually integrate the library.
Installation can be done via CocoaPods (recommended) or via Frameworks:
## 1. CocoaPods Installation
### Add the RNFBAuth Pod
Add the `RNFBAuth` Pod to your projects `/ios/Podfile`:
```ruby{3}
target 'app' do
...
pod 'RNFBAuth', :path => '../node_modules/@react-native-firebase/auth/ios'
end
```
### Update Pods & rebuild the project
You may need to update your local Pods in order for the `RNFBAuth` Pod to be installed in your project:
```bash
$ cd /ios/
$ pod install --repo-update
```
Once the Pods have installed locally, rebuild your iOS project:
```bash
react-native run-ios
```
## 2. Manual Framework Installation
If your environment does not have access to Cocopods, it is still possible to install the project
via Frameworks.
TODO

View File

@@ -1,27 +0,0 @@
---
title: iOS Setup
description: Manually integrate Authentication into your iOS application.
---
# iOS Manual Linking
## Manual iOS Integration via CocoaPods
> The following steps are only required if your environment does not have access to React Native
> auto-linking.
#### Add Analytics Pod
**`ios/Podfile`**:
```ruby{4}
// ..
target 'app' do
// ..
pod 'RNFBAuth', :path => '../node_modules/@react-native-firebase/auth/ios'
end
```
## Manual iOS Integration via Frameworks
_TODO_

View File

@@ -13,7 +13,7 @@ Install this module with Yarn:
yarn add @react-native-firebase/auth
```
> 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>.
Need to install the module manually? Follow the <Anchor href="/android-installation">Android</Anchor> or <Anchor href="/ios-installation">iOS</Anchor> manual installation guides.
## Module usage
@@ -88,7 +88,24 @@ The user is able to clear their state by deleting the apps data/cache from the d
React Native Firebase provides access to the majority of authentication providers available, including social providers
including Facebook, Google, Twitter and Github, along with phone/SMS authentication.
_Our [guides](../guides?tags=auth) provide more in-depth explanations on provides and how to integrate them into your application._
<Grid columns="2">
<Block
icon="share"
color="#4caf50"
title="Social Auth"
to="/social-auth"
>
Authenticate your users with popular social providers such as Facebook, Twitter, Google, Github or your own custom provider.
</Block>
<Block
icon="perm_phone_msg"
color="#2196f3"
title="Phone Auth"
to="/phone-auth"
>
Phone authentication allows users to sign in to Firebase using their phone as the authenticator.
</Block>
</Grid>
#### Anonymous Sign In

View File

@@ -32,20 +32,23 @@
to: "/ios-installation"
- module: auth
group: Authentication
children:
- text: Overview
to: '/'
- text: Quick Start
to: '/quick-start'
- text: Android Setup
to: '/android'
- text: iOS Setup
to: '/ios'
- text: Social Auth
to: '/social-auth'
- text: Phone Auth
to: '/phone-auth'
groups:
- group: Authentication
children:
- text: Overview
to: '/'
- text: Quick Start
to: '/quick-start'
- text: Social Auth
to: '/social-auth'
- text: Phone Auth
to: '/phone-auth'
- group: Manual Installation
children:
- text: Android Installation
to: "/android-installation"
- text: iOS Installation
to: "/ios-installation"
- module: firestore
group: Cloud Firestore