infobip / mobile-messaging-react-native-plugin

Mobile Messaging SDK plugin for React Native projects
24 stars 4 forks source link

Notification Delivery Issue on Android 13+ with Outdated React Native Version #76

Open Hicham-Zaroual opened 2 weeks ago

Hicham-Zaroual commented 2 weeks ago

I'm currently facing an issue with the package in my React Native app. The app is running an outdated version of React Native (0.63.3), and users on Android versions 13 and above are not receiving notifications.

Due to time constraints and the complexity involved, I'm unable to upgrade the React Native version to the latest one supported by the plugin. However, I'm keen on finding a solution to ensure that notifications are delivered to users on Android 13 and above, as the app is already in production.

Is there a possibility of creating a compatibility patch for the plugin that addresses the issue specifically for Android 13 and above, or maybe a native-level workarounds that could be implemented without requiring a React Native version upgrade?

This could be a temporary solution to ensure continuity for production users until a full upgrade can be performed.

Environment Details:

React Native Version: 0.63.3 Android Versions Affected: 13 and above Package Version: 5.1.0

acikul commented 2 weeks ago

Thank you @Hicham-Zaroual for bringing this issue to our attention. While we currently don't have a policy of offering custom patches, we're here to assist you in finding a solution. It seems the issue could be related to the changes in push notification permission handling introduced in Android 13. As Android 13 support has been provided in plugin versions 7.0.0 and onwards, it's likely that the required adjustments have been made in our SDK. To address this, I recommend reviewing the changes made in versions 7.0.0 and 7.0.1 of our plugin. Additionally, our migration guide and documentation on Android 13 Notification Permission Handling could provide valuable insights. If you encounter any further difficulties or have questions while implementing the solution, please don't hesitate to reach out. We're here to help. Could you also confirm if manually requesting the permission resolved the issue on your end? Thanks!

Hicham-Zaroual commented 5 days ago

Thank you @acikul for your prompt response and guidance. I've successfully addressed the Android notification issue by adding the line to the AndroidManifest.xml file. Additionally, I've added the following two lines to the file /node_modules/react-native/Libraries/PermissionsAndroid/PermissionsAndroid.js: POST_NOTIFICATIONS: 'android.permission.POST_NOTIFICATIONS', POST_NOTIFICATIONS: 'string', and I have updated the library from version 5.1.0 to version 6.1.0. These modifications have effectively resolved the notification problem on Android 13 and above within my application. However, I'm currently encountering an error on ios when running the yarn run mm_build command. The specific error message I'm receiving is as follows: Build Failed Task failed with exit code 65: /usr/bin/xcrun xcodebuild -project node_modules/infobip-mobile-messaging-react-native-plugin/ios/Carthage/Checkouts/mobile-messaging-sdk-ios/MobileMessaging.xcodeproj -scheme MobileMessaging -configuration Release -derivedDataPath Library/Caches/org.carthage.CarthageKit/DerivedData/15.3_15E204a/mobile-messaging-sdk-ios/9.2.16 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive VALIDATE_WORKSPACE=NO -archivePath /var/folders/tk/ck1v7zhj7kvg91ynscdtb89h0000gn/T/mobile-messaging-sdk-ios SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in node_modules/infobip-mobile-messaging-react-native-plugin/ios/Carthage/Checkouts/mobile-messaging-sdk-ios)

Xcode version : 15.3

I will now closely examine this error to identify and resolve the issue. If you have any suggestions or additional advice for resolving this error, I would appreciate hearing them.

Once again, thank you for your help and attention to this matter. I will keep you updated on any progress or further difficulties I encounter while resolving this issue.

Best regards

MalickDiaw commented 1 day ago

Thank you @acikul for your prompt response and guidance. I've successfully addressed the Android notification issue by adding the line to the AndroidManifest.xml file. Additionally, I've added the following two lines to the file /node_modules/react-native/Libraries/PermissionsAndroid/PermissionsAndroid.js: POST_NOTIFICATIONS: 'android.permission.POST_NOTIFICATIONS', POST_NOTIFICATIONS: 'string', and I have updated the library from version 5.1.0 to version 6.1.0. These modifications have effectively resolved the notification problem on Android 13 and above within my application. However, I'm currently encountering an error on ios when running the yarn run mm_build command. The specific error message I'm receiving is as follows: Build Failed Task failed with exit code 65: /usr/bin/xcrun xcodebuild -project node_modules/infobip-mobile-messaging-react-native-plugin/ios/Carthage/Checkouts/mobile-messaging-sdk-ios/MobileMessaging.xcodeproj -scheme MobileMessaging -configuration Release -derivedDataPath Library/Caches/org.carthage.CarthageKit/DerivedData/15.3_15E204a/mobile-messaging-sdk-ios/9.2.16 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive VALIDATE_WORKSPACE=NO -archivePath /var/folders/tk/ck1v7zhj7kvg91ynscdtb89h0000gn/T/mobile-messaging-sdk-ios SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in node_modules/infobip-mobile-messaging-react-native-plugin/ios/Carthage/Checkouts/mobile-messaging-sdk-ios)

Xcode version : 15.3

I will now closely examine this error to identify and resolve the issue. If you have any suggestions or additional advice for resolving this error, I would appreciate hearing them.

Once again, thank you for your help and attention to this matter. I will keep you updated on any progress or further difficulties I encounter while resolving this issue.

Best regards

I encountered the same issue. Is there a workaround solution ? Thanks.