infobip-mobile-messaging-react-native-plugin 14.5.2 → 14.6.1
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 +1 -1
- package/android/src/main/java/org/infobip/reactlibrary/mobilemessaging/PermissionsRequestManager.java +0 -1
- package/android/src/main/java/org/infobip/reactlibrary/mobilemessaging/RNMMChatService.kt +8 -13
- package/android/src/main/java/org/infobip/reactlibrary/mobilemessaging/RNMMChatView.kt +0 -12
- package/android/src/main/java/org/infobip/reactlibrary/mobilemessaging/RNMMWebRTCUIService.kt +0 -2
- package/android/src/main/java/org/infobip/reactlibrary/mobilemessaging/ReactNativeBroadcastReceiver.kt +0 -1
- package/android/src/main/java/org/infobip/reactlibrary/mobilemessaging/ReactNativeEvent.java +0 -1
- package/android/src/main/java/org/infobip/reactlibrary/mobilemessaging/ReactNativeMobileMessagingPackage.kt +0 -1
- package/android/src/main/java/org/infobip/reactlibrary/mobilemessaging/ReactNativeMobileMessagingService.kt +1 -8
- package/android/src/main/java/org/infobip/reactlibrary/mobilemessaging/Utils.java +0 -1
- package/android/src/newarchitecture/java/org/infobip/reactlibrary/mobilemessaging/MobileMessagingModule.kt +0 -1
- package/android/src/newarchitecture/java/org/infobip/reactlibrary/mobilemessaging/RNMMChatModule.kt +0 -1
- package/android/src/newarchitecture/java/org/infobip/reactlibrary/mobilemessaging/RNMMChatViewManager.kt +0 -3
- package/android/src/newarchitecture/java/org/infobip/reactlibrary/mobilemessaging/RNMMWebRTCUIModule.kt +0 -2
- package/infobip-mobile-messaging-react-native-plugin-14.6.0.tgz +0 -0
- package/package.json +5 -4
- package/src/components/ChatView.tsx +4 -3
- package/src/specs/RNMMChatViewNativeComponent.ts +2 -1
- package/infobip-mobile-messaging-react-native-plugin-14.5.1.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.14.2'
|
|
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"
|
|
@@ -21,7 +21,6 @@ import androidx.collection.ArraySet;
|
|
|
21
21
|
import com.facebook.react.modules.core.PermissionAwareActivity;
|
|
22
22
|
import com.facebook.react.modules.core.PermissionListener;
|
|
23
23
|
|
|
24
|
-
import org.infobip.mobile.messaging.resources.R;
|
|
25
24
|
import org.infobip.mobile.messaging.permissions.PermissionsHelper;
|
|
26
25
|
|
|
27
26
|
import java.util.Set;
|
|
@@ -15,9 +15,6 @@ import android.content.Intent
|
|
|
15
15
|
import android.content.IntentFilter
|
|
16
16
|
import android.graphics.drawable.Drawable
|
|
17
17
|
import android.graphics.drawable.BitmapDrawable
|
|
18
|
-
import android.os.Build
|
|
19
|
-
import android.os.Bundle
|
|
20
|
-
import android.util.Log
|
|
21
18
|
import androidx.annotation.NonNull
|
|
22
19
|
import com.facebook.react.bridge.*
|
|
23
20
|
import org.infobip.mobile.messaging.MobileMessaging
|
|
@@ -29,13 +26,11 @@ import org.infobip.mobile.messaging.chat.core.widget.LivechatWidgetLanguage
|
|
|
29
26
|
import org.infobip.mobile.messaging.chat.core.InAppChatEvent
|
|
30
27
|
import org.infobip.mobile.messaging.chat.view.InAppChatErrorsHandler
|
|
31
28
|
import org.infobip.mobile.messaging.chat.view.styles.PluginChatCustomization
|
|
32
|
-
import org.infobip.mobile.messaging.chat.view.styles.PluginChatCustomization.DrawableLoader
|
|
33
29
|
import org.infobip.mobile.messaging.mobileapi.MobileMessagingError
|
|
34
30
|
import org.infobip.mobile.messaging.mobileapi.Result
|
|
35
31
|
import org.infobip.mobile.messaging.BroadcastParameter
|
|
36
32
|
|
|
37
33
|
import org.infobip.reactlibrary.mobilemessaging.datamappers.ReactNativeJson
|
|
38
|
-
import org.infobip.reactlibrary.mobilemessaging.ReactNativeBroadcastReceiver
|
|
39
34
|
import com.facebook.react.bridge.ReactContext
|
|
40
35
|
|
|
41
36
|
import java.io.IOException
|
|
@@ -205,21 +200,21 @@ class RNMMChatService(
|
|
|
205
200
|
fun setChatCustomization(map: ReadableMap?) {
|
|
206
201
|
runCatchingExceptions("setChatCustomization()", arrayOf(map)) {
|
|
207
202
|
val theme = map?.let { ReactNativeJson.convertMapToJson(it) }
|
|
208
|
-
|
|
209
|
-
?.
|
|
210
|
-
inAppChat.
|
|
203
|
+
?.let { PluginChatCustomization.parseOrNull(it) }
|
|
204
|
+
?.createTheme(reactContext, reactNativeDrawableLoader)
|
|
205
|
+
inAppChat.theme = theme
|
|
211
206
|
}
|
|
212
207
|
}
|
|
213
208
|
|
|
214
209
|
fun setChatPushTitle(title: String?) {
|
|
215
210
|
runCatchingExceptions("setChatPushTitle()", arrayOf(title)) {
|
|
216
|
-
inAppChat.
|
|
211
|
+
inAppChat.chatPushTitle = title
|
|
217
212
|
}
|
|
218
213
|
}
|
|
219
214
|
|
|
220
215
|
fun setChatPushBody(body: String?) {
|
|
221
216
|
runCatchingExceptions("setChatPushBody()", arrayOf(body)) {
|
|
222
|
-
inAppChat.
|
|
217
|
+
inAppChat.chatPushBody = body
|
|
223
218
|
}
|
|
224
219
|
}
|
|
225
220
|
|
|
@@ -332,13 +327,13 @@ class RNMMChatService(
|
|
|
332
327
|
|
|
333
328
|
fun setChatDomain(domain: String?) {
|
|
334
329
|
runCatchingExceptions("setChatDomain()", arrayOf(domain)) {
|
|
335
|
-
inAppChat.
|
|
330
|
+
inAppChat.domain = domain
|
|
336
331
|
}
|
|
337
332
|
}
|
|
338
333
|
//endregion
|
|
339
334
|
|
|
340
335
|
//region ActivityEventListener
|
|
341
|
-
override fun onActivityResult(activity: Activity
|
|
336
|
+
override fun onActivityResult(activity: Activity, requestCode: Int, resultCode: Int, data: Intent?) {
|
|
342
337
|
val fragmentActivity = Utils.getFragmentActivity(reactContext) ?: return
|
|
343
338
|
val fragment = fragmentActivity.supportFragmentManager.findFragmentByTag(Utils.RN_IN_APP_CHAT_FRAGMENT_TAG)
|
|
344
339
|
if (fragment == null) {
|
|
@@ -348,7 +343,7 @@ class RNMMChatService(
|
|
|
348
343
|
fragment.onActivityResult(requestCode and 0xffff, resultCode, data)
|
|
349
344
|
}
|
|
350
345
|
|
|
351
|
-
override fun onNewIntent(intent: Intent
|
|
346
|
+
override fun onNewIntent(intent: Intent) {
|
|
352
347
|
// Activity `onNewIntent` - no-op
|
|
353
348
|
}
|
|
354
349
|
//endregion
|
|
@@ -9,25 +9,13 @@
|
|
|
9
9
|
package org.infobip.reactlibrary.mobilemessaging
|
|
10
10
|
|
|
11
11
|
import android.content.Context
|
|
12
|
-
import android.os.Build
|
|
13
12
|
import android.util.AttributeSet
|
|
14
|
-
import android.util.Log
|
|
15
13
|
import android.view.ViewGroup
|
|
16
14
|
import android.view.ViewParent
|
|
17
15
|
import android.widget.FrameLayout
|
|
18
|
-
import android.view.ViewTreeObserver
|
|
19
|
-
import androidx.annotation.NonNull
|
|
20
|
-
import androidx.annotation.Nullable
|
|
21
|
-
import androidx.annotation.RequiresApi
|
|
22
|
-
import androidx.fragment.app.Fragment
|
|
23
16
|
import androidx.fragment.app.FragmentActivity
|
|
24
|
-
import androidx.fragment.app.FragmentManager
|
|
25
|
-
import androidx.fragment.app.FragmentContainerView
|
|
26
|
-
import androidx.fragment.app.FragmentTransaction
|
|
27
|
-
import org.infobip.mobile.messaging.chat.InAppChat
|
|
28
17
|
import org.infobip.mobile.messaging.chat.view.InAppChatFragment
|
|
29
18
|
import org.infobip.mobile.messaging.chat.core.InAppChatException
|
|
30
|
-
import org.infobip.mobile.messaging.chat.view.InAppChatErrorsHandler
|
|
31
19
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
32
20
|
|
|
33
21
|
/**
|
package/android/src/main/java/org/infobip/reactlibrary/mobilemessaging/RNMMWebRTCUIService.kt
CHANGED
|
@@ -9,10 +9,8 @@
|
|
|
9
9
|
package org.infobip.reactlibrary.mobilemessaging
|
|
10
10
|
|
|
11
11
|
import android.content.Context
|
|
12
|
-
import androidx.annotation.NonNull
|
|
13
12
|
import com.facebook.react.bridge.Callback
|
|
14
13
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
15
|
-
import org.infobip.mobile.messaging.util.StringUtils
|
|
16
14
|
import java.lang.reflect.Proxy
|
|
17
15
|
|
|
18
16
|
/**
|
|
@@ -12,7 +12,6 @@ import android.content.BroadcastReceiver
|
|
|
12
12
|
import android.content.Context
|
|
13
13
|
import com.facebook.react.ReactApplication
|
|
14
14
|
import com.facebook.react.bridge.ReactContext
|
|
15
|
-
import org.infobip.reactlibrary.mobilemessaging.ReactNativeMobileMessagingService
|
|
16
15
|
|
|
17
16
|
/**
|
|
18
17
|
* Base class for BroadcastReceivers that need to interact with React Native.
|
|
@@ -20,7 +20,6 @@ import android.content.IntentFilter
|
|
|
20
20
|
import android.graphics.Color
|
|
21
21
|
import android.os.Build
|
|
22
22
|
import android.os.Bundle
|
|
23
|
-
import android.util.Log
|
|
24
23
|
|
|
25
24
|
import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
|
26
25
|
|
|
@@ -31,8 +30,6 @@ import com.facebook.react.bridge.ReactApplicationContext
|
|
|
31
30
|
import com.facebook.react.bridge.ReactContext
|
|
32
31
|
import com.facebook.react.bridge.ReadableArray
|
|
33
32
|
import com.facebook.react.bridge.ReadableMap
|
|
34
|
-
import com.facebook.react.bridge.WritableMap
|
|
35
|
-
import com.facebook.react.ReactApplication
|
|
36
33
|
import com.facebook.react.modules.core.PermissionAwareActivity
|
|
37
34
|
import com.facebook.react.modules.core.PermissionListener
|
|
38
35
|
import com.google.android.gms.common.ConnectionResult
|
|
@@ -49,7 +46,6 @@ import org.infobip.mobile.messaging.NotificationSettings
|
|
|
49
46
|
import org.infobip.mobile.messaging.SuccessPending
|
|
50
47
|
import org.infobip.mobile.messaging.User
|
|
51
48
|
import org.infobip.mobile.messaging.chat.InAppChat
|
|
52
|
-
import org.infobip.mobile.messaging.chat.core.InAppChatEvent
|
|
53
49
|
import org.infobip.mobile.messaging.dal.bundle.MessageBundleMapper
|
|
54
50
|
import org.infobip.mobile.messaging.inbox.Inbox
|
|
55
51
|
import org.infobip.mobile.messaging.inbox.InboxMapper
|
|
@@ -60,7 +56,6 @@ import org.infobip.mobile.messaging.interactive.MobileInteractive
|
|
|
60
56
|
import org.infobip.mobile.messaging.interactive.NotificationAction
|
|
61
57
|
import org.infobip.mobile.messaging.interactive.NotificationCategory
|
|
62
58
|
import org.infobip.mobile.messaging.logging.MobileMessagingLogger
|
|
63
|
-
import org.infobip.mobile.messaging.logging.LogcatWriter
|
|
64
59
|
import org.infobip.mobile.messaging.mobileapi.InternalSdkError
|
|
65
60
|
import org.infobip.mobile.messaging.mobileapi.MobileMessagingError
|
|
66
61
|
import org.infobip.mobile.messaging.mobileapi.Result
|
|
@@ -76,12 +71,10 @@ import org.infobip.mobile.messaging.util.PreferenceHelper
|
|
|
76
71
|
import org.infobip.mobile.messaging.plugins.InstallationJson
|
|
77
72
|
|
|
78
73
|
import org.infobip.reactlibrary.mobilemessaging.datamappers.ReactNativeJson
|
|
79
|
-
import org.infobip.reactlibrary.mobilemessaging.ReactNativeBroadcastReceiver
|
|
80
74
|
|
|
81
75
|
import org.json.JSONArray
|
|
82
76
|
import org.json.JSONException
|
|
83
77
|
import org.json.JSONObject
|
|
84
|
-
import java.util.*
|
|
85
78
|
import java.util.concurrent.CopyOnWriteArrayList
|
|
86
79
|
import kotlinx.coroutines.CoroutineScope
|
|
87
80
|
import kotlinx.coroutines.Dispatchers
|
|
@@ -649,7 +642,7 @@ class ReactNativeMobileMessagingService(
|
|
|
649
642
|
}
|
|
650
643
|
}
|
|
651
644
|
|
|
652
|
-
override fun onNewIntent(intent: Intent
|
|
645
|
+
override fun onNewIntent(intent: Intent) {
|
|
653
646
|
// Empty implementation
|
|
654
647
|
}
|
|
655
648
|
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
|
|
9
9
|
package org.infobip.reactlibrary.mobilemessaging
|
|
10
10
|
|
|
11
|
-
import android.util.Log;
|
|
12
11
|
import com.facebook.react.uimanager.ViewGroupManager
|
|
13
12
|
import com.facebook.react.uimanager.annotations.ReactProp
|
|
14
13
|
import com.facebook.react.uimanager.ThemedReactContext
|
|
@@ -17,8 +16,6 @@ import com.facebook.react.uimanager.ViewManagerDelegate
|
|
|
17
16
|
import com.facebook.react.module.annotations.ReactModule
|
|
18
17
|
import com.facebook.react.viewmanagers.RNMMChatViewManagerInterface
|
|
19
18
|
import com.facebook.react.viewmanagers.RNMMChatViewManagerDelegate
|
|
20
|
-
import org.infobip.reactlibrary.mobilemessaging.RNMMChatView
|
|
21
|
-
import org.infobip.reactlibrary.mobilemessaging.Utils.getFragmentActivity
|
|
22
19
|
|
|
23
20
|
|
|
24
21
|
@ReactModule(name = RNMMChatViewManager.NAME)
|
|
@@ -8,8 +8,6 @@
|
|
|
8
8
|
|
|
9
9
|
package org.infobip.reactlibrary.mobilemessaging
|
|
10
10
|
|
|
11
|
-
import android.util.Log
|
|
12
|
-
import androidx.annotation.NonNull
|
|
13
11
|
import com.facebook.react.bridge.Callback
|
|
14
12
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
15
13
|
import com.facebook.react.module.annotations.ReactModule
|
|
Binary file
|
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.6.1",
|
|
5
5
|
"description": "Infobip Mobile Messaging React Native Plugin",
|
|
6
6
|
"main": "./src/index.js",
|
|
7
7
|
"scripts": {
|
|
@@ -37,10 +37,11 @@
|
|
|
37
37
|
"react-native": ">=0.68.0 <1.0.x"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@react-native/codegen": "
|
|
40
|
+
"@react-native/codegen": "0.81.6",
|
|
41
|
+
"@types/react": "^19.1.4",
|
|
41
42
|
"metro-react-native-babel-preset": "^0.77.0",
|
|
42
|
-
"react": "
|
|
43
|
-
"react-native": "
|
|
43
|
+
"react": "19.1.4",
|
|
44
|
+
"react-native": "0.81.6"
|
|
44
45
|
},
|
|
45
46
|
"codegenConfig": {
|
|
46
47
|
"name": "MobileMessaging",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
* <ChatView ref={chatRef} sendButtonColor="#3478F6" style={{ flex: 1 }} />;
|
|
18
18
|
* chatRef.current?.showThreadsList();
|
|
19
19
|
*/
|
|
20
|
-
import
|
|
20
|
+
import {
|
|
21
|
+
type ElementRef,
|
|
21
22
|
forwardRef,
|
|
22
23
|
useImperativeHandle,
|
|
23
24
|
useLayoutEffect,
|
|
@@ -58,7 +59,7 @@ export interface ChatViewHandle {
|
|
|
58
59
|
export interface ChatViewProps extends RNMMChatViewProps { }
|
|
59
60
|
|
|
60
61
|
const ChatView = forwardRef<ChatViewHandle, ChatViewProps>(({ sendButtonColor, style }, ref) => {
|
|
61
|
-
const RNMMChatRef = useRef<
|
|
62
|
+
const RNMMChatRef = useRef<ElementRef<typeof RNMMChatView>>(null);
|
|
62
63
|
const CHAT_EVENT_EXCEPTION_RECEIVED = "inAppChat.internal.exceptionReceived";
|
|
63
64
|
let eventEmitter = new NativeEventEmitter(NativeModules.ReactNativeMobileMessaging);
|
|
64
65
|
const isFabric = (global as any).nativeFabricUIManager != null;
|
|
@@ -76,7 +77,7 @@ const ChatView = forwardRef<ChatViewHandle, ChatViewProps>(({ sendButtonColor, s
|
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
function dispatchCommand(
|
|
79
|
-
viewRef:
|
|
80
|
+
viewRef: ElementRef<typeof RNMMChatView> | null,
|
|
80
81
|
command: 'add' | 'remove' | 'showThreadsList' | 'setExceptionHandler',
|
|
81
82
|
params: any[] = [],
|
|
82
83
|
) {
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
*
|
|
12
12
|
* React Native Fabric (Codegen) native component declaration for the Infobip ChatView.
|
|
13
13
|
*/
|
|
14
|
+
import * as React from 'react';
|
|
14
15
|
import type {HostComponent, ViewProps} from 'react-native';
|
|
15
16
|
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
|
16
17
|
import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
|
|
@@ -32,4 +33,4 @@ export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
|
|
|
32
33
|
|
|
33
34
|
export default codegenNativeComponent<NativeProps>(
|
|
34
35
|
'RNMMChatView',
|
|
35
|
-
) as HostComponent<NativeProps>;
|
|
36
|
+
) as HostComponent<NativeProps>;
|
|
Binary file
|