From 6f29a1f1c8c56736d328e5b105334be7caea1c80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B6=8C=ED=98=81=EC=84=B1?= Date: Fri, 30 Jan 2026 18:07:44 +0900 Subject: [PATCH] =?UTF-8?q?feat(MOB):=20NotificationChannel=20ID=EB=A5=BC?= =?UTF-8?q?=20=EC=95=8C=EB=A6=BC=EC=9D=8C=20=ED=8C=8C=EC=9D=BC=EB=AA=85?= =?UTF-8?q?=EA=B3=BC=20=EB=8F=99=EA=B8=B0=ED=99=94=20(6=E2=86=927=EC=B1=84?= =?UTF-8?q?=EB=84=90)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - push_urgent → push_vendor_register (거래처등록) - push_payment → push_approval_request (결재요청) - push_income 신규 추가 (입금) - 채널 상수, 사운드 URI, NotificationChannel 생성 전체 반영 Co-Authored-By: Claude Opus 4.5 --- .../com/codebridgex/webapp/MainActivity.java | 75 +++++++++++-------- 1 file changed, 44 insertions(+), 31 deletions(-) diff --git a/android/app/src/main/java/com/codebridgex/webapp/MainActivity.java b/android/app/src/main/java/com/codebridgex/webapp/MainActivity.java index b322a4f..61fbd14 100644 --- a/android/app/src/main/java/com/codebridgex/webapp/MainActivity.java +++ b/android/app/src/main/java/com/codebridgex/webapp/MainActivity.java @@ -13,12 +13,13 @@ import com.getcapacitor.BridgeActivity; public class MainActivity extends BridgeActivity { // 채널 ID (FCM payload의 android.notification.channel_id 로 사용할 값) - public static final String CHANNEL_DEFAULT = "push_default"; - public static final String CHANNEL_URGENT = "push_urgent"; - public static final String CHANNEL_PAYMENT = "push_payment"; - public static final String CHANNEL_SALES_ORDER = "push_sales_order"; - public static final String CHANNEL_PURCHASE_ORDER = "push_purchase_order"; - public static final String CHANNEL_CONTRACT = "push_contract"; + public static final String CHANNEL_DEFAULT = "push_default"; + public static final String CHANNEL_VENDOR_REGISTER = "push_vendor_register"; + public static final String CHANNEL_APPROVAL_REQUEST = "push_approval_request"; + public static final String CHANNEL_INCOME = "push_income"; + public static final String CHANNEL_SALES_ORDER = "push_sales_order"; + public static final String CHANNEL_PURCHASE_ORDER = "push_purchase_order"; + public static final String CHANNEL_CONTRACT = "push_contract"; @Override protected void onCreate(Bundle savedInstanceState) { @@ -39,8 +40,9 @@ public class MainActivity extends BridgeActivity { // 이미 모든 채널이 존재하면 생성 안 함 (중복 방지) if (nm.getNotificationChannel(CHANNEL_DEFAULT) != null - && nm.getNotificationChannel(CHANNEL_URGENT) != null - && nm.getNotificationChannel(CHANNEL_PAYMENT) != null + && nm.getNotificationChannel(CHANNEL_VENDOR_REGISTER) != null + && nm.getNotificationChannel(CHANNEL_APPROVAL_REQUEST) != null + && nm.getNotificationChannel(CHANNEL_INCOME) != null && nm.getNotificationChannel(CHANNEL_SALES_ORDER) != null && nm.getNotificationChannel(CHANNEL_PURCHASE_ORDER) != null && nm.getNotificationChannel(CHANNEL_CONTRACT) != null) { @@ -48,12 +50,13 @@ public class MainActivity extends BridgeActivity { } // raw 리소스 사운드 (android/app/src/main/res/raw/ 에 넣어야 함) - Uri soundDefault = Uri.parse("android.resource://" + getPackageName() + "/raw/push_default"); - Uri soundUrgent = Uri.parse("android.resource://" + getPackageName() + "/raw/push_urgent"); - Uri soundPayment = Uri.parse("android.resource://" + getPackageName() + "/raw/push_payment"); - Uri soundSalesOrder = Uri.parse("android.resource://" + getPackageName() + "/raw/push_sales_order"); - Uri soundPurchaseOrder = Uri.parse("android.resource://" + getPackageName() + "/raw/push_purchase_order"); - Uri soundContract = Uri.parse("android.resource://" + getPackageName() + "/raw/push_contract"); + Uri soundDefault = Uri.parse("android.resource://" + getPackageName() + "/raw/push_default"); + Uri soundVendorRegister = Uri.parse("android.resource://" + getPackageName() + "/raw/push_vendor_register"); + Uri soundApprovalRequest = Uri.parse("android.resource://" + getPackageName() + "/raw/push_approval_request"); + Uri soundIncome = Uri.parse("android.resource://" + getPackageName() + "/raw/push_income"); + Uri soundSalesOrder = Uri.parse("android.resource://" + getPackageName() + "/raw/push_sales_order"); + Uri soundPurchaseOrder = Uri.parse("android.resource://" + getPackageName() + "/raw/push_purchase_order"); + Uri soundContract = Uri.parse("android.resource://" + getPackageName() + "/raw/push_contract"); AudioAttributes aa = new AudioAttributes.Builder() .setUsage(AudioAttributes.USAGE_NOTIFICATION) @@ -69,25 +72,34 @@ public class MainActivity extends BridgeActivity { chDefault.setDescription("일반 알림"); chDefault.setSound(soundDefault, aa); - // 2) 긴급 채널 (신규업체 등록) - NotificationChannel chUrgent = new NotificationChannel( - CHANNEL_URGENT, - "신규업체 등록", + // 2) 거래처등록 채널 (신규업체) + NotificationChannel chVendorRegister = new NotificationChannel( + CHANNEL_VENDOR_REGISTER, + "거래처등록 알림", NotificationManager.IMPORTANCE_HIGH ); - chUrgent.setDescription("신규업체 등록 알림"); - chUrgent.setSound(soundUrgent, aa); + chVendorRegister.setDescription("신규업체 등록 알림"); + chVendorRegister.setSound(soundVendorRegister, aa); - // 3) 결제 채널 - NotificationChannel chPayment = new NotificationChannel( - CHANNEL_PAYMENT, - "결제 알림", + // 3) 결재요청 채널 + NotificationChannel chApprovalRequest = new NotificationChannel( + CHANNEL_APPROVAL_REQUEST, + "결재요청 알림", NotificationManager.IMPORTANCE_HIGH ); - chPayment.setDescription("결제 관련 알림"); - chPayment.setSound(soundPayment, aa); + chApprovalRequest.setDescription("결재요청 관련 알림"); + chApprovalRequest.setSound(soundApprovalRequest, aa); - // 4) 수주 채널 + // 4) 입금 채널 + NotificationChannel chIncome = new NotificationChannel( + CHANNEL_INCOME, + "입금 알림", + NotificationManager.IMPORTANCE_HIGH + ); + chIncome.setDescription("입금 관련 알림"); + chIncome.setSound(soundIncome, aa); + + // 5) 수주 채널 NotificationChannel chSalesOrder = new NotificationChannel( CHANNEL_SALES_ORDER, "수주 알림", @@ -96,7 +108,7 @@ public class MainActivity extends BridgeActivity { chSalesOrder.setDescription("수주 관련 알림"); chSalesOrder.setSound(soundSalesOrder, aa); - // 5) 발주 채널 + // 6) 발주 채널 NotificationChannel chPurchaseOrder = new NotificationChannel( CHANNEL_PURCHASE_ORDER, "발주 알림", @@ -105,7 +117,7 @@ public class MainActivity extends BridgeActivity { chPurchaseOrder.setDescription("발주 관련 알림"); chPurchaseOrder.setSound(soundPurchaseOrder, aa); - // 6) 계약 채널 + // 7) 계약 채널 NotificationChannel chContract = new NotificationChannel( CHANNEL_CONTRACT, "계약 알림", @@ -115,8 +127,9 @@ public class MainActivity extends BridgeActivity { chContract.setSound(soundContract, aa); nm.createNotificationChannel(chDefault); - nm.createNotificationChannel(chUrgent); - nm.createNotificationChannel(chPayment); + nm.createNotificationChannel(chVendorRegister); + nm.createNotificationChannel(chApprovalRequest); + nm.createNotificationChannel(chIncome); nm.createNotificationChannel(chSalesOrder); nm.createNotificationChannel(chPurchaseOrder); nm.createNotificationChannel(chContract);