-
글쓴이글
-
2024년 10월 18일 07:08 #131482
꺄륵참가자게시판 찾아보니 showNotification 안에 print 넣어보고 잘 실행되는데도 알림이 안 뜨는거면 앱 자체 알림을 키라고 해서 앱 알림을 켰습니다. 버튼을 누르면 print문은 잘 실행되는데 여전히 알림이 오지 않습니다..
-
이 게시글은
꺄륵에 의해 8 월 전에 수정됐습니다.
2024년 10월 18일 08:01 #131484
꺄륵참가자버튼을 누르면 콘솔에 에러는 아닌데 E/flutter (28808): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(error, Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference, null, java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference 라는게 뜹니다. 이거 때문일까요?
2024년 10월 27일 19:48 #131703
꺄륵참가자개인 사정이 았어서 2주 정도 지난 뒤에 수정 없이 다시 실행해봤는데 왠지 모르게 알림이 잘 뜨네요. showNotification2를 추가해봤는데 알림이 오지 않습니다..
showNotification2() async {
tz.initializeTimeZones();
var androidDetails = const AndroidNotificationDetails( '유니크한 알림 ID', '알림종류 설명', priority: Priority.high, importance: Importance.max, color: Color.fromARGB(255, 255, 0, 0), ); var iosDetails = const DarwinNotificationDetails( presentAlert: true, presentBadge: true, presentSound: true, );
notifications.zonedSchedule( // 알림을 원하는 시간에 띄워줌 2, '제목2', '내용2', // RepeatInterval.daily 해당 메일 알림 tz.TZDateTime.now(tz.local).add(Duration(seconds: 3)), // 폰의 현재시간 + 3초 // makeDate(8,30,0), // 시간 입력하면 이 시간에 알림 뜸 NotificationDetails(android: androidDetails, iOS: iosDetails), androidAllowWhileIdle: true, uiLocalNotificationDateInterpretation: UILocalNotificationDateInterpretation.absoluteTime, matchDateTimeComponents: DateTimeComponents.time // 매일 저 위에 시간에 알림 띄워줌 ); } 알림이 왜 오지 않는지 모르겠어요
2024년 10월 28일 09:57 #131711
codingapple키 마스터showNotification2 쓰는 곳 확인해보거나 가상폰에 있는 플러터 앱 지웠다가 다시 띄워서 테스트해봅시다
2024년 10월 28일 20:52 #131738
꺄륵참가자이것저것 다 해봤는데 showNotification은 알림이 잘 오는 반면에 showNotification2는 여전히 알림이 오지 않습니다..
2024년 10월 29일 10:09 #131751
codingapple키 마스터showNotification2 안에 print() 쓰면 잘 출력됩니까 timezone 패키지는 import 잘했고 에러메세지는 없습니까
2024년 10월 29일 21:32 #131787
꺄륵참가자print() 잘 출력되고 import 'package:timezone/data/latest_all.dart' as tz; import 'package:timezone/timezone.dart' as tz; 임포트 했고 에러 메세지는 전혀 없습니다
2024년 10월 30일 09:38 #131798
codingapple키 마스터androidAllowWhileIdle: true, 부분 지우고 androidScheduleMode: AndroidScheduleMode.exactAllowWhileIdle, 넣어봅시다
-
이 게시글은
-
글쓴이글
- 답변은 로그인 후 가능합니다.