0

I need to send a notification on a specific day once a month even if my app is closed. How can I do it using Kotlin? I've tried a lot and even some Java code, but it didn't work.

Laurel
  • 5,965
  • 14
  • 31
  • 57
  • Use [`AlarmManager`](https://developer.android.com/reference/android/app/AlarmManager) . read the API doc carefully before implementing it . – ADM Dec 13 '21 at 12:22

2 Answers2

1

This answer explains how to set monthly alarms. https://stackoverflow.com/a/25784137/4491971

You can use it to set the alarm and then on trigger of the event, you can use it to set pending intent for your notification.

Mohit Ajwani
  • 1,328
  • 12
  • 24
0

A notification like a push notification? or just an inside app notification? I read that you want your app to give a message even if its closed, so should be better use a push notification with firebase cloud messaging, check out the docs here on how to import your project to firebase and link it to your android studio ide: https://firebase.google.com/docs/cloud-messaging?hl=en-us