Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
class CustomPushService extends PushService {
        @Override
        public Notification buildForegroundNotification(Context context) {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
                NotificationChannel channel = new NotificationChannel("CustomPushService", "CustomPushService", NotificationManager.IMPORTANCE_LOW);
                NotificationManager notificationManager  createYourNotificationChannel(= (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
                notificationManager.createNotificationChannel(channel);
            }
    
            return new NotificationCompat.Builder(
                    context,
                "YOUR_NOTIFICATION_CHANNEL_ID"
            )
            .setContentIntent(getFeedPendingIntent(false))
            .build();
    }
}

...