Firebase Cloud Messaging with Ionic app

后端 未结 5 1564
时光说笑
时光说笑 2020-12-07 12:14

I am developing android/ios app using ionic framework (web technologies) and I want to add Push Notification with the help of new firebase feature FCM.

Right now I a

5条回答
  •  感情败类
    2020-12-07 12:40

    I know this question is jurassic already but just for information of future mobile developers using Ionic framework. This is 100% working now, I've been using it for the past 3 weeks.

    All you need is to add these 3 plugins

    ⁠⁠⁠ionic plugin add cordova-plugin-inappbrowser
    ionic plugin add cordova-plugin-fcm
    ionic plugin add cordova-plugin-velda-devicefeedback
    

    Next, go to Firebase Console and

    • Create a New Project and give it a name;
    • Select which platform you like (ios/android);
    • Add your Package Name, which is the id of your app: you can see it in your config.xml (something like id="com.ionicframework.someTest123").

    The Firebase Console will give you a file named google-services.json .

    • Paste it in the platforms/android/ directory
    • Run ionic build android on your CLI

    You can now go to Notifications Page > New Message

    Make sure to select the app (id of the app) you added before sending push notifications.

提交回复
热议问题