Integrate Firebase Swift and Objective-C | Firebase Integration

Firebase is a tool that monetise your app and its flow and many things in app so that you can put your all focus on users and giving them best services. With firebase, you can build a very high quality applications, increase your user base and also can increase income. Here we are going to learn about how to integrate firebase in our iOS application.

Integarte Firebase in iOS Projects – Get Started

Here, for integrating firebase in app first create empty project then after creating this project we are ready to integrate firebase. There are two ways you can add firebase in your project either you use cocoapods which is latest or just download the source files and add in project. I recommend you to choose cocoapods path which is very convenient and also can be updated whole pod by just one or two line of code in terminal.

Integrate Firebase in iOS

Stepwise Instructions – Integarte Firebase in iOS Projects 

For installing Firebase by pods, first open terminal, and then write following commands

Command1 : $ cd /dir/path/project
In this command you will lead terminal to your project’s path

Command2 : $ sudo gem install cocoapods

Command3 : $ pod init
This command will initialise the pods in your project.

Command4 : $ open -a xcode Podfile
This command line will open your pod file in project and then you can write and can make changes and that file

Now add pod 'Firebase/Core' in that opened file and also you can add other pods written below as per your requirement.

Available Pods
These pods are available for the different Firebase features.
Pod Service
pod ‘Firebase/Core’ Prerequisite libraries and Analytics
pod ‘Firebase/AdMob’ AdMob
pod ‘Firebase/Messaging’ Cloud Messaging
pod ‘Firebase/Database’ Realtime Database
pod ‘Firebase/Invites’ Invites
pod ‘Firebase/DynamicLinks’ Dynamic Links
pod ‘Firebase/Crash’ Crash Reporting
pod ‘Firebase/RemoteConfig’ Remote Config
pod ‘Firebase/Auth’ Authentication
pod ‘Firebase/Storage’ Storage
pod ‘Firebase/Performance’ Performance Monitoring
pod ‘Firebase/Firestore’ Cloud Firestore
pod ‘Firebase/Functions’ Cloud Functions for Firebase Client SDK
pod ‘Firebase/MLVision’ ML Kit Vision APIs
pod ‘Firebase/MLVisionLabelModel’ ML Kit (On-device label detection)
pod ‘Firebase/MLVisionBarcodeModel’ ML Kit (On-device barcode scanning)
pod ‘Firebase/MLVisionTextModel’ ML Kit (On-device text recognition)
pod ‘Firebase/MLVisionFaceModel’ ML Kit (On-device face detection)

Next step :-
After this installation of firebase in project, you have to import firebase in AppDelegate file of your project and add some code for its initialization.

Swift :- import Firebase
Objective C :- @import Firebase;

Now, FIRApp file have to be configured after shared instance
Swift :- FirebaseApp.configure()
Objective C :-[FIRApp configure];

Read More –

Now you have to add plist file downloaded from firebase developer console where you have created your project with the same bundle id that your project have. After adding plist file, your project becomes firebase integrated project and now you can add whatever tool you want to add from firebase like analytics or performance tracker or cloud messaging, etc as per your app demand.

Click here to know more

Leave a Comment