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 = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
                notificationManager.createNotificationChannel(channel);
            }
    
            return new NotificationCompat.Builder(
                    context,
                "YOUR_NOTIFICATION_CHANNEL_ID"
            )
            .setSmallIcon(context.applicationInfo.icon)
            .setContentIntent(getFeedPendingIntent(false))
            .build();
    }
}
Code Block
languagejava
BuzzAdPush buzzAdPush = new BuzzAdPush(
    CustomPushService.class,
    CustomNotificationWorker.class,
    App.getPushDialogConfig()
);

PushService 가 제공하는 API

API

설명

getFeedPendingIntent(Boolean)

Feed 지면을 보여줄 수 있는 Intent 를 생성합니다.

  • True: Push Service Notification 을 클릭했을 시 앱의 Launch Activity 를 표시한 후, Feed 지면을 보여줍니다.

  • False: Push Service Notification 을 클릭했을 시 디바이스 최상단에 Feed 지면을 보여줍니다.

Push Notification 클릭 동작 변경

...