Build WordPress App with React Native #13:  contact screen
Tags: reactnativewordpre, firebase, reactnativefirebase
Published: 2019-12-05 08:18:17

---
title: Build WordPress App with React Native #13:  contact screen
published: true
date: 2019-12-04 16:41:12 UTC
tags: React native Wordpre,firebase,react native firebase
canonical_url: https://kriss.io/build-wordpress-client-app-with-react-native-13-configuring-firebase-in-contact-screen/
cover_image: https://cdn-images-1.medium.com/max/1024/1*0qWyQ1BHUL6FoFfa-uPTYg.png
series: Build Wordpress Client App with React Native
---

This series intends to show how I build app to serve content from my WordPress blog by using react native. Since, my blog is talking about react-native, the series and the articles are interconnected. We will learn how to set-up many packages that make our lives comfortable and learn how to deal with WordPress APIs. Here, the most prominent features talked about in the book are the dark theme , offline mode, infinite scroll and many more. You can discover much more in this series.this inspiration to do this tutorial series came from the [React Native Mobile Templates](https://www.instamobile.io) from instamobile

In case of wanting to learn from the beginning, all the previous parts for this tutorial series are available below:

1. [Build WordPress Client App with React Native #1: Overview](https://kriss.io/build-wordpress-client-app-with-react-native-1-overview/)
2. [Build WordPress Client App with React Native #2: Setting Up Your Environment](https://kriss.io/build-wordpress-client-app-with-react-native-2-setting-up-your-environment/)
3. [Build WordPress Client App with React Native #3: Handle Navigation with React navigation](https://kriss.io/build-wordpress-client-app-with-react-native-3-handle-navigation-with-react-navigation/)
4. [Build WordPress Client App with React Native #4: Add Font Icon](https://kriss.io/build-wordpress-client-app-with-react-native-4-add-font-icon/)
5. [Build WordPress Client App with React Native #5 : Home Screen with React native paper](https://kriss.io/build-wordpress-client-app-with-react-native-5-using-react-native-paper/)
6. [Build WordPress Client App with React Native #6 : Using Html renderer and Moment](https://kriss.io/build-wordpress-client-app-with-react-native-6-using-html-renderer-and-moment/)
7. [Build WordPress Client App with React Native #7: Add pull to refresh and Infinite scroll](https://kriss.io/build-wordpress-client-app-with-react-native-7-add-pull-to-refresh-and-infinite-scroll/)
8. [Build WordPress Client App with React Native #8: Implementing SinglePost Screen](https://kriss.io/build-wordpress-client-app-with-react-native-8-implementing-singlepost-screen/)
9. [Build WordPress Client App with React Native #9: implement simple share](https://kriss.io/build-wordpress-client-app-with-react-native-9-implement-simple-share/)
10. [Build WordPress Client App with React Native #10: Setup and save bookmark](https://kriss.io/build-wordpress-client-app-with-react-native-10-setup-and-save-bookmark/)
11. [Build WordPress Client App with React Native #11: Remove and Render Bookmark](https://kriss.io/build-wordpress-client-app-with-react-native-11-remove-and-render-bookmark/)
12. [Build WordPress Client App with React Native #12: Categories screen](https://kriss.io/build-wordpress-client-app-with-react-native-12-categories-screen/)

In this chapter, we are going to implement the Contact screen. This screen is specially for contacting the developer and writer of articles. The users can use it to send a personal message to the developer. For the implementation, we are going to use two main packages. One is tcomb-form-native and the other is react-native-firebase. The tcomb package is to handle the form validation. And, react-native-firebase to connect react native app to real time firebase database.

First, we need to install the following packages:

```
yarn add react-native-firebase  tcomb-form-native
```

We can now link these packages to native files just as before.

## Configuring firebase in iOS

Now, we need to set up firebase for iOS first. For that, we need to grab the Bundle identifier as shown in the screenshot below:

 

![](https://kriss.io/wp-content/uploads/2019/12/img_5de7dd68130be.png)

Next, we need to create the firebase app and add iOS app in which we need to paste Bundle ID as shown in the screenshot on the next page:

 

![](https://kriss.io/wp-content/uploads/2019/12/img_5de7dd93993b0.png)

Then, we need to register the Firebase App and download **GoogleService-info.plist.** Then, we need to move the file to the project folder :

 

![](https://kriss.io/wp-content/uploads/2019/12/img_5de7de15c75c0.png)

Then, we need to navigate to ‘ **./ios’** folder and run the following command:

```
cd ios ; pod install
```

If we see the overall installation process, we can notice that this does not install Realtime Database pod:

![](https://kriss.io/wp-content/uploads/2019/12/img_5de7de4261372.png)

So, we need to manually add this Real-time database pod and update pod again.

We can manually import the FirebaseDatabase package to the pod file as shown in the screenshot on the next page:

 

![](https://kriss.io/wp-content/uploads/2019/12/img_5de7de6065c96.png)

Now, we need to update the pod using the following command:

```
pod update
```

 

Next, we need to initialize the  firebase in **Appdelegate.m**. For that, we need to import firebase lib to **Appdelegate.m** file and active after restarting the app as shown in the code snippet below:

```
    #import "AppDelegate.h"
    #import <React/RCTBridge.h>
    #import <React/RCTBundleURLProvider.h>
    #import <React/RCTRootView.h>
    @import Firebase;
    @implementation AppDelegate
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
      RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
      RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
                                                       moduleName:@"kriss_app"
                                                initialProperties:nil];
      rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
      self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
      UIViewController *rootViewController = [UIViewController new];
      rootViewController.view = rootView;
      self.window.rootViewController = rootViewController;
      [self.window makeKeyAndVisible];
      if ([FIRApp defaultApp] == nil) {
        [FIRApp configure];
      }
      return YES;
    }

```

Next, we need to launch the app using the following commands:

react-native run-ios or react-native run-android

**TIP ::** when your touch file in ios or android folder should build project with Xcode or Android studio first that helpful when they show an error that not show on react native

## Summary

In this chapter we leaned how to set up the react-native-firebase in the react-native application.

The post [Build WordPress Client App with React Native #13: Configuring firebase in contact screen](https://kriss.io/build-wordpress-client-app-with-react-native-13-configuring-firebase-in-contact-screen/) appeared first on [Kriss](https://kriss.io).