invertase / react-native-firebase

🔥 A well-tested feature-rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for all Firebase services.
https://rnfirebase.io
Other
11.56k stars 2.19k forks source link

[🐛] In App Messaging - Issue with In App Messaging working in production #5670

Closed wahabtobibello closed 2 years ago

wahabtobibello commented 2 years ago

Issue

When using in app messaging, new campaigns don't seem to reflect on installed app unless app is reinstalled


Project Files

Javascript

Click To Expand

#### `package.json`: ```json { "name": "shara-lite", "version": "0.9.14-shara-lite-feature.firebase-in-app-msg+build.9064", "private": true, "scripts": { "android": "react-native run-android --variant localDebug --appIdSuffix local", "android:clean": "cd android && ./gradlew clean && cd ..", "android:connect": "adb reverse tcp:8081 tcp:8081", "ios": "react-native run-ios", "start": "react-native start", "test": "jest", "lint": "tsc && eslint app --ext .js,.jsx,.ts,.tsx --fix" }, "dependencies": { "@react-native-community/async-storage": "^1.11.0", "@react-native-community/blur": "^3.6.0", "@react-native-community/clipboard": "^1.5.1", "@react-native-community/datetimepicker": "^3.0.3", "@react-native-community/masked-view": "^0.1.10", "@react-native-community/netinfo": "^5.9.9", "@react-native-community/picker": "^1.6.5", "@react-native-community/push-notification-ios": "^1.8.0", "@react-native-firebase/analytics": "^12.4.0", "@react-native-firebase/app": "^12.4.0", "@react-native-firebase/crashlytics": "^12.4.0", "@react-native-firebase/in-app-messaging": "^12.6.0", "@react-native-firebase/messaging": "^12.4.0", "@react-native-firebase/perf": "^12.4.0", "@react-native-firebase/remote-config": "^12.4.0", "@react-navigation/bottom-tabs": "^5.11.7", "@react-navigation/material-top-tabs": "^5.3.13", "@react-navigation/native": "^5.9.2", "@react-navigation/stack": "^5.14.2", "@segment/analytics-react-native": "^1.2.1", "@sentry/react-native": "^1.9.0", "@twotalltotems/react-native-otp-input": "^1.3.11", "big.js": "^6.0.3", "bluebird": "^3.7.2", "bson": "^4.0.4", "crypto-js": "^3.3.0", "date-fns": "^2.14.0", "formik": "^2.1.5", "i18n-js": "^3.8.0", "intl": "^1.2.5", "js-search": "^2.0.0", "libphonenumber-js": "^1.8.5", "lodash": "^4.17.15", "lottie-react-native": "^3.5.0", "promise-retry": "^2.0.1", "pubnub": "^4.30.1", "pubnub-react": "^2.1.0", "query-string": "^6.13.1", "react": "16.13.1", "react-error-boundary": "^2.3.1", "react-native": "0.63.3", "react-native-animatable": "^1.3.3", "react-native-background-fetch": "^3.1.0", "react-native-check-app-install": "^0.0.5", "react-native-config": "^1.4.0", "react-native-contacts": "^5.2.3", "react-native-country-picker-modal": "^2.0.0", "react-native-device-info": "^5.6.1", "react-native-extra-dimensions-android": "^1.2.5", "react-native-fbsdk": "^3.0.0", "react-native-file-viewer": "^2.1.4", "react-native-floating-action": "^1.20.0", "react-native-fs": "^2.16.6", "react-native-gesture-handler": "^1.6.1", "react-native-get-random-values": "^1.4.0", "react-native-html-to-pdf-lite": "^0.9.1", "react-native-image-picker": "2.3.4", "react-native-intercom": "^18.0.0", "react-native-keyboard-aware-scrollview": "^2.1.0", "react-native-localize": "^2.0.1", "react-native-location": "^2.5.0", "react-native-markdown-display": "^7.0.0-alpha.2", "react-native-modal": "^11.5.6", "react-native-normalize": "^1.0.1", "react-native-otp-verify": "^1.0.3", "react-native-paper": "^4.8.1", "react-native-play-install-referrer": "^1.1.6", "react-native-popup-menu": "^0.15.8", "react-native-push-notification": "^7.3.1", "react-native-randombytes": "^3.5.3", "react-native-reanimated": "^1.9.0", "react-native-safe-area-context": "^3.0.5", "react-native-screens": "^2.17.1", "react-native-select-contact": "^1.5.0", "react-native-share": "^3.6.0", "react-native-svg": "^12.1.0", "react-native-swiper": "^1.6.0-rc.3", "react-native-tab-view": "^2.14.4", "react-native-ui-lib": "^5.18.0", "react-native-ux-cam": "^5.2.0", "react-native-vector-icons": "^8.1.0", "react-native-view-shot": "^3.1.2", "react-native-webview": "^11.3.2", "readable-stream": "1.0.33", "realm": "^10.5.0", "rn-fetch-blob": "^0.12.0", "rsdi": "^1.0.5", "shara-country-currency-map": "^1.0.1", "uuid": "^8.2.0", "uuid-by-string": "^3.0.2", "yarn": "^1.22.10", "yup": "^0.29.3" }, "devDependencies": { "@babel/core": "^7.6.2", "@babel/runtime": "^7.6.2", "@react-native-community/eslint-config": "^1.0.0", "@types/big.js": "^6.0.1", "@types/bluebird": "^3.5.33", "@types/bson": "^4.0.2", "@types/crypto-js": "^3.1.47", "@types/cryptr": "^4.0.1", "@types/date-fns": "^2.6.0", "@types/faker": "^4.1.12", "@types/geojson": "^7946.0.7", "@types/i18n-js": "^3.8.0", "@types/jest": "^24.0.24", "@types/js-search": "^1.4.0", "@types/lodash": "^4.14.157", "@types/node": "^12.12.54", "@types/promise-retry": "^1.1.3", "@types/pubnub": "^4.28.1", "@types/query-string": "^6.3.0", "@types/react-native": "^0.63.30", "@types/react-native-fbsdk": "^3.0.0", "@types/react-native-push-notification": "^5.0.5", "@types/react-native-share": "^3.3.0", "@types/react-native-vector-icons": "^6.4.5", "@types/react-test-renderer": "16.9.2", "@types/uuid": "^8.0.0", "@types/yup": "^0.29.6", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "@welldone-software/why-did-you-render": "^6.2.0", "babel-jest": "^24.9.0", "babel-plugin-module-resolver": "^4.0.0", "eslint": "^6.5.1", "husky": "^4.2.5", "jest": "^24.9.0", "jest-transform-stub": "^2.0.0", "lint-staged": "^10.2.11", "metro-react-native-babel-preset": "^0.58.0", "prettier": "^2.0.4", "react-native-svg-transformer": "^0.14.3", "react-test-renderer": "16.11.0", "typescript": "^3.8.3" }, "resolutions": { "react-native-svg": "12.1.0" }, "jest": { "preset": "react-native", "transformIgnorePatterns": [ "node_modules/(?!(jest-)?react-native|react-navigation|react-navigation-redux-helpers|@sentry|@react-navigation|rsdi/.*)" ], "moduleFileExtensions": [ "ts", "tsx", "js", "jsx", "json", "node" ], "setupFiles": [ "./node_modules/react-native-gesture-handler/jestSetup.js" ], "moduleNameMapper": { ".+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$": "jest-transform-stub" } }, "lint-staged": { "app/**": "yarn lint" }, "husky": { "hooks": { "pre-commit": "lint-staged" } } } ``` #### `firebase.json` for react-native-firebase v6: ```json # N/A ```

