Login

or
Not a member yet? Register now
×
Are you a member? Register | Login

How to implement push notifications on iOS using firebase

Push notification is a technique used to flash up any message on the screen of mobile users. App owner can broadcast the message to its app users, at any point of time. It's not mandatory for the app should be in the execution form, in order to get the message received. Companies lure customers through enchanting messages like newly launched promotional offer, scorecard of any sport event, share rate and many more. Push messages pertaining to particular app is received by only those users who have installed the app in their device.

There are various technical methodologies in use, to implement the push notification service in your app and among those the best one is through firebase. Firebase is a cloud based web and mobile application development platform, eliminating the need for server side programming, in order to boost the development process quicker. This article explores all about configuring the firebase push notification services for an iOS application.

Step 1: Configuring your Apple Developer Account

To avail the push notification functionality, you need to enroll the apple developer program which is readily available at $99 per year. The second step is to complete the login process; from there you will be redirected to Apple developer homepage. Click on the Account button placed at the top-most section of the homepage.

  • Select the option "Certificates, IDs & Profiles" at the left pane.
  • Now, click on Identifiers -> App IDs
  • The list of all iOS app ID will be populated.
  • Click the + sign at the top right section

On click of + sign, "Registering an App ID" page gets loaded, wherein you need to provide the credentials for:

  • App ID Description where the name of the application is entered
  • App ID Prefix where the unique bundle ID of the app is to be provided

After entering all the details, select the “Push notification” mark under the App Services sections. Now, after clicking continue button, you will be redirected to the page to confirm your app ID to register it.

Soon, after the completion of the registration process, a list containing all the “iOS App IDs” will be displayed. Here, you will find the ID that you have just created before, and on selecting it a list of all the application services will be visible to you. Find and click the “Edit” button at the bottom of the page for iOS App ID settings page. At the end a Push notification button would be visible.

A Create Certificate button will help you to create a new certificate, which will help you to establish a connection between notification server (firebase) and apple push notification service. It is essential to have a Certificate signing request (CSR) file from the Macintosh computer, for creating new certificate.

 

Step 2: Creating a CSR file

Now, press cmd+space for the spotlight search, then click on Select Keychain Access besides the file menu and follow the below steps:

Select the option Keychain Access -> Click on Certificate Assistant -> Request a certificate from a certificate authority

Now a certificate assistant pop-up dialog box appears where you are supposed to add the email address and common name along with the selection of radio button “Saved to disk”. Click on Continue button now.

Step 3: Time to upload your CSR file from local drive

Navigate back again to “Add iOS certificate page”, to click on the “Choose file” button to select the path where your CSR file is saved on your hard disk. After selection, a message stating “Your certificate is ready” will be displayed. Beneath that message, a blue colour “Download button” is placed, to download the certificate.

 

Step 4: Developing the APN certificate

After creating the iOS certificate, you need to create an apple push notification certificate, which is indispensable element for the configuration of firebase. Now, use the finder bar to search for the certificate that you have downloaded earlier. On double clicking the certificate file, it gets loaded in to keychain access. You will find the certificate added by you under “My certificate category” section. To invoke that certificate execute the below command:

Apple Development IOS Push Services: <your.bundle.id>
 
You will see a private key option at the left end of the certificate and click on Export and thereafter save that prior key to .p12 to save it on your local hard drive. This file can be protected by password, if you feel the need to do it. Ok then, now the next part comes the configuration of firebase.

 

Step 5: Initiation of configuration process for push notification in firebase

Firebase configuration process starts, on landing to firebase console. Here you need to sign in with your Google a/c to visualize the Go to Console button. On the console page, select “Create a new project” and assign a meaningful name to your project.

Now you will be redirected to Project Overview page and from there click on
Add firebase to your iOS button -> Quote down your iOS bundle ID -> Select Add app button and start following the instructions to download the GoogleInfo.plist file.

Follow the below steps :

Click on Continue -> Add the firebase SDK into your project -> Continue -> Finish.

On clicking finish button, you app would become visible in the firebase overview page section.

Select the Settings at the top right section of the page -> Project Settings -> Select Cloud Messaging tab -> Upload Certificate -> Popup box for selecting APN certificate -> Choose the APN certificate from you PC (i.e .p12 file) -> Upload button

Now, Development APNs certificate would be visible in the Cloud Messaging Settings. 

Fantastic! We are done with the complete configuration process for push notification. Now you just need to select the Push Notification button in your project to make the good marketing use of it.

About The Author
Nirav Upadhyay

Nirav Upadhyay is a Marketing Strategist who is reshaping the business dynamics. After spending nearly a decade working in marketing for brands and startups, Nirav knows what truly drives conversions, sold-out launches, and business strategies. It’s how well you connect with the people and communicate your belief back to them. He also served as a tech geek in a well established mobile app development company which gave him diverse experiences. Nirav is a calculated risk-taker with deep tech industry knowledge.

Related Blog

View All
  • Top Ten Racing Games for iOS 2016? The Great Apps

    by | Thursday, September 15, 2016

    I know that everyone is looking for Best Racing Games of 2017 but here I’ve listed Best iOS Racing Games of 2016. These games become the most popular in last year and this year also they deserve to be in the Best Racing Games for iPhone list. People just ...

  • 5 Reasons why your iOS App can get rejected from the App Store

    by | Thursday, February 09, 2017

    Designing and developing an iOS application is hard work. You put in months of research into your user base, test out various versions, redesign and sometimes redevelop certain components to make it work and look good. But come time to publish it on the App Store ...

  • Chat4all
  • LettersFall 110%
  • Shot On - Auto Add ShotOn photo
  • Sponsors Advertise with us