Versions Compared

Key

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

...

Code Block
allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://dl.bintraybuzzvil.com/buzzvilpublic/maven/" }
    }
}

build.gradle: app Module

...

Code Block
public class CustomNotificationWorker extends NotificationWorker {
    public CustomNotificationWorker(@NonNull Context context,
                                    @NonNull WorkerParameters workerParams) {
        super(context, workerParams);
    }

    @Override
    @NonNull
    public NotificationConfig getNotificationConfig() {
        final FeedConfig feedConfig = new FeedConfig.Builder(getApplicationContext(), App.UNIT_ID_NOTI_PLUS)
                .feedToolbarHolderClass(CustomFeedToolbarHolder::class.java)
                .build();
        final RewardNotificationConfig rewardNotificationConfig = new RewardNotificationConfig.Builder().build();
        return new NotificationConfig.Builder(App.UNIT_ID_PUSH)
                .putExtra(FeedActivity.EXTRA_CONFIG, feedConfig)
                .build();
    }
}
  • PushDialogConfig 설정: PushDialog 관련 config 입니다.

    • colorConfirm: 확인버튼 색상 color resource id

    • colorCancel: 취소버튼 색상 color resource id

    • imageRegisterLogo: register dialog 로고 이미지 drawable resource id

    • imageUnregisterLogo: unregister dialog 로고 이미지 drawable resource id

  • RestartReceiver 에서도 사용하므로 Application 클래스에 static 함수로 구현합니다.

Code Block
public class App extends MultiDexApplication {
    ...
    public static PushDialogConfig getPushDialogConfig() {
        return new PushDialogConfig.Builder()
                .colorConfirm(R.color.colorAccent)
                .colorCancel(R.color.colorPrimary)
                .imageRegisterLogo(R.drawable.benefit_push_dialog_image_logo)
                .imageUnregisterLogo(R.drawable.benefit_push_dialog_image_logo)
                .build();
    }
}
  • BuzzAdPush 초기화

    • unitId: Push unit id

    • notificationWorkerClass: CustomNotificationWorker

    • pushDialogConfig: PushDialog 관련 config

Code Block
BuzzAdPush buzzAdPush = 
    new BuzzAdPush(
            App.UNIT_ID_PUSH,
            CustomNotificationWorker.class,
            App.getPushDialogConfig()
    );

Image AddedImage Added

그림 1. register 설명 다이얼로그 그림 2. register(시간설정) 다이얼로그

1) Register with Description

...