iOS

Click To Expand

#### `ios/Podfile`: - [ ] I'm not using Pods - [x] I'm using Pods and my Podfile looks like: ```ruby # N/A ``` #### `AppDelegate.m`: ```objc // N/A ```


Android

Click To Expand

#### Have you converted to AndroidX? - [x] my application is an AndroidX application? - [x] I am using `android/gradle.settings` `jetifier=true` for Android compatibility? - [ ] I am using the NPM package `jetifier` for react-native compatibility? #### `android/build.gradle`: ```groovy // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext { googlePlayServicesVersion = "+" androidMapsUtilsVersion = "+" buildToolsVersion = "29.0.2" minSdkVersion = 21 compileSdkVersion = 29 targetSdkVersion = 29 supportLibVersion = "28.0.0" } repositories { google() jcenter() mavenCentral() } dependencies { classpath("com.android.tools.build:gradle:4.0.1") classpath 'com.google.gms:google-services:4.3.8' classpath 'com.google.firebase:perf-plugin:1.3.1' classpath 'com.google.firebase:firebase-crashlytics-gradle:2.2.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { mavenLocal() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url("$rootDir/../node_modules/react-native/android") } maven { // Android JSC is installed from npm url("$rootDir/../node_modules/jsc-android/dist") } maven { // react-native-background-fetch url("${project(':react-native-background-fetch').projectDir}/libs") } google() jcenter() maven { url 'https://www.jitpack.io' } maven { url 'https://maven.google.com' } } } subprojects { afterEvaluate {project -> if (project.hasProperty("android")) { android { compileSdkVersion 29 buildToolsVersion '29.0.2' } } } } ``` #### `android/app/build.gradle`: ```groovy apply plugin: "com.android.application" apply plugin: "com.google.gms.google-services" apply plugin: "com.google.firebase.firebase-perf" apply plugin: "com.google.firebase.crashlytics" import com.android.build.OutputFile import groovy.json.JsonSlurper /** * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets * and bundleReleaseJsAndAssets). * These basically call `react-native bundle` with the correct arguments during the Android build * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the * bundle directly from the development server. Below you can see all the possible configurations * and their defaults. If you decide to add a configuration block, make sure to add it before the * `apply from: "../../node_modules/react-native/react.gradle"` line. * * project.ext.react = [ * // the name of the generated asset file containing your JS bundle * bundleAssetName: "index.android.bundle", * * // the entry file for bundle generation. If none specified and * // "index.android.js" exists, it will be used. Otherwise "index.js" is * // default. Can be overridden with ENTRY_FILE environment variable. * entryFile: "index.android.js", * * // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format * bundleCommand: "ram-bundle", * * // whether to bundle JS and assets in debug mode * bundleInDebug: false, * * // whether to bundle JS and assets in release mode * bundleInRelease: true, * * // whether to bundle JS and assets in another build variant (if configured). * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants * // The configuration property can be in the following formats * // 'bundleIn${productFlavor}${buildType}' * // 'bundleIn${buildType}' * // bundleInFreeDebug: true, * // bundleInPaidRelease: true, * // bundleInBeta: true, * * // whether to disable dev mode in custom build variants (by default only disabled in release) * // for example: to disable dev mode in the staging build type (if configured) * devDisabledInStaging: true, * // The configuration property can be in the following formats * // 'devDisabledIn${productFlavor}${buildType}' * // 'devDisabledIn${buildType}' * * // the root of your project, i.e. where "package.json" lives * root: "../../", * * // where to put the JS bundle asset in debug mode * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", * * // where to put the JS bundle asset in release mode * jsBundleDirRelease: "$buildDir/intermediates/assets/release", * * // where to put drawable resources / React Native assets, e.g. the ones you use via * // require('./image.png')), in debug mode * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", * * // where to put drawable resources / React Native assets, e.g. the ones you use via * // require('./image.png')), in release mode * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", * * // by default the gradle tasks are skipped if none of the JS files or assets change; this means * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to * // date; if you have any other folders that you want to ignore for performance reasons (gradle * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ * // for example, you might want to remove it from here. * inputExcludes: ["android/**", "ios/**"], * * // override which node gets called and with what additional arguments * nodeExecutableAndArgs: ["node"], * * // supply additional arguments to the packager * extraPackagerArgs: [] * ] */ project.ext.react = [ enableHermes: false, // clean and rebuild if changing ] apply from: "../../node_modules/react-native/react.gradle" /** * Set this to true to create two separate APKs instead of one: * - An APK that only works on ARM devices * - An APK that only works on x86 devices * The advantage is the size of the APK is reduced by about 4MB. * Upload all the APKs to the Play Store and people will download * the correct one based on the CPU architecture of their device. */ def enableSeparateBuildPerCPUArchitecture = false /** * Run Proguard to shrink the Java bytecode in release builds. */ def enableProguardInReleaseBuilds = false /** * The preferred build flavor of JavaScriptCore. * * For example, to use the international variant, you can use: * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` * * The international variant includes ICU i18n library and necessary data * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that * give correct results when using with locales other than en-US. Note that * this variant is about 6MiB larger per architecture than default. */ def jscFlavor = 'org.webkit:android-jsc:+' /** * Whether to enable the Hermes VM. * * This should be set on project.ext.react and mirrored here. If it is not set * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode * and the benefits of using Hermes will therefore be sharply reduced. */ def enableHermes = project.ext.react.get("enableHermes", false); /** * Backup version code */ def vcode = (int) (((new Date().getTime() / 1000) - 1451606400) / 10) /** * Get version from package.json * @return */ def getVersionFromPackageJson() { // Read and parse package.json file from project root def inputFile = new File("$rootDir/../package.json") def packageJson = new JsonSlurper().parseText(inputFile.text) // Return the version, you can get any value this way return packageJson["version"] } /** * Versioning from environment variables * * This is used by CircleCI to set the build num as version code and to get the * version from package.json and set it as the version name */ def appVersionCode = Integer.valueOf(System.getenv('SHARA_VERSION_CODE') ?: vcode).toInteger() def appVersionName = System.getenv('SHARA_VERSION_NAME') ?: getVersionFromPackageJson() /** * Keystore credentials from environment variables */ def sharaKeyAlias = System.getenv('SHARA_UPLOAD_KEY_ALIAS') ?: "keyAlias" def sharaKeyPassword = System.getenv('SHARA_UPLOAD_KEY_PASSWORD') ?: "keyPassword" def sharaStoreFile = System.getenv('SHARA_UPLOAD_STORE_FILE') ?: "storeFile" def sharaStorePassword = System.getenv('SHARA_UPLOAD_STORE_PASSWORD') ?: "storePassword" android { compileSdkVersion rootProject.ext.compileSdkVersion compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } defaultConfig { applicationId "co.shara.lite" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode appVersionCode versionName appVersionName multiDexEnabled true resValue "string", "build_config_package", "co.shara.lite" } splits { abi { reset() enable enableSeparateBuildPerCPUArchitecture universalApk false // If true, also generate a universal APK include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" } } signingConfigs { debug { storeFile file('debug.keystore') storePassword 'android' keyAlias 'androiddebugkey' keyPassword 'android' } release { storeFile file(sharaStoreFile) storePassword sharaStorePassword keyAlias sharaKeyAlias keyPassword sharaKeyPassword } } flavorDimensions "standard" productFlavors { local { applicationIdSuffix ".local" dimension "standard" } // Flavor below should test but productFlavor cannot start with test dev { applicationIdSuffix ".test" dimension "standard" } discovery { applicationIdSuffix ".discovery" dimension "standard" } delivery { applicationIdSuffix ".delivery" dimension "standard" } qa { applicationIdSuffix ".qa" dimension "standard" } production { applicationId "co.shara.lite" dimension "standard" } } buildTypes { debug { signingConfig signingConfigs.debug debuggable true } release { // Caution! In production, you need to generate your own keystore file. // see https://facebook.github.io/react-native/docs/signed-apk-android. signingConfig signingConfigs.release minifyEnabled enableProguardInReleaseBuilds proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" } } packagingOptions { pickFirst "lib/armeabi-v7a/libc++_shared.so" pickFirst "lib/arm64-v8a/libc++_shared.so" pickFirst "lib/x86/libc++_shared.so" pickFirst "lib/x86_64/libc++_shared.so" } // applicationVariants are e.g. debug, release applicationVariants.all { variant -> variant.outputs.each { output -> // For each separate APK per architecture, set a unique version code as described here: // https://developer.android.com/studio/build/configure-apk-splits.html def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] def abi = output.getFilter(OutputFile.ABI) if (abi != null) { // null for the universal-debug, universal-release variants output.versionCodeOverride = versionCodes.get(abi) * 1048576 + defaultConfig.versionCode } } } dexOptions { javaMaxHeapSize "3g" } } dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:+" // From node_modules implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" implementation 'com.facebook.soloader:soloader:0.9.0+' implementation "com.google.android.gms:play-services-base:16.0.1" implementation "com.google.android.gms:play-services-location:16.0.0" implementation "com.google.android.gms:play-services-analytics:16.0.8" implementation 'com.facebook.android:facebook-android-sdk:[5,6)' implementation 'io.intercom.android:intercom-sdk-base:7.+' implementation 'io.intercom.android:intercom-sdk:7.+' debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { exclude group: 'com.facebook.fbjni' } debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { exclude group: 'com.facebook.flipper' } debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") { exclude group: 'com.facebook.flipper' } if (enableHermes) { def hermesPath = "../../node_modules/hermes-engine/android/" debugImplementation files(hermesPath + "hermes-debug.aar") releaseImplementation files(hermesPath + "hermes-release.aar") } else { implementation jscFlavor } implementation platform('com.google.firebase:firebase-bom:28.4.0') implementation 'com.google.firebase:firebase-messaging' implementation 'com.google.firebase:firebase-inappmessaging-display' implementation 'com.google.firebase:firebase-analytics' } // Run this once to be able to run the application with BUCK // puts all compile dependencies into folder libs for BUCK to use task copyDownloadableDepsToLibs(type: Copy) { from configurations.compile into 'libs' } apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) apply from: "../../node_modules/react-native-vector-icons/fonts.gradle" apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle" ``` #### `android/settings.gradle`: ```groovy rootProject.name = 'Shara' include ':react-native-intercom' project(':react-native-intercom').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-intercom/android') include ':react-native-file-viewer' project(':react-native-file-viewer').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-file-viewer/android') include ':react-native-html-to-pdf-lite' project(':react-native-html-to-pdf-lite').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-html-to-pdf-lite/android') include ':react-native-otp-verify' project(':react-native-otp-verify').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-otp-verify/android') include ':react-native-bluetooth-escpos-printer' project(':react-native-bluetooth-escpos-printer').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-bluetooth-escpos-printer/android') include ':react-native-bluetooth-escpos-printer' project(':react-native-bluetooth-escpos-printer').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-bluetooth-escpos-printer/android') include ':react-native-bluetooth-escpos-printer' project(':react-native-bluetooth-escpos-printer').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-bluetooth-escpos-printer/android') include ':react-native-view-shot' project(':react-native-view-shot').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-view-shot/android') include ':rn-fetch-blob' project(':rn-fetch-blob').projectDir = new File(rootProject.projectDir, '../node_modules/rn-fetch-blob/android') include ':rn-fetch-blob' project(':rn-fetch-blob').projectDir = new File(rootProject.projectDir, '../node_modules/rn-fetch-blob/android') include ':react-native-fs' project(':react-native-fs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fs/android') include ':react-native-image-picker' project(':react-native-image-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-picker/android') include ':react-native-signature-capture' project(':react-native-signature-capture').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-signature-capture/android') include ':react-native-push-notification' project(':react-native-push-notification').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-push-notification/android') include ':react-native-config' project(':react-native-config').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-config/android') include ':react-native-device-info' project(':react-native-device-info').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-device-info/android') include ':react-native-vector-icons' project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android') apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) include ':app' ``` #### `MainApplication.java`: ```java package co.shara.lite; import android.app.Application; import android.content.Context; import com.facebook.react.PackageList; import com.facebook.react.ReactApplication; import com.robinpowered.react.Intercom.IntercomPackage; import io.intercom.android.sdk.Intercom; import com.vinzscam.reactnativefileviewer.RNFileViewerPackage; import com.onibenjo.htmltopdf.RNHTMLtoPDFPackage; import com.faizal.OtpVerify.RNOtpVerifyPackage; import fr.greweb.reactnativeviewshot.RNViewShotPackage; import com.RNFetchBlob.RNFetchBlobPackage; import com.RNFetchBlob.RNFetchBlobPackage; import com.rnfs.RNFSPackage; import com.imagepicker.ImagePickerPackage; import com.dieam.reactnativepushnotification.ReactNativePushNotificationPackage; import com.lugg.ReactNativeConfig.ReactNativeConfigPackage; import com.learnium.RNDeviceInfo.RNDeviceInfo; import com.oblador.vectoricons.VectorIconsPackage; import com.facebook.react.ReactInstanceManager; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; import com.facebook.soloader.SoLoader; import java.lang.reflect.InvocationTargetException; import java.util.List; public class MainApplication extends Application implements ReactApplication { private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { @Override public boolean getUseDeveloperSupport() { return BuildConfig.DEBUG; } @Override protected List getPackages() { @SuppressWarnings("UnnecessaryLocalVariable") List packages = new PackageList(this).getPackages(); // Packages that cannot be autolinked yet can be added manually here, for example: // packages.add(new MyReactNativePackage()); return packages; } @Override protected String getJSMainModuleName() { return "index"; } }; @Override public ReactNativeHost getReactNativeHost() { return mReactNativeHost; } @Override public void onCreate() { super.onCreate(); SoLoader.init(this, /* native exopackage */ false); // initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); Intercom.initialize(this, "android_sdk-7d5b11bb267ca87d07c686a807b6f620edb53f21", "j230ngb1"); } /** * Loads Flipper in React Native templates. Call this in the onCreate method with something like * initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); * * @param context * @param reactInstanceManager */ private static void initializeFlipper( Context context, ReactInstanceManager reactInstanceManager) { if (BuildConfig.DEBUG) { try { /* We use reflection here to pick up the class that initializes Flipper, since Flipper library is not available in release mode */ Class aClass = Class.forName("co.shara.app.ReactNativeFlipper"); aClass .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class) .invoke(null, context, reactInstanceManager); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (NoSuchMethodException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } } } } ``` #### `AndroidManifest.xml`: ```xml ```


