Flutter Integrate OneSignal Push Notification

Nhan Cao
2 min readMar 26, 2020

— -

First step: Get iOS cert (mobileprovision + .p12)

NOTE: iOS emulator can NOT get push notification

Config on website

  • Login to https://console.firebase.google.com/
  • Create a new project
  • At Project Overview -> Go to Project settings -> Cloud Messaging
  • Copy Server key and Sender ID which keys use to register on OneSignal
  • Create new OneSignal account and go to https://app.onesignal.com/
  • Select Settings ->
  • Select “Google Android” -> Fill “Firebase Server Key” and “Firebase Sender Key” which get from the previous step on Firebase console -> Next to save and Leave Setup
  • Select “Apple iOS” -> Select “Upload optional sandbox certificate” -> Upload “.p12” and Next to save and Leave Setup
  • If all correct -> you will see the “ACTIVE” label

Config on Android app

  • Goto https://console.firebase.google.com/
  • Select Project Overview
  • Press “+ Add app”
  • Select Android => Fill “Android package name” -> Register app -> Download “google-services.json” and place that file to “android/app/google-services.json”
  • Goto Flutter project
  • Edit “android/app/build.gradle” -> Add below…

--

--