0

I have implemented a live activity functionality into my app where a user can initiate multiple ones at the same time. Each time the user initiate a new live activity, I am storing the token in my server in order to use it for updating the live activity using a push notification.

I would like to come up with a way to notify the server once the user removes a live activity from the Lock Screen.

Potential Solution 1

Use background tasks. However, this way will work only if the user did not kill the app.

Potential Solution 2

Store the activity id somewhere and then once the user opens the app again I check if the stored activity id is contained within the Activity.activities array. If not, I notify the server that this activity id will no longer receive push notifications.

I would like to hear if any one has a better solution to my problem than the above potential solutions.

HangarRash
  • 7,314
  • 5
  • 5
  • 32
Hashim
  • 1
  • 2
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Aug 19 '23 at 06:41

0 Answers0