Environment

Click To Expand

**`react-native info` output:** ``` System: OS: macOS 11.5.2 CPU: (8) arm64 Apple M1 Memory: 563.23 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 16.3.0 - /opt/homebrew/bin/node Yarn: 1.22.10 - ~/Projects/shara-inc/mobile/shara-lite/node_modules/.bin/yarn npm: 7.20.5 - /opt/homebrew/bin/npm Watchman: 2021.06.07.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.10.2 - /usr/local/bin/pod SDKs: iOS SDK: Not Found Android SDK: API Levels: 25, 29, 30, 31 Build Tools: 29.0.2, 30.0.3, 31.0.0 System Images: android-25 | Google APIs ARM 64 v8a, android-31 | Google APIs ARM 64 v8a, android-31 | Google Play ARM 64 v8a, android-S | Google APIs ARM 64 v8a, android-S | Google Play ARM 64 v8a Android NDK: Not Found IDEs: Android Studio: 2020.3 AI-203.7717.56.2031.7583922 Xcode: /undefined - /usr/bin/xcodebuild Languages: Java: 1.8.0_292 - /usr/bin/javac Python: 2.7.16 - /usr/bin/python npmPackages: @react-native-community/cli: Not Found react: 16.13.1 => 16.13.1 react-native: 0.63.3 => 0.63.3 react-native-macos: Not Found npmGlobalPackages: *react-native*: Not Found ``` - **Platform that you're experiencing the issue on**: - [ ] iOS - [ ] Android - [ ] **iOS** but have not tested behavior on Android - [x] **Android** but have not tested behavior on iOS - [ ] Both - **`react-native-firebase` version you're using that has this issue:** - 12.4.0 - **`Firebase` module(s) you're using that has the issue:** - @react-native-firebase/in-app-messaging - **Are you using `TypeScript`?** - Y & 3.8.3


mikehardy commented 2 years ago

Hi there! Given how simple the in-app-messaging module wrapper is here (it is one of the smallest bits of code in react-native-firebase) I'd urge you to try for a https://stackoverflow.com/help/minimal-reproducible-example (that is, specifying absolutely every configuration step you take on the firebase console, and what you do in the app - every tap etc) on a native example built from https://github.com/firebase/quickstart-android/tree/master/inappmessaging and opening an issue with the https://github.com/firebase/firebase-android-sdk/ repo - as this will likely be either something happening on the native level (at which point they will need the reproduction to fix it) or some sort of incorrect expectation with how in app messaging works (at which point they will have the authoritative explanation)

mikehardy commented 2 years ago

This is likely unrelated, but there was an IAM fix in firebase-ios-sdk 8.11.0 released just now https://github.com/firebase/firebase-ios-sdk/pull/8922

stale[bot] commented 2 years ago

Hello 👋, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?

This issue will be closed in 15 days if no further activity occurs. Thank you for your contributions.

stale[bot] commented 2 years ago

Closing this issue after a prolonged period of inactivity. If this is still present in the latest release, please feel free to create a new issue with up-to-date information.

yberstad commented 5 months ago

Hi!

We are experiencing the same issue now, having to reinstall app, before we are able to use the "Test on device" feature.

I do not know if this is only a "Test on device" issue or if it is a issue for regular in-app messages as well. We are testing on iOS, using "@react-native-firebase/in-app-messaging": "18.7.1".