- CardNotifListenerService: 결제 알림(금액+승인/결제/카드) 가로채 백엔드로 전송 (토큰은 Capacitor Preferences에서, 결제성 알림만 전송) - CardNotifPlugin: 알림 접근 권한 확인/설정 열기 - AndroidManifest 서비스 등록, MainActivity 플러그인 등록 - 가계부 화면: 네이티브 미허용 시 '알림 접근 권한' 안내 배너 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
// 카드 결제 알림 자동인식 — 네이티브 플러그인(CardNotif) 래퍼.
|
||||
// 웹에서는 no-op. 권한 확인/설정 열기만 제공(실제 수신·전송은 네이티브 서비스가 담당).
|
||||
import { Capacitor, registerPlugin } from '@capacitor/core'
|
||||
|
||||
const Plugin = registerPlugin('CardNotif')
|
||||
|
||||
export const cardNotif = {
|
||||
isNative() {
|
||||
return Capacitor.isNativePlatform()
|
||||
},
|
||||
async isEnabled() {
|
||||
if (!Capacitor.isNativePlatform()) return false
|
||||
try {
|
||||
const r = await Plugin.isEnabled()
|
||||
return !!r?.enabled
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
},
|
||||
async openSettings() {
|
||||
if (!Capacitor.isNativePlatform()) return
|
||||
try {
|
||||
await Plugin.openSettings()
|
||||
} catch {
|
||||
// 무시
|
||||
}
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user