From 9080383a1cea6b8d53b8e0828a3ef14043043b93 Mon Sep 17 00:00:00 2001 From: Adam Mihalik Date: Mon, 22 May 2023 14:05:43 +0200 Subject: [PATCH] Native SDK update Android3.6.1 and iOS2.16.2 --- android/build.gradle | 3 ++- .../com/exponea/ReactNativeAppInboxProvider.kt | 16 ++-------------- .../com/exponea/style/AppInboxListItemStyle.kt | 4 ++-- example/android/app/build.gradle | 2 +- example/ios/Podfile.lock | 12 ++++++------ ios/Podfile | 2 +- ios/Podfile.lock | 8 ++++---- react-native-exponea-sdk.podspec | 2 +- 8 files changed, 19 insertions(+), 30 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index fa5759a..16c4829 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -92,8 +92,9 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" //noinspection GradleDynamicVersion implementation 'com.facebook.react:react-native:+' // From node_modules - implementation 'com.exponea.sdk:sdk:3.5.0' + implementation 'com.exponea.sdk:sdk:3.6.1' implementation 'com.google.code.gson:gson:2.8.9' + implementation 'org.danilopianini:gson-extras:0.2.2' implementation 'androidx.recyclerview:recyclerview:1.2.1' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' diff --git a/android/src/main/java/com/exponea/ReactNativeAppInboxProvider.kt b/android/src/main/java/com/exponea/ReactNativeAppInboxProvider.kt index 6c4c837..fe18617 100644 --- a/android/src/main/java/com/exponea/ReactNativeAppInboxProvider.kt +++ b/android/src/main/java/com/exponea/ReactNativeAppInboxProvider.kt @@ -11,6 +11,7 @@ import android.widget.TextView import androidx.recyclerview.widget.RecyclerView.OnChildAttachStateChangeListener import com.exponea.sdk.models.MessageItem import com.exponea.sdk.services.DefaultAppInboxProvider +import com.exponea.sdk.util.MessageItemViewHolder import com.exponea.sdk.view.AppInboxDetailView import com.exponea.sdk.view.AppInboxListView import com.exponea.style.AppInboxStyle @@ -61,7 +62,7 @@ class ReactNativeAppInboxProvider(private val appInboxStyle: AppInboxStyle) : De // (performance) register listener only if item style is set view.listView.addOnChildAttachStateChangeListener(object : OnChildAttachStateChangeListener { override fun onChildViewAttachedToWindow(view: View) { - itemStyle.applyTo(ReactNativeMessageItemViewHolder(view)) + itemStyle.applyTo(MessageItemViewHolder(view)) } override fun onChildViewDetachedFromWindow(view: View) { @@ -71,17 +72,4 @@ class ReactNativeAppInboxProvider(private val appInboxStyle: AppInboxStyle) : De } return view } - - /** - * As MessageItemViewHolder from SDK is internal, we need to create mirror. - */ - class ReactNativeMessageItemViewHolder(target: View) { - val TODO_REMOVE_ME: RelativeLayout? = target.findViewById(R.id.action_bar_subtitle) - val itemContainer: RelativeLayout? = target.findViewById(R.id.message_item_container) - val readFlag: ImageView? = target.findViewById(R.id.message_item_read_flag) - val receivedTime: TextView? = target.findViewById(R.id.message_item_received_time) - val title: TextView? = target.findViewById(R.id.message_item_title) - val content: TextView? = target.findViewById(R.id.message_item_content) - val image: ImageView? = target.findViewById(R.id.message_item_image) - } } diff --git a/android/src/main/java/com/exponea/style/AppInboxListItemStyle.kt b/android/src/main/java/com/exponea/style/AppInboxListItemStyle.kt index c61b9a4..fd243bb 100644 --- a/android/src/main/java/com/exponea/style/AppInboxListItemStyle.kt +++ b/android/src/main/java/com/exponea/style/AppInboxListItemStyle.kt @@ -1,7 +1,7 @@ package com.exponea.style -import com.exponea.ReactNativeAppInboxProvider.ReactNativeMessageItemViewHolder import com.exponea.asColor +import com.exponea.sdk.util.MessageItemViewHolder import com.facebook.react.bridge.DynamicFromObject data class AppInboxListItemStyle( @@ -12,7 +12,7 @@ data class AppInboxListItemStyle( var content: TextViewStyle? = null, var image: ImageViewStyle? = null ) { - fun applyTo(target: ReactNativeMessageItemViewHolder) { + fun applyTo(target: MessageItemViewHolder) { DynamicFromObject(backgroundColor).asColor()?.let { target.itemContainer?.setBackgroundColor(it) } diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 08e2439..820d802 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -202,7 +202,7 @@ dependencies { gmsImplementation 'com.google.firebase:firebase-messaging:23.0.0' hmsImplementation 'com.huawei.agconnect:agconnect-core:1.5.2.300' hmsImplementation 'com.huawei.hms:push:6.3.0.302' - implementation 'com.exponea.sdk:sdk:3.5.0' + implementation 'com.exponea.sdk:sdk:3.6.1' implementation 'com.squareup.okhttp3:okhttp:4.9.3' implementation 'com.google.code.gson:gson:2.8.9' diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 25c3d70..30c7bc6 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -3,9 +3,9 @@ PODS: - boost (1.76.0) - CocoaAsyncSocket (7.6.5) - DoubleConversion (1.1.6) - - ExponeaSDK (2.16.1): + - ExponeaSDK (2.16.2): - SwiftSoup (= 2.4.3) - - ExponeaSDK-Notifications (2.16.1) + - ExponeaSDK-Notifications (2.16.2) - FBLazyVector (0.70.7) - FBReactNativeSpec (0.70.7): - RCT-Folly (= 2021.07.22.00) @@ -290,7 +290,7 @@ PODS: - glog - react-native-exponea-sdk (1.4.0): - AnyCodable-FlightSchool (= 0.4.0) - - ExponeaSDK (= 2.16.1) + - ExponeaSDK (= 2.16.2) - React-Core - react-native-safe-area-context (4.5.0): - RCT-Folly @@ -579,8 +579,8 @@ SPEC CHECKSUMS: boost: a7c83b31436843459a1961bfd74b96033dc77234 CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 - ExponeaSDK: daf1d20e9e2c1dfe5f5658a580d48aee6ac4b69b - ExponeaSDK-Notifications: 06a80afcfd91283fee59ed59eb841ac86a7af540 + ExponeaSDK: 485fcf173241a779d6567f44139cfbc2a4ddd775 + ExponeaSDK-Notifications: 6541a7762946a3ae4990738e89b6db700f065b19 FBLazyVector: a6454570f573a0f6f1d397e5a95c13e8e45d1700 FBReactNativeSpec: 09e8dfba44487e5dc4882a9f5318cde67549549c Flipper: 26fc4b7382499f1281eb8cb921e5c3ad6de91fe0 @@ -610,7 +610,7 @@ SPEC CHECKSUMS: React-jsiexecutor: e95cdd036e7947ddf87f3049319ac3064deb76b5 React-jsinspector: 1c34fea1868136ecde647bc11fae9266d4143693 React-logger: e9f407f9fdf3f3ce7749ae6f88affe63e8446019 - react-native-exponea-sdk: 9ccce2214a5943e202a029304473bdde4863453d + react-native-exponea-sdk: fb4df1730f6b1b8b5dde291b27a445c777d11dd9 react-native-safe-area-context: 39c2d8be3328df5d437ac1700f4f3a4f75716acc React-perflogger: 52a94f38c19a518d05726624b49bfc192639374d React-RCTActionSheet: 7b89fe64a852bc3ae39b91dbd142ef09931ef3f7 diff --git a/ios/Podfile b/ios/Podfile index c41cd5e..a3a5f7d 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -11,7 +11,7 @@ target 'Exponea' do use_react_native!(:path => config[:reactNativePath]) - pod "ExponeaSDK", "2.16.1" + pod "ExponeaSDK", "2.16.2" pod 'AnyCodable-FlightSchool', '0.4.0' end diff --git a/ios/Podfile.lock b/ios/Podfile.lock index a9ca426..83df9a9 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -2,7 +2,7 @@ PODS: - AnyCodable-FlightSchool (0.4.0) - boost (1.76.0) - DoubleConversion (1.1.6) - - ExponeaSDK (2.16.1): + - ExponeaSDK (2.16.2): - SwiftSoup (= 2.4.3) - FBLazyVector (0.70.7) - FBReactNativeSpec (0.70.7): @@ -317,7 +317,7 @@ DEPENDENCIES: - AnyCodable-FlightSchool (= 0.4.0) - boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`) - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) - - ExponeaSDK (= 2.16.1) + - ExponeaSDK (= 2.16.2) - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`) - FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`) - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) @@ -439,7 +439,7 @@ SPEC CHECKSUMS: AnyCodable-FlightSchool: 9bf42632b5256c78710e2f4fb18ce78e89180883 boost: a7c83b31436843459a1961bfd74b96033dc77234 DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 - ExponeaSDK: daf1d20e9e2c1dfe5f5658a580d48aee6ac4b69b + ExponeaSDK: 485fcf173241a779d6567f44139cfbc2a4ddd775 FBLazyVector: a6454570f573a0f6f1d397e5a95c13e8e45d1700 FBReactNativeSpec: 09e8dfba44487e5dc4882a9f5318cde67549549c fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 @@ -478,6 +478,6 @@ SPEC CHECKSUMS: SwiftSoup: 3384f2e618cfc1b3cbc7852c16692fe8de13fb8f Yoga: 92d086bb705a41cc588599b51db726ba7b1d341c -PODFILE CHECKSUM: a29c2340ed23c08f66229b04a20f01d61bda2c98 +PODFILE CHECKSUM: 158fbbb70f5a17f417d59657f6bd0690998e9322 COCOAPODS: 1.11.3 diff --git a/react-native-exponea-sdk.podspec b/react-native-exponea-sdk.podspec index c770c94..c4c7852 100644 --- a/react-native-exponea-sdk.podspec +++ b/react-native-exponea-sdk.podspec @@ -22,7 +22,7 @@ Pod::Spec.new do |s| s.requires_arc = true s.dependency "React-Core" - s.dependency "ExponeaSDK", "2.16.1" + s.dependency "ExponeaSDK", "2.16.2" s.dependency "AnyCodable-FlightSchool", "0.4.0" # Don't install the dependencies when we run `pod install` in the old architecture.