feat(MOB): NotificationChannel ID를 알림음 파일명과 동기화 (6→7채널)

- push_urgent → push_vendor_register (거래처등록)
- push_payment → push_approval_request (결재요청)
- push_income 신규 추가 (입금)
- 채널 상수, 사운드 URI, NotificationChannel 생성 전체 반영

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-30 18:07:44 +09:00
parent 9f744334e7
commit 6f29a1f1c8

View File

@@ -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);