infobip-mobile-messaging-react-native-plugin 14.3.0 → 14.5.0
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.
- package/android/build.gradle +2 -2
- package/android/src/main/java/org/infobip/reactlibrary/mobilemessaging/Configuration.java +0 -62
- package/infobip-mobile-messaging-react-native-plugin-14.4.0.tgz +0 -0
- package/infobip-mobile-messaging-react-native-plugin.podspec +1 -1
- package/ios/MobileMessagingPlugin/RNMMChat.swift +13 -2
- package/ios/MobileMessagingPlugin/RNMMChatCustomization.swift +13 -5
- package/ios/MobileMessagingPlugin/RNMMLogger.swift +3 -1
- package/ios/MobileMessagingPlugin/RNMobileMessaging.swift +1 -1
- package/ios/MobileMessagingPlugin/RNMobileMessagingEventsManager.swift +3 -3
- package/package.json +1 -1
- package/src/index.d.ts +19 -0
- package/infobip-mobile-messaging-react-native-plugin-14.2.0.tgz +0 -0
package/android/build.gradle
CHANGED
|
@@ -66,7 +66,7 @@ repositories {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
dependencies {
|
|
69
|
-
def mmVersion = '14.
|
|
69
|
+
def mmVersion = '14.11.0'
|
|
70
70
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:2.1.20"
|
|
71
71
|
compileOnly "com.facebook.react:react-android"
|
|
72
72
|
implementation "androidx.annotation:annotation:1.9.1"
|
|
@@ -100,4 +100,4 @@ dependencies {
|
|
|
100
100
|
if (!overrideFirebaseVersion.empty) {
|
|
101
101
|
implementation "com.google.firebase:firebase-messaging:$overrideFirebaseVersion"
|
|
102
102
|
}
|
|
103
|
-
}
|
|
103
|
+
}
|
|
@@ -53,53 +53,6 @@ public class Configuration {
|
|
|
53
53
|
List<Action> actions;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
class InAppChatCustomization {
|
|
57
|
-
//common
|
|
58
|
-
String widgetTheme;
|
|
59
|
-
String toolbarTitle;
|
|
60
|
-
String toolbarTitleColor;
|
|
61
|
-
String toolbarBackgroundColor;
|
|
62
|
-
String chatBackgroundColor;
|
|
63
|
-
String noConnectionAlertTextColor;
|
|
64
|
-
String noConnectionAlertBackgroundColor;
|
|
65
|
-
String chatInputPlaceholderTextColor;
|
|
66
|
-
String chatInputCursorColor;
|
|
67
|
-
String chatInputBackgroundColor;
|
|
68
|
-
String sendButtonIconUri;
|
|
69
|
-
String attachmentButtonIconUri;
|
|
70
|
-
boolean chatInputSeparatorVisible;
|
|
71
|
-
//android only
|
|
72
|
-
//status bar properties
|
|
73
|
-
boolean statusBarColorLight;
|
|
74
|
-
String statusBarBackgroundColor;
|
|
75
|
-
//toolbar properties
|
|
76
|
-
String navigationIconUri;
|
|
77
|
-
String navigationIconTint;
|
|
78
|
-
String subtitleText;
|
|
79
|
-
String subtitleTextColor;
|
|
80
|
-
String subtitleTextAppearanceRes;
|
|
81
|
-
boolean subtitleCentered;
|
|
82
|
-
String titleTextAppearanceRes;
|
|
83
|
-
boolean titleCentered;
|
|
84
|
-
String menuItemsIconTint;
|
|
85
|
-
String menuItemSaveAttachmentIcon;
|
|
86
|
-
//chat properties
|
|
87
|
-
String progressBarColor;
|
|
88
|
-
String networkConnectionErrorTextAppearanceRes;
|
|
89
|
-
String networkConnectionErrorText;
|
|
90
|
-
//chat input properties
|
|
91
|
-
String inputTextColor;
|
|
92
|
-
String inputAttachmentIconTint;
|
|
93
|
-
String inputAttachmentBackgroundColor;
|
|
94
|
-
String inputAttachmentBackgroundDrawable;
|
|
95
|
-
String inputSendIconTint;
|
|
96
|
-
String inputSendBackgroundColor;
|
|
97
|
-
String inputSendBackgroundDrawable;
|
|
98
|
-
String inputSeparatorLineColor;
|
|
99
|
-
String inputHintText;
|
|
100
|
-
String inputTextAppearance;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
56
|
class WebRTCUI {
|
|
104
57
|
String configurationId;
|
|
105
58
|
}
|
|
@@ -115,7 +68,6 @@ public class Configuration {
|
|
|
115
68
|
PrivacySettings privacySettings = new PrivacySettings();
|
|
116
69
|
List<Category> notificationCategories = new ArrayList<Category>();
|
|
117
70
|
WebRTCUI webRTCUI;
|
|
118
|
-
InAppChatCustomization inAppChatCustomization;
|
|
119
71
|
String userDataJwt;
|
|
120
72
|
@Nullable String backendBaseURL;
|
|
121
73
|
|
|
@@ -132,18 +84,4 @@ public class Configuration {
|
|
|
132
84
|
|
|
133
85
|
return config;
|
|
134
86
|
}
|
|
135
|
-
|
|
136
|
-
@NonNull
|
|
137
|
-
static InAppChatCustomization resolveChatSettings(JSONObject args) throws JSONException {
|
|
138
|
-
if (args == null) {
|
|
139
|
-
throw new IllegalArgumentException("Cannot resolve configuration from arguments");
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
InAppChatCustomization config = new JsonSerializer().deserialize(args.toString(), InAppChatCustomization.class);
|
|
143
|
-
if (config == null) {
|
|
144
|
-
throw new IllegalArgumentException("Configuration is invalid");
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
return config;
|
|
148
|
-
}
|
|
149
87
|
}
|
|
Binary file
|
|
@@ -87,11 +87,22 @@ class RNMMChat: NSObject {
|
|
|
87
87
|
self?.setNotNil(&chatsettings.chatInputSeparatorLineColor, ChatCustomizationKeys.chatInputSeparatorLineColor.getColor(from: settings))
|
|
88
88
|
self?.setNotNil(&chatsettings.advancedSettings.isLineSeparatorHidden, ChatCustomizationKeys.chatInputSeparatorLineVisible.getBool(from: settings))
|
|
89
89
|
self?.setNotNil(&chatsettings.advancedSettings.typingIndicatorColor, ChatCustomizationKeys.chatInputCursorColor.getColor(from: settings))
|
|
90
|
-
self?.setNotNil(&chatsettings.errorLabelTextColor, ChatCustomizationKeys.networkErrorTextColor.getColor(from: settings))
|
|
91
|
-
self?.setNotNil(&chatsettings.errorLabelBackgroundColor, ChatCustomizationKeys.networkErrorLabelBackgroundColor.getColor(from: settings))
|
|
92
90
|
self?.setNotNil(&chatsettings.advancedSettings.mainPlaceholderTextColor, ChatCustomizationKeys.chatInputHintTextColor.getColor(from: settings))
|
|
93
91
|
self?.setNotNil(&chatsettings.advancedSettings.charCounterDefaultColor, ChatCustomizationKeys.chatInputCharCounterDefaultColor.getColor(from: settings))
|
|
94
92
|
self?.setNotNil(&chatsettings.advancedSettings.charCounterAlertColor, ChatCustomizationKeys.chatInputCharCounterAlertColor.getColor(from: settings))
|
|
93
|
+
|
|
94
|
+
self?.setNotNil(&chatsettings.networkErrorLabelTextColor, ChatCustomizationKeys.networkErrorTextColor.getColor(from: settings))
|
|
95
|
+
self?.setNotNil(&chatsettings.networkErrorLabelBackgroundColor, ChatCustomizationKeys.networkErrorLabelBackgroundColor.getColor(from: settings))
|
|
96
|
+
self?.setNotNil(&chatsettings.errorLabelTextColor, ChatCustomizationKeys.chatBannerErrorTextColor.getColor(from: settings))
|
|
97
|
+
self?.setNotNil(&chatsettings.errorLabelBackgroundColor, ChatCustomizationKeys.chatBannerErrorBackgroundColor.getColor(from: settings))
|
|
98
|
+
self?.setNotNil(&chatsettings.errorBannerIcon, ChatCustomizationKeys.chatBannerErrorIcon.getImage(from: settings))
|
|
99
|
+
self?.setNotNil(&chatsettings.errorBannerIconTint, ChatCustomizationKeys.chatBannerErrorIconTint.getColor(from: settings))
|
|
100
|
+
self?.setNotNil(&chatsettings.fullScreenErrorImage, ChatCustomizationKeys.chatFullScreenErrorIcon.getImage(from: settings))
|
|
101
|
+
self?.setNotNil(&chatsettings.fullScreenErrorTitleText, ChatCustomizationKeys.chatFullScreenErrorTitleText.getString(from: settings))
|
|
102
|
+
self?.setNotNil(&chatsettings.fullScreenErrorSubtitleText, ChatCustomizationKeys.chatFullScreenErrorDescriptionText.getString(from: settings))
|
|
103
|
+
self?.setNotNil(&chatsettings.fullScreenErrorTitleTextColor, ChatCustomizationKeys.chatFullScreenErrorTitleTextColor.getColor(from: settings))
|
|
104
|
+
self?.setNotNil(&chatsettings.fullScreenErrorSubtitleTextColor, ChatCustomizationKeys.chatFullScreenErrorDescriptionTextColor.getColor(from: settings))
|
|
105
|
+
self?.setNotNil(&chatsettings.fullScreenErrorBackgroundColor, ChatCustomizationKeys.chatFullScreenErrorBackgroundColor.getColor(from: settings))
|
|
95
106
|
}
|
|
96
107
|
}
|
|
97
108
|
|
|
@@ -42,10 +42,6 @@ enum ChatCustomizationKeys: String {
|
|
|
42
42
|
attachmentPreviewToolbar,
|
|
43
43
|
attachmentPreviewToolbarMenuItemsIconTint,
|
|
44
44
|
attachmentPreviewToolbarSaveMenuItemIcon,
|
|
45
|
-
networkErrorText,
|
|
46
|
-
networkErrorTextColor,
|
|
47
|
-
networkErrorTextAppearance,
|
|
48
|
-
networkErrorLabelBackgroundColor,
|
|
49
45
|
chatBackgroundColor,
|
|
50
46
|
chatProgressBarColor,
|
|
51
47
|
chatInputTextAppearance,
|
|
@@ -66,7 +62,19 @@ enum ChatCustomizationKeys: String {
|
|
|
66
62
|
chatInputCursorColor,
|
|
67
63
|
chatInputCharCounterTextAppearance,
|
|
68
64
|
chatInputCharCounterDefaultColor,
|
|
69
|
-
chatInputCharCounterAlertColor
|
|
65
|
+
chatInputCharCounterAlertColor,
|
|
66
|
+
networkErrorTextColor,
|
|
67
|
+
networkErrorLabelBackgroundColor,
|
|
68
|
+
chatBannerErrorTextColor,
|
|
69
|
+
chatBannerErrorBackgroundColor,
|
|
70
|
+
chatBannerErrorIcon,
|
|
71
|
+
chatBannerErrorIconTint,
|
|
72
|
+
chatFullScreenErrorTitleText,
|
|
73
|
+
chatFullScreenErrorTitleTextColor,
|
|
74
|
+
chatFullScreenErrorDescriptionText,
|
|
75
|
+
chatFullScreenErrorDescriptionTextColor,
|
|
76
|
+
chatFullScreenErrorBackgroundColor,
|
|
77
|
+
chatFullScreenErrorIcon
|
|
70
78
|
|
|
71
79
|
func getDict(from settings: [String: AnyObject]) -> [String: AnyObject]? {
|
|
72
80
|
return settings[self.rawValue] as? [String: AnyObject]
|
|
@@ -26,7 +26,9 @@ class RNMMLogger: NSObject, MMLogging {
|
|
|
26
26
|
of: "https://github.com/infobip/mobile-messaging-sdk-ios/wiki/In%E2%80%90app-chat#library-events",
|
|
27
27
|
with: "https://github.com/infobip/mobile-messaging-react-native-plugin/wiki/In%E2%80%90app-chat#in-app-chat-events")
|
|
28
28
|
let payload: [String: Any] = ["message" : rnMessage]
|
|
29
|
-
|
|
29
|
+
DispatchQueue.mmEnsureMain {
|
|
30
|
+
ReactNativeMobileMessaging.shared?.sendEvent(withName: EventName.debugLoggerMessageReceived, body: payload)
|
|
31
|
+
}
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
public func logDebug(message: String) {
|
|
@@ -13,7 +13,7 @@ class RNMobileMessagingEventsManager {
|
|
|
13
13
|
private var eventEmitter: RCTEventEmitter!
|
|
14
14
|
public var hasEventListeners = false
|
|
15
15
|
private var cachedMobileMessagingNotifications = [Notification]()
|
|
16
|
-
private(set) var isChatAvailable: Bool = false
|
|
16
|
+
private(set) static var isChatAvailable: Bool = false
|
|
17
17
|
|
|
18
18
|
private let supportedNotifications: [String: String] = [
|
|
19
19
|
EventName.messageReceived: MMNotificationMessageReceived,
|
|
@@ -114,8 +114,8 @@ class RNMobileMessagingEventsManager {
|
|
|
114
114
|
}
|
|
115
115
|
case MMNotificationInAppChatAvailabilityUpdated:
|
|
116
116
|
eventName = EventName.inAppChat_availabilityUpdated
|
|
117
|
-
isChatAvailable = notification.userInfo?[MMNotificationKeyInAppChatEnabled] as? Bool ?? false
|
|
118
|
-
notificationResult = isChatAvailable
|
|
117
|
+
RNMobileMessagingEventsManager.isChatAvailable = notification.userInfo?[MMNotificationKeyInAppChatEnabled] as? Bool ?? false
|
|
118
|
+
notificationResult = RNMobileMessagingEventsManager.isChatAvailable
|
|
119
119
|
case MMNotificationInAppChatUnreadMessagesCounterUpdated:
|
|
120
120
|
eventName = EventName.inAppChat_unreadMessageCounterUpdated
|
|
121
121
|
notificationResult = notification.userInfo?[MMNotificationKeyInAppChatUnreadMessagesCounter] as? Int
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "infobip-mobile-messaging-react-native-plugin",
|
|
3
3
|
"title": "Infobip Mobile Messaging React Native Plugin",
|
|
4
|
-
"version": "14.
|
|
4
|
+
"version": "14.5.0",
|
|
5
5
|
"description": "Infobip Mobile Messaging React Native Plugin",
|
|
6
6
|
"main": "./src/index.js",
|
|
7
7
|
"scripts": {
|
package/src/index.d.ts
CHANGED
|
@@ -258,6 +258,25 @@ declare namespace MobileMessagingReactNative {
|
|
|
258
258
|
networkErrorTextColor?: string;
|
|
259
259
|
networkErrorTextAppearance?: string;
|
|
260
260
|
networkErrorLabelBackgroundColor?: string;
|
|
261
|
+
networkErrorIcon?: string; // android only
|
|
262
|
+
networkErrorIconTint?: string; // android only
|
|
263
|
+
chatBannerErrorTextColor?: string;
|
|
264
|
+
chatBannerErrorTextAppearance?: string; // android only
|
|
265
|
+
chatBannerErrorBackgroundColor?: string;
|
|
266
|
+
chatBannerErrorIcon?: string;
|
|
267
|
+
chatBannerErrorIconTint?: string;
|
|
268
|
+
chatFullScreenErrorTitleText?: string;
|
|
269
|
+
chatFullScreenErrorTitleTextColor?: string;
|
|
270
|
+
chatFullScreenErrorTitleTextAppearance?: string;
|
|
271
|
+
chatFullScreenErrorDescriptionText?: string;
|
|
272
|
+
chatFullScreenErrorDescriptionTextColor?: string;
|
|
273
|
+
chatFullScreenErrorDescriptionTextAppearance?: string;
|
|
274
|
+
chatFullScreenErrorBackgroundColor?: string;
|
|
275
|
+
chatFullScreenErrorIcon?: string;
|
|
276
|
+
chatFullScreenErrorIconTint?: string;
|
|
277
|
+
chatFullScreenErrorRefreshButtonText?: string; // android only
|
|
278
|
+
chatFullScreenErrorRefreshButtonTextColor?: string; // android only
|
|
279
|
+
chatFullScreenErrorRefreshButtonVisible?: boolean; // android only
|
|
261
280
|
chatBackgroundColor?: string;
|
|
262
281
|
chatProgressBarColor?: string;
|
|
263
282
|
chatInputTextAppearance?: string;
|
|
Binary file
|