React-native-firebase: In App Messages do not appear on iOS (Message display component is not present yet. No display should happen)

Created on 14 Apr 2020  ·  17Comments  ·  Source: invertase/react-native-firebase

Issue

I can't get any messages in my app

I run emulator with flag -FIRDebugEnabled

And sent a test message using next example Send a test message

Case 1:

// package.json
@react-native-firebase/[email protected]
// ios/Podfile
$FirebaseSDKVersion = '6.13.0'

And see that message can’t show:

6.13.0 - [Firebase/InAppMessaging][I-IAM400027] Message display component is not present yet. No display should happen.

Case 2:

// package.json
@react-native-firebase/[email protected]
// ios/Podfile
$FirebaseSDKVersion = '6.16.0'

I think it can be related:

And see that no messages, but i 100% sent it again and again!

6.16.0 - [Firebase/InAppMessaging][I-IAM400001] No appropriate in-app message detected for display.

Project Files

Javascript

Click To Expand

#### `package.json`:

{
  "private": true
}

#### `firebase.json` for react-native-firebase v6:
# N/A
### iOS
Click To Expand

#### `ios/Podfile`: - [ ] I'm not using Pods - [x] I'm using Pods and my Podfile looks like:

platform :ios, '9.0'

require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'


def commons
  rn_path = '../node_modules/react-native'
  permissions_path = '../node_modules/react-native-permissions/ios'


  pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
  pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
  pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
  pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/'
  pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
  pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
  pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
  pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
  pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
  pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
  pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
  pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
  pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
  pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
  pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
  pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
  pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
  pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
  pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'


  pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways.podspec"
  pod 'Permission-LocationWhenInUse', :path => "#{permissins_path}/LocationWhenInUse.podspec"


  pod 'Stripe', '~> 14.0.1'
  pod 'Sift'
  pod 'StripeTerminal', '1.0.3'
  pod 'Alamofire', '4.8.2'


  use_native_modules!
end

target 'App' do
  commons
end
``

#### `AppDelegate.m`:

```objc
// N/A


Android

Click To Expand

#### Have you converted to AndroidX? - [ ] my application is an AndroidX application? - [ ] 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`:

// N/A
#### `android/app/build.gradle`:
// N/A
#### `android/settings.gradle`:
// N/A
#### `MainApplication.java`:
// N/A
#### `AndroidManifest.xml`:
<!-- N/A -->


Environment

Click To Expand

**`react-native info` output:**

System:
    OS: macOS Mojave 10.14.6
    CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz
    Memory: 42.48 MB / 8.00 GB
    Shell: 3.0.2 - /usr/local/bin/fish
  Binaries:
    Node: 13.2.0 - /usr/local/bin/node
    Yarn: 1.22.0 - /usr/local/bin/yarn
    npm: 6.13.1 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
    Android SDK:
      API Levels: 28, 29
      Build Tools: 28.0.3, 29.0.3
      System Images: android-21 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom, android-R | Google APIs Intel x86 Atom_64
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.6010548
    Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0 
    react-native: 0.61.5 => 0.61.5 
  npmGlobalPackages:
    react-native-cli: 2.0.1
- **Platform that you're experiencing the issue on**: - [x] iOS - [ ] Android - [ ] **iOS** but have not tested behavior on Android - [ ] **Android** but have not tested behavior on iOS - [ ] Both - **`react-native-firebase` version you're using that has this issue:** - `6.4.0` - **`Firebase` module(s) you're using that has the issue:** - `in-app-messaging` - **Are you using `TypeScript`?** - `Y` & `3.7.X`




In-App Messaging >= 6

Most helpful comment

I'm having the same issue.. using the latest versions

react-native-firebase/[email protected]
react-native-firebase/[email protected]

The cause is well explained here

The instructions have been updated for the latest version of InAppMessaging (released on 28/1/2020) where the Display component is now part of Firebase/InAppMessaging where previously it was in a separate component, InAppMessagingDisplay.

Please make sure you run pod update to get the latest version of Firebase, it should be 6.16.0 with FirebaseInAppMessaging being version 0.17.0.

So, after some researching I found that google recommended :

  • replacing the pod Firebase/InAppMessagingDisplay with Firebase/InAppMessaging .. (✓ Done)
  • minimal firebase-sdk for this change is @6.16.0 (✕ not done .. using @6.13.0)

This incompatibility is causing the issue

So the solution is either you ..

  • revert this change
  • or update the firbase-sdk to at least the recommended version @6.16.0

All 17 comments

i tried in-app-messaging and it failed on ios real device.

is there any solution for this?

my version:
@react-native-firebase/[email protected]

If you want somebody to reproduce, it might be helpful to show them how to get there. i.e. the code you're running.

@russellwheatley I was able to reproduce this issue on a new, clean react native init project created specifically to investigate this. Following steps included in general React Native Firebase _Get started_ guide and _In App Messaging_ guide result in In App Messaging module not displaying messages on iOS. Module works fine on Android.

Steps to reproduce:

  1. Run this script that will create a new React Native project and configure latest version of React Native Firebase accordingly to _Get Started_ guides.
  2. Add GoogleService-Info.plist to the project.
  3. Make sure bundle ID of the app matches your Firebase project configuration.
  4. Run the app with -FIRDebugEnabled runtime command argument.
  5. Inspect logs, find following line: [Firebase/InAppMessaging][I-IAM180017] Starting InAppMessaging runtime with Instance ID <id>
  6. Use instance ID from previous step to send a test message to this device through Firebase Console.
  7. Put the app into background by going to home screen. Then go back into the app.
  8. Test message should be now displayed.

The message will not be displayed. Logs will contain following line: [Firebase/InAppMessaging][I-IAM400027] Message display component is not present yet. No display should happen.

I'm having the same issue.. using the latest versions

react-native-firebase/[email protected]
react-native-firebase/[email protected]

The cause is well explained here

The instructions have been updated for the latest version of InAppMessaging (released on 28/1/2020) where the Display component is now part of Firebase/InAppMessaging where previously it was in a separate component, InAppMessagingDisplay.

Please make sure you run pod update to get the latest version of Firebase, it should be 6.16.0 with FirebaseInAppMessaging being version 0.17.0.

So, after some researching I found that google recommended :

  • replacing the pod Firebase/InAppMessagingDisplay with Firebase/InAppMessaging .. (✓ Done)
  • minimal firebase-sdk for this change is @6.16.0 (✕ not done .. using @6.13.0)

This incompatibility is causing the issue

So the solution is either you ..

  • revert this change
  • or update the firbase-sdk to at least the recommended version @6.16.0

Or you could update them yourself by overriding, like so: https://github.com/mikehardy/rnfbdemo/blob/master/make-demo-v6.sh#L33

And just take care to do this in order for it to work - https://github.com/mikehardy/rnfbdemo/blob/7d77f103d00b4c5a2288d3cefeb4b773a9e5531e/make-demo-v6.sh#L146-L149

thanks @mikehardy .. didn't know I could do that

solved with just editing my Podfile

target 'appName' do
   $FirebaseSDKVersion = '6.21.0'  # add this to override default firebase-sdk version
   ...
end

then cd ios && pod install

There's a section on overriding sdk versions on the getting started page on the docs site.

@MujtabaFR

 $FirebaseSDKVersion = '6.21.0'

Did it help you ?

@retyui .. yes, that completely solves the issue

The documentation states:

"Each release of the library is tested against a fixed set of SDK versions (e.g. Firebase SDKs), allowing us to be confident that every feature the library supports is working as expected"

"Using your own SDK versions is generally not recommended as it can lead to breaking changes in your application. Proceed with caution."

I think the best solution is to revert Firebase/InAppMessaging to Firebase/InAppMessagingDisplay as you suggested @MujtabaFR

does new released version 6.7.1 fix this issue?

still not working with me although tested with firebase-ios-SDK 6.21.0 & 6.23.0 it didn't work I can see the message in application cache but never fires, I work with iOS simulator would this make any difference?

Same here. Message doesnt show on IOS, android works fine (even on simulator).

@Noolie "Same here". You have the exact same versions of everything? That is rare. I would attempt with fully up to date upstream SDKs (pod 6.24.0) and the 7+ releases here, regardless. If it still occurs, then posting the information required in the template is most useful

@mikehardy currently i have 6.4.0 installed in my project. But even after update 7.0.1 it still doesn't work.
from package json:

"@react-native-firebase/app": "^7.0.1",
"@react-native-firebase/firestore": "^7.0.1",
"@react-native-firebase/iid": "^7.0.1",
"@react-native-firebase/in-app-messaging": "^7.0.1",

during pod install:

Installing Firebase (6.13.0)
Installing FirebaseAnalytics (6.1.6)
Installing FirebaseAnalyticsInterop (1.5.0)
Installing FirebaseAuthInterop (1.1.0)
Installing FirebaseCore (6.4.0)
Installing FirebaseCoreDiagnostics (1.2.1)
Installing FirebaseCoreDiagnosticsInterop (1.2.0)
Installing FirebaseFirestore (1.8.3)
Installing FirebaseInAppMessaging (0.15.6)
Installing FirebaseInstanceID (4.2.7)
Installing RNFBFirestore (7.0.1)
Installing GoogleAppMeasurement (6.1.6)
Installing GoogleDataTransport (4.0.1)
Installing GoogleDataTransportCCTSupport (1.4.1)
Installing GoogleUtilities (6.6.0)
Installing RNFBInAppMessaging (7.0.1)

after set $FirebaseSDKVersion = '6.24.0' in Podifle everything works now.

Excellent! The SDK update is what I mean. Official SDK update in progress #3663 - I'm going to resolve this as there is a PR in progress that has reported success and users can workaround with the override mentioned

Was this page helpful?
0 / 5 - 0 ratings