Azure-Samples / communication-services-ios-quickstarts

Sample code for Azure Communication Services iOS quickstarts
MIT License
11 stars 24 forks source link

AddRegistrationAutoRenew #79

Closed angellan-msft closed 4 months ago

angellan-msft commented 5 months ago

Purpose

Due to the limitations of push notification registration on iOS, registrations are valid for only 45 minutes. To maintain the functionality of push notifications, end users need to refresh their registration by restarting the app within this timeframe.

To mitigate the restriction and automate the registration renewal process, we suggest Contoso to implement Background Task on their end.

Background Tasks offer a way to perform activities even when the app is not in the foreground. By implementing a background task, Contoso app can request additional time to complete a specific task, such as renewing the push notification registration. This PR introduces how to implement background tasks for registration renewal.

File that needs special attention: add-chat-push-notifications-auto-renew/SwiftPushTest/AppDelegate.swift

Does this introduce a breaking change?

[ ] Yes
[x] No

Pull Request Type

What kind of change does this Pull Request introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[x] Documentation content changes
[ ] Other... Please describe:

Test

Test it using real IOS device and confirm the background task can be executed when app is not running in the foreground.