phonegap-plugin-push
2.3.0
Identifiers
section, go to the App IDs
and click the App Description
: Input your app name here (e.g. Cordova Firebase Demo)Explicit ID
: Select this option because a Wildcard App ID is not allowed for push notifications. Input a unique identifier for your app (e.g. io.monaca.firebase).App Services
section and tick the Push Notifications option. Then, click Continue.Confirm your App ID
page. Click Register to complete the process.Push Notifications
section, click Create Cerficate under Development SSL Certificate
.p12
file. You will need it for the Firebase configuration in the upcoming section.Project Overview
page.Project settings
.GoogleService-Info.plist
file and place it in the root folder of your project. After that, click CONTINUE.Project settings
and select CLOUD MESSAGING.Project settings
.General
section, click ADD APP and select Android.google-services.json
file and place it in the root folder of your project. After that, click CONTINUE.options
Boolean
options can also be specified as String
.ios.voip
false
true
, the device will be set up to receive VoIP Push notifications and the other options will be ignored since VoIP notifications are silent notifications that should be handled in the notification
event.ios.alert
false
true
, the device shows an alert on receipt of notification.*ios.badge
false
true
, the device sets the badge number on receipt of notification.*ios.sound
false
true
, the device plays a sound on receipt of notification.*ios.clearBadge
false
true
, the badge will be cleared on app startup.ios.categories
{}
*
: Please note that the value you set this option to the first time you call the init method will be how the application always acts. Once this is set programmatically in the init method it can only be changed manually by the user in . This is normal iOS behaviour.android.icon
android.iconColor
android.sound
true
true
, it plays the sound specified in the push data or the default system sound.android.vibrate
true
true
the device vibrates on receipt of notification.android.clearBadge
false
true
the icon badge will be cleared on init and before push messages are processed.android.clearNotifications
true
true
, the app clears all pending notifications when it is closed.android.forceShow
false
android.topics
[]
android.messageKey
message
android.titleKey
title
pushObject
successHandler
data.isEnabled
Promise
successHandler
errorHandler
n
Promise
successHandler
errorHandler
count
0
will clear the badge. Each notification
event contains a data.count value which can be used to set the badge to correct number.Promise
notification
will be triggered each time a push notification is received by a 3rd party push service on the device.data.message
data.title
data.count
data.sound
data.image
data.launchArgs
data.additionalData
data.additionalData.foreground
data.additionalData.coldstart
data.additionalData.dismissed
Promise