mobile-messaging-react-native-plugin icon indicating copy to clipboard operation
mobile-messaging-react-native-plugin copied to clipboard

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

Open Hicham-Zaroual opened this issue 9 months ago • 4 comments

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

Hicham-Zaroual avatar May 01 '24 20:05 Hicham-Zaroual

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!

acikul avatar May 02 '24 08:05 acikul

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

Hicham-Zaroual avatar May 13 '24 16:05 Hicham-Zaroual

Hey @Hicham-Zaroual and @MalickDiaw,

It's great to hear that the modifications resolved the notification issue on Android 13! Regarding the iOS error you encountered, what you've provided seems to be the command that's failing rather than the actual error message.

I'd like to get more info about the error you're encountering to successfully reproduce it. Could you provide the specific error message that appears in the output of the failed command? Usually error 65 indicates a compilation/linking issue.

You mentioned you switched from plugin version 5.1.0 to 6.1.0. Have you followed the migration guide for these particular versions?

Additionally, since you're running the yarn run mm_build command, are you following the manual integration guide for iOS?

Best regards.

acikul avatar May 20 '24 10:05 acikul

We didn't receive any answer, so I'll close it due to inactivity, you can reopen it if needed.

riskpp avatar Aug 16 '24 10:08 riskpp