Breaking Change: Only send notification received event if a notification wants the confirmation (#2899)

* Breaking Change: Only send notification received event if a notification wants the confirmation

* Update change log
This commit is contained in:
Daniel Shokouhi 2022-09-20 12:48:51 -07:00 committed by GitHub
parent 8713bb9678
commit d87781dea4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 5 deletions

View file

@ -134,6 +134,7 @@ class MessagingManager @Inject constructor(
const val COMMAND = "command"
const val TTS_TEXT = "tts_text"
const val CHANNEL = "channel"
const val CONFIRMATION = "confirmation"
// special intent constants
const val INTENT_PACKAGE_NAME = "intent_package_name"
@ -280,13 +281,17 @@ class MessagingManager @Inject constructor(
NotificationItem(0, now, jsonData[MESSAGE].toString(), jsonObject.toString(), source)
notificationDao.add(notificationRow)
mainScope.launch {
try {
integrationUseCase.fireEvent("mobile_app_notification_received", jsonData)
} catch (e: Exception) {
Log.e(TAG, "Unable to send notification received event", e)
val confirmation = jsonData[CONFIRMATION]?.toBoolean() ?: false
if (confirmation) {
mainScope.launch {
try {
integrationUseCase.fireEvent("mobile_app_notification_received", jsonData)
} catch (e: Exception) {
Log.e(TAG, "Unable to send notification received event", e)
}
}
}
when {
jsonData[MESSAGE] == REQUEST_LOCATION_UPDATE -> {
Log.d(TAG, "Request location update")

View file

@ -4,6 +4,7 @@
<release version="2022.9 - Phone" versioncode="2">
<change>&lt;b&gt;Breaking Change:&lt;/b&gt; Geocoded Location sensor attributes for latitude and longitude have been combined into location, the sensor will no longer show on the map. Additional attributes also added to the sensor.</change>
<change>&lt;b&gt;Breaking Change:&lt;/b&gt; Template widgets will only update when the template detects a change. If you are not seeing frequent updates then you are hit by rate limiting and will need to readjust the template.</change>
<change>&lt;b&gt;Breaking Change:&lt;/b&gt; Notification Received event will only be sent if a notification contains "confirmation: true" in the service call.</change>
<change>Add beacon monitor sensor</change>
<change>Add authentication option to button widget</change>
<change>Add option to bypass locking the app when on home WiFi</change>