CA-8 | Crashlytics | TimerNotificationService.playTimer (#12328)

This commit is contained in:
Shivam Goyal
2024-09-03 14:10:52 +05:30
committed by GitHub
parent 223f4c4e0a
commit 1e56ca6d96
2 changed files with 7 additions and 3 deletions

View File

@@ -13,7 +13,7 @@
<uses-sdk tools:overrideLibrary="androidx.security.ktx" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_REMOTE_MESSAGING" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
<queries>
<intent>
@@ -58,7 +58,11 @@
<service
android:name=".pushnotification.TimerNotificationService"
android:foregroundServiceType="remoteMessaging" />
android:foregroundServiceType="specialUse">
<property
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
android:value="This foreground service is required to maintain accurate, real-time countdown timers in user notifications. The service ensures that users are informed of time-sensitive offers and actions by continuously updating the notification content, even when the app is not in the foreground. It enhances user engagement and drives timely responses, which is critical for features like promotional offers, expiring rewards, or other urgent actions that require user attention within a specific timeframe." />
</service>
</application>
</manifest>

View File

@@ -83,7 +83,7 @@ class TimerNotificationService : Service() {
startForeground(
foreGroundNotificationId,
TimerNotificationRenderer.createNotification(this, bundle),
ServiceInfo.FOREGROUND_SERVICE_TYPE_REMOTE_MESSAGING
ServiceInfo.FOREGROUND_SERVICE_TYPE_SPECIAL_USE
)
} else {
startForeground(