I'm trying to implement push notifications feature within my react native Expo app. I'm trying to do so by integrating Onesignal with Firebase. I followed this documentation: "https://documentation.onesignal.com/docs/react-native-expo-sdk-setup"
I managed to prebuild the app and run it on the android emulator and the user is added in the onesignal dashboard but with subscription status not subscribed OneSignal Audience Dashboard Note : the notifications settings on the emulator for my app are ON
according to Onesignal documentation the users should be subscribed automatically once they use the app for the first time, here are some logs if needed:
› npx expo run:android
› Building app... Starting a Gradle Daemon (subsequent builds will be faster) Configuration on demand is an incubating feature.
Configure project :expo-application WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the
gradle.properties
file or use the new publishing DSL.
Configure project :expo-constants (same warning)
Configure project :expo-file-system (same warning)
Configure project :expo-font (same warning)
Configure project :expo-keep-awake (same warning)
Configure project :expo-linear-gradient (same warning)
Configure project :expo-modules-core (same warning)
Configure project :expo-splash-screen (same warning)
Configure project :expo
Using expo modules
- expo-application (5.0.1)
- expo-constants (14.0.2)
- expo-file-system (15.1.1)
- expo-font (11.0.1)
- expo-keep-awake (11.0.1)
- expo-linear-gradient (12.0.1)
- expo-modules-core (1.1.1)
- expo-splash-screen (0.17.5)
(same warning)
Configure project :react-native-reanimated AAR for react-native-reanimated has been found C:\Users..\source\repos...\node_modules\react-native-reanimated\android\react-native-reanimated-70-jsc.aar
The Kotlin Gradle plugin was loaded multiple times in different subprojects, which is not supported and may break the build. This might happen in subprojects that apply the Kotlin plugins with the Gradle 'plugins { ... }' DSL if they specify explicit versions, even if the versions are equal. Please add the Kotlin plugin to the common parent project or the root project, then remove the versions in the subprojects. If the parent project does not need the plugin, add 'apply false' to the plugin line. See: "https://docs.gradle.org/current/userguide/plugins.html#sec:subprojects_plugins_dsl" The Kotlin plugin was loaded in the following projects: ':react-native-gesture-handler', ':react-native-screens'
Task :expo-constants:createDebugExpoConfig Execution optimizations have been disabled for task ':expo-constants:createDebugExpoConfig' to ensure correctness due to the following reasons:
- Gradle detected a problem with the following location: 'C:\Users...\source\repos...\android'. Reason: Task ':expo-constants:createDebugExpoConfig' uses this output of task ':app:checkDebugAarMetadata' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to "docs.gradle.org/7.3.3/userguide/validation_problems.html#implicit_dependency" for more details about this problem.
Task :expo-modules-core:downloadBoost UP-TO-DATE Download "boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.gz"
Task :expo-modules-core:downloadDoubleConversion UP-TO-DATE Download "github.com/google/double-conversion/archive/v1.1.6.tar.gz"
Task :expo-modules-core:downloadFolly UP-TO-DATE Download "github.com/facebook/folly/archive/v2021.07.22.00.tar.gz"
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See "docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings"
Execution optimizations have been disabled for 1 invalid unit(s) of work during this build to ensure correctness. Please consult deprecation warnings for more details.
BUILD SUCCESSFUL in 2m 51s
I added the local.properties manually with this inside: sdk.dir=C:\Users\...\AppData\Local\Android\sdk
I changed the gradel version in gradel-wrapper.properties to the version 7.3.3distributionUrl="https://services.gradle.org/distributions/gradle-7.3.3-all.zip"
In build.gradel inside android section I changed compileSdkVersion and targetSdkVersion to 32