enablePush
to true
when initializing the SDK
POST_NOTIFICATIONS
, has been introduced for apps to send non-exempt notifications, including those from Foreground Services (FGS).
You need to declare following permissions in the App’s manifest file.
MyAppMessagingService
to handle Firebase messaging events.
onNewToken
and onMessageReceived
methods of your FCM service class.
castled.xml
file in the res/values
folder of your app project. Default values takes effect only if push payload doesn’t
have any values specified for these fields.
castled.xml
if you want to specify a default
channel for notifications from Castled. More details on android notifications
channels can be found here.
YOUR_NOTIFICATION_CHANNEL_IMPORTANCE_VALUE
can be any integer in the range [1,4]
, 1
being lowest importance and 5
being highest.
castled.xml
.
1. small icon 2. large icon
CastledPushNotificationListener
.
Following code snippet uses an anonymous object as the listener.
How to see all the logs from Castled SDK
CastledNotifications
Push notification is not showing in the device after sending from Castled dashboard
enablePush
config is set to true
.Skipped
counter
is non zero, it likely means SDK was not able to send push token to Castled
server. Try removing the app and re-installing. If problem persists contact
support.shell adb shell dumpsys package com.company.myapp | grep stopped
App state should be
stopped=false
to receive push.tech@castled.io
or ping us in our Slack channel.