@suro4ek/appmetrica-push-sdk 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -78,18 +78,17 @@ class AppMetricaPushModule(reactContext: ReactApplicationContext) : ReactContext
|
|
|
78
78
|
@ReactMethod
|
|
79
79
|
fun isNotificationFromAppMetrica(notification: ReadableMap, promise: Promise) {
|
|
80
80
|
try {
|
|
81
|
-
// Проверяем, что push уведомление
|
|
82
|
-
//
|
|
81
|
+
// Проверяем, что push уведомление от AppMetrica
|
|
82
|
+
// AppMetrica добавляет ключ "yamp" в data объект
|
|
83
83
|
var isFromAppMetrica = false
|
|
84
|
-
|
|
84
|
+
|
|
85
85
|
if (notification.hasKey("data")) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
if (data != null && data.contains("appmetrica")) {
|
|
86
|
+
val data = notification.getMap("data")
|
|
87
|
+
if (data != null && data.hasKey("yamp")) {
|
|
89
88
|
isFromAppMetrica = true
|
|
90
89
|
}
|
|
91
90
|
}
|
|
92
|
-
|
|
91
|
+
|
|
93
92
|
promise.resolve(isFromAppMetrica)
|
|
94
93
|
} catch (e: Exception) {
|
|
95
94
|
Log.e(TAG, "Failed to check if notification is from AppMetrica", e)
|