Push notification using Firebase(FCM) in iOS

Updated 18 July 2017

Save

Application most important feature is push notification but it’s tough to implement using APNS as compared to Firebase. These steps you have to follow using push notification in iOS.

  1.  Go to https://developer.apple.com/ site choose account then log in After Login follows this link to generate a certificate.p12 file https://support.magplus.com/hc/en-us/articles/203808748-iOS-Creating-a-Distribution-Certificate-and-p12-File
  2. Then open  https://console.firebase.google.com/
    1. Create a new project.
    2. After creating a project you have to choose the add app option click on it provide your application bundle identifier and your application name
    3. download the GoogleService-Info.plist and Firebase SDK.
    4. Click on the gear button on the left top -> project settings -> cloud messaging then upload your certificate in (production APNs certificate and development APNs certificate).
    5. Go to your project in Xcode.
  3. The step you have to follow configure firebase in your application and download firebase from this link https://github.com/firebase/firebase-ios-sdk and the following frameworks into your app.
    1. FirebaseMessaging.framework
    2. module.modulemap
    3. FirebaseAnalytics.framework
    4. FirebaseCore.framework
    5. FirebaseInstanceID.framework
    6. GoogleInterchangeUtilities.framework
    7. GoogleSymbolUtilities.framework
    8. GoogleToolboxForMac.framework
    9. libsqlite3.tbd
    10. AdSupport.framework

    and add these flags go to Build Settings – choose Other Linker Flags: – add the following flags  -lstdc++  -ObjC  -lz

  4. Click on your project target and go to Capabilities. In Capabilities on push notification and Background Modes, in  Background Modes enable Background fetch and Remote Notifications.
  5.  All your firebase is setup now go to the AppDelegate.swift class in your project add the following code:-

6. Then you can send messages from Firebase console you can notification from there.

7. If you want to send notification from postman or implement from server side follow this link https://mobikul.com/send-push-notification-via-firebase-ios-postman/

author
. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Start a Project


    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home