@developer_tribe/react-native-comnyx 0.10.1 → 0.10.3
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.
|
@@ -18,11 +18,7 @@ class MyFirebaseMessagingService : FirebaseMessagingService() {
|
|
|
18
18
|
override fun onMessageReceived(remoteMessage: RemoteMessage) {
|
|
19
19
|
//https://stackoverflow.com/a/40083727
|
|
20
20
|
super.onMessageReceived(remoteMessage)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if (isCustom) {
|
|
24
|
-
notificationsHelper.showNotification(remoteMessage)
|
|
25
|
-
}
|
|
21
|
+
notificationsHelper.showNotification(remoteMessage)
|
|
26
22
|
}
|
|
27
23
|
|
|
28
24
|
override fun onNewToken(token: String) {
|
package/android/src/main/java/com/comnyx/src/messaging/notifications/NotificationsService.kt
CHANGED
|
@@ -122,8 +122,23 @@ class NotificationsHelper(private val context: Context) {
|
|
|
122
122
|
val builder = NotificationCompat.Builder(context, CHANNEL_ID)
|
|
123
123
|
.setContentTitle(title)
|
|
124
124
|
.setContentText(message)
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
|
|
126
|
+
val iconResourceId = context.resources.getIdentifier("com_google_firebase_messaging_default_notification_icon", "drawable", context.packageName)
|
|
127
|
+
if (iconResourceId != 0) {
|
|
128
|
+
builder.setSmallIcon(iconResourceId)
|
|
129
|
+
Log.d(TAG, "Using Firebase default notification icon")
|
|
130
|
+
} else {
|
|
131
|
+
try {
|
|
132
|
+
val appInfo = context.packageManager.getApplicationInfo(context.packageName, 0)
|
|
133
|
+
builder.setSmallIcon(appInfo.icon)
|
|
134
|
+
Log.d(TAG, "Firebase default notification icon not found, using app icon as fallback")
|
|
135
|
+
} catch (e: Exception) {
|
|
136
|
+
builder.setSmallIcon(android.R.drawable.ic_dialog_info)
|
|
137
|
+
Log.d(TAG, "Using system default icon as final fallback")
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
builder.setPriority(NotificationCompat.PRIORITY_DEFAULT)
|
|
127
142
|
//.setNumber(100)
|
|
128
143
|
.setAutoCancel(true)
|
|
129
144
|
.setContentIntent(pendingIntent)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@developer_tribe/react-native-comnyx",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.3",
|
|
4
4
|
"description": "React Native chat component with integrated support panel, enabling real-time customer communication and efficient agent workflow management.",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"main": "./lib/commonjs/index.js",
|