Closed kauamelo closed 6 months ago
I wonder if this isn't a dynamic link configuration issue of some sort on the iOS side - we are missing some in-app-messaging listeners but not in an asymmetric way across platforms - if it works on android then it should exist and work on ios as well
Some thoughts -
Hi Mike!
I've tried with a normal link (ex: https://www.google.com/) but it doesn't work either. So I'm not sure whether the problem is a dynamic link configuration issue of some sort on the iOS side as you're suspecting. It doesn't work on iOS, regardless of the type of the URL...
I used a Firebase Dynamic Link in the example here because I saw this has been an issue for one year: https://github.com/invertase/react-native-firebase/issues/6861 and it seems like the only workaround people found was to use Firebase Dynamic Link. But even that is not working for me...
Does it work for you with a normal link? And with a Firebase Dynamic Link? Maybe I'm missing something ?
I've updated everything to 19.1.2 but I started getting other issues in my project. I'll try to update them later today and come back here with an update of whether it fixes that or not.
Hi again @mikehardy :)
I've updated all my firebase packages to 19.1.2 (all updated project files are attached at the end of this msg):
"@react-native-firebase/analytics": "19.1.2",
"@react-native-firebase/app": "19.1.2",
"@react-native-firebase/in-app-messaging": "19.1.2",
"@react-native-firebase/messaging": "19.1.2",
"@react-native-firebase/perf": "19.1.2",
"@react-native-firebase/remote-config": "19.1.2",
I'm not using Firebase Dynamic Link. I'm just trying to open https://www.google.com/:
I'm not using an emulator. I'm running the app on my physical iPhone plugged in to a macbook and the app is running from Xcode.
I checked the xCode log (attached the whole log below) but the only mention to In-App Messaging is that it was successfully received:
10.23.1 - [FirebaseInAppMessaging][I-IAM900008] A test message with id 523423414 was parsed successfully.
#### `Xcode log`:
```
10.23.1 - [FirebaseAnalytics][I-ACS023007] Analytics v.10.23.1 started
10.23.1 - [FirebaseAnalytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
10.23.1 - [FirebaseAnalytics][I-ACS044002] The AdSupport Framework is not currently linked. Some features will not function properly. Learn more at http://goo.gl/9vSsPb
10.23.1 - [GoogleUtilities/MethodSwizzler][I-SWZ002000] Swizzling class: UIViewController SEL:originalIMPOfCurrentIMP: after it has been previously been swizzled.
10.23.1 - [GoogleUtilities/MethodSwizzler][I-SWZ002000] Swizzling class: UIViewController SEL:originalIMPOfCurrentIMP: after it has been previously been swizzled.
10.23.1 - [FirebaseAnalytics][I-ACS800023] No pending snapshot to activate. SDK name: app_measurement
10.23.1 - [FirebaseMessaging][I-FCM001000] FIRMessaging Remote Notifications proxy enabled, will swizzle remote notification receiver handlers. If you'd prefer to manually integrate Firebase Messaging, add "FirebaseAppDelegateProxyEnabled" to your Info.plist, and set it to NO. Follow the instructions at:
https://firebase.google.com/docs/cloud-messaging/ios/client#method_swizzling_in_firebase_messaging
to ensure proper integration.
[RNCallKeep][setup] options = {
appName = --;
maximumCallGroups = 1;
maximumCallsPerCallGroup = 1;
supportsVideo = 1;
}
[RNCallKeep][setSettings] options = {
appName = --;
maximumCallGroups = 1;
maximumCallsPerCallGroup = 1;
supportsVideo = 1;
}
[RNCallKeep][getProviderConfiguration]
[RNVoipPushNotificationManager] voipRegistration enter
Connection 1: received failure notification
Connection 1: failed to connect 1:50, reason -1
Connection 1: encountered error(1:50)
Task
#### `package.json`: ```json { "name": "myAppName", "version": "0.0.1", "engines": { "node": "18.18.0" }, "private": true, "scripts": { ... }, "dependencies": { "@contentful/rich-text-react-renderer": "15.19.4", "@contentful/rich-text-types": "16.3.4", "@notifee/react-native": "7.8.2", "@react-native-async-storage/async-storage": "1.21.0", "@react-native-community/blur": "4.4.0", "@react-native-community/netinfo": "11.2.1", "@react-native-firebase/analytics": "19.1.2", "@react-native-firebase/app": "19.1.2", "@react-native-firebase/in-app-messaging": "19.1.2", "@react-native-firebase/messaging": "19.1.2", "@react-native-firebase/perf": "19.1.2", "@react-native-firebase/remote-config": "19.1.2", "@react-native-picker/picker": "2.6.1", "@react-native/metro-config": "0.74.0", "@react-navigation/bottom-tabs": "6.5.11", "@react-navigation/elements": "1.3.21", "@react-navigation/native": "6.1.9", "@react-navigation/stack": "6.3.20", "@sayem314/react-native-keep-awake": "1.2.2", "@sentry/react-native": "5.18.0", "@stripe/stripe-react-native": "0.36.0", "axios": "0.24.0", "color": "4.2.3", "contentful": "10.6.21", "country-telephone-data": "0.6.3", "formik": "2.4.5", "i18n-iso-countries": "7.9.0", "i18next": "23.8.2", "libphonenumber-js": "1.10.55", "moment": "2.30.1", "react": "18.2.0", "react-content-loader": "6.2.1", "react-i18next": "14.0.3", "react-native": "0.73.2", "react-native-app-auth": "7.1.0", "react-native-callkeep": "4.3.7", "react-native-collapsible": "1.6.1", "react-native-color-matrix-image-filters": "6.0.7", "react-native-create-thumbnail": "2.0.0", "react-native-date-picker": "4.3.5", "react-native-device-info": "10.12.0", "react-native-fast-image": "8.6.3", "react-native-gesture-handler": "2.14.1", "react-native-image-crop-picker": "0.40.2", "react-native-image-viewing": "0.2.2", "react-native-inappbrowser-reborn": "3.7.0", "react-native-keyboard-aware-scroll-view": "0.9.5", "react-native-keychain": "8.1.2", "react-native-linear-gradient": "2.8.3", "react-native-localize": "3.0.6", "react-native-modal": "13.0.1", "react-native-permissions": "4.1.1", "react-native-rate": "1.2.12", "react-native-safe-area-context": "4.9.0", "react-native-screens": "3.29.0", "react-native-share": "10.0.2", "react-native-splash-screen": "3.3.0", "react-native-svg": "14.1.0", "react-native-twilio-video-webrtc": "3.2.0", "react-native-video": "6.0.0-beta.5", "react-native-voip-push-notification": "3.3.1", "react-native-webview": "13.7.0", "swr": "2.2.4", "upgrade": "1.1.0", "yup": "1.3.3" }, "devDependencies": { "@babel/core": "7.23.9", "@babel/plugin-syntax-flow": "7.23.3", "@babel/plugin-transform-react-jsx": "7.23.4", "@babel/preset-env": "7.23.9", "@babel/preset-typescript": "7.23.3", "@babel/runtime": "7.23.9", "@jest/create-cache-key-function": "29.7.0", "@react-native/babel-preset": "0.73.20", "@react-native/eslint-config": "0.74.0", "@react-native/typescript-config": "0.74.0", "@testing-library/jest-native": "5.4.3", "@testing-library/react-hooks": "8.0.1", "@testing-library/react-native": "12.4.3", "@types/color": "3.0.6", "@types/country-telephone-data": "0.6.3", "@types/jest": "29.5.11", "@types/node": "18.16.3", "@types/react": "18.2.20", "@types/react-dom": "18.2.17", "@types/react-native-share": "3.3.8", "@types/react-native-video": "5.0.19", "@types/react-test-renderer": "18.0.7", "@typescript-eslint/eslint-plugin": "6.20.0", "@typescript-eslint/parser": "6.20.0", "eslint": "8.56.0", "eslint-config-airbnb": "19.0.4", "eslint-config-airbnb-typescript": "17.1.0", "eslint-config-prettier": "9.1.0", "eslint-plugin-ft-flow": "3.0.4-alpha-0", "eslint-plugin-import": "2.29.1", "eslint-plugin-jest": "27.6.3", "eslint-plugin-jsx-a11y": "6.8.0", "eslint-plugin-prettier": "5.1.3", "eslint-plugin-react": "7.33.2", "eslint-plugin-react-hooks": "4.6.0", "eslint-plugin-react-native": "4.1.0", "eslint-plugin-testing-library": "6.2.0", "husky": "9.0.10", "jest": "29.7.0", "knip": "4.3.1", "lint-staged": "15.2.1", "patch-package": "8.0.0", "postinstall-postinstall": "2.1.0", "prettier": "3.2.5", "react-native-svg-transformer": "1.3.0", "react-test-renderer": "18.2.0", "ts-jest": "29.1.2", "typescript": "5.3.3" }, "lint-staged": { "{src,test}/**/*.{ts,tsx,js,jsx}": [ "eslint --cache", "prettier --write --cache" ] }, } ``` #### `firebase.json` for react-native-firebase v6: ```json # N/A ```
#### `ios/Podfile`:
- [ ] I'm not using Pods
- [x] I'm using Pods and my Podfile looks like:
```ruby
source 'https://cdn.cocoapods.org/'
# -- Setup required by react-native-permissions 4.0.0
# Slightly changed from what React Native suggests
def node_require(script)
# Resolve script with node to allow for hoisting
require Pod::Executable.execute_command('node', ['-p',
"require.resolve(
'#{script}',
{paths: [process.argv[1]]},
)", __dir__]).strip
end
node_require('react-native/scripts/react_native_pods.rb')
node_require('react-native-permissions/scripts/setup.rb')
# -- End of setup required by react-native-permissions 4.0.0
# Sets the minimum version of supported iOS devices to 13.4
platform :ios, '13.4'
prepare_react_native_project!
# ⬇️ uncomment wanted permissions
setup_permissions([
# 'AppTrackingTransparency',
# 'Bluetooth',
# 'Calendars',
# 'CalendarsWriteOnly',
'Camera',
# 'Contacts',
# 'FaceID',
# 'LocationAccuracy',
# 'LocationAlways',
# 'LocationWhenInUse',
# 'MediaLibrary',
'Microphone',
# 'Motion',
'Notifications',
# 'PhotoLibrary',
# 'PhotoLibraryAddOnly',
# 'Reminders',
# 'Siri',
# 'SpeechRecognition',
# 'StoreKit',
])
# ignores all warnings from all pods
# We do this as we cannot fix warnings from 3rd party libraries
inhibit_all_warnings!
$RNFirebaseAnalyticsWithoutAdIdSupport = true
# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
# because `react-native-flipper` depends on (FlipperKit,...) that will be excluded
#
# To fix this you can also exclude `react-native-flipper` using a `react-native.config.js`
# ```js
# module.exports = {
# dependencies: {
# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
# ```
flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled
linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
use_frameworks! :linkage => linkage.to_sym
end
abstract_target 'Common' do
# From RN setup guide
config = use_native_modules!
use_react_native!(
path: config[:reactNativePath],
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
# To update Flipper version, check what the latest iOS/Cocoapods version is here: https://github.com/facebook/flipper (small image with iOS version, not necessarily the same version as the NPM package)
# :flipper_configuration => FlipperConfiguration.enabled(["Debug"], { 'Flipper' => '0.203.0' }),
# An absolute path to your application root.
app_path: "#{Pod::Config.instance.installation_root}/.."
)
# Needed for Firebase to work
pod 'Firebase', modular_headers: true
pod 'FirebaseCore', modular_headers: true
pod 'FirebaseCoreExtension', modular_headers: true
pod 'FirebaseInstallations', modular_headers: true
pod 'FirebaseABTesting', modular_headers: true
pod 'GoogleUtilities', modular_headers: true
pod 'GoogleDataTransport', modular_headers: true
pod 'nanopb', modular_headers: true
$RNFirebaseAsStaticFramework = true
# From RN setup guide
target 'myAppName.production' do
use_native_modules!
end
target 'myAppName.staging' do
use_native_modules!
end
post_install do |installer|
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
react_native_post_install(
installer,
config[:reactNativePath],
:mac_catalyst_enabled => false
)
end
end
```
#### `AppDelegate.m`:
```objc
#import
**`react-native info` output:** ``` System: OS: macOS 14.2 CPU: (8) arm64 Apple M1 Pro Memory: 117.98 MB / 16.00 GB Shell: version: "5.9" path: /bin/zsh Binaries: Node: version: 18.18.0 path: /var/folders/_v/vbctvgnj2kqcmztn7kshm35m0000gn/T/yarn--1712238645213-0.9290557829262842/node Yarn: version: 1.22.21 path: /var/folders/_v/vbctvgnj2kqcmztn7kshm35m0000gn/T/yarn--1712238645213-0.9290557829262842/yarn npm: version: 9.8.1 path: /usr/local/bin/npm Watchman: Not Found Managers: CocoaPods: Not Found SDKs: iOS SDK: Platforms: - DriverKit 23.2 - iOS 17.2 - macOS 14.2 - tvOS 17.2 - visionOS 1.0 - watchOS 10.2 Android SDK: Not Found IDEs: Android Studio: 2023.1 AI-231.9392.1.2311.11330709 Xcode: version: 15.2/15C500b path: /usr/bin/xcodebuild Languages: Java: version: 17.0.9 path: /usr/bin/javac Ruby: version: 2.6.10 path: /usr/bin/ruby npmPackages: "@react-native-community/cli": Not Found react: installed: 18.2.0 wanted: 18.2.0 react-native: installed: 0.73.2 wanted: 0.73.2 react-native-macos: Not Found npmGlobalPackages: "*react-native*": Not Found Android: hermesEnabled: true newArchEnabled: false iOS: hermesEnabled: true newArchEnabled: false ``` - **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:** - 18.8.0 - **`Firebase` module(s) you're using that has the issue:** "@react-native-firebase/analytics": "19.1.2", "@react-native-firebase/app": "19.1.2", "@react-native-firebase/in-app-messaging": "19.1.2", "@react-native-firebase/messaging": "19.1.2", "@react-native-firebase/perf": "19.1.2", "@react-native-firebase/remote-config": "19.1.2", - **Are you using `TypeScript`?** - Yes: typescript@5.3.3
React Native Firebase
and Invertase
on Twitter for updates on the library.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 attention?
This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.
same issue exists for me is there any onClickListener for inAppMessaging? can we handle url in the app ?
same issue exists for me is there any onClickListener for inAppMessaging? can we handle url in the app ?
You can handle this way
React.useEffect(() => {
const listener = Linking.addEventListener('url', (params: any) => {
console.log('Linking : ', params.url);
});
return () => {
listener.remove();
};
}, []);
Issue
I create an in-app messaging of type Modal and add a Firebase Dynamic Link (for the link: https://www.google.com/) in the "Button action" field:
On iOS, when I click on the action button, it just closes the Modal and no action is taken. It doesn't open https://www.google.com/ in the browser as it should. It works perfectly on Android.
I'm using the same version for all react-native-firebase packages:
I've tried Firebase Dynamic Links and normal links. None works on iOS but all work on Android.
I've also tried to 'whitelist' domains in Info.plist, but it still doesn't work:
Project Files
Javascript
Click To Expand
#### `package.json`: ```json { "name": "my-app", "version": "0.0.1", "engines": { "node": "18.18.0" }, "private": true, "scripts": { ... }, "dependencies": { "@contentful/rich-text-react-renderer": "15.19.4", "@contentful/rich-text-types": "16.3.4", "@notifee/react-native": "7.8.2", "@react-native-async-storage/async-storage": "1.21.0", "@react-native-community/blur": "4.4.0", "@react-native-community/netinfo": "11.2.1", "@react-native-firebase/analytics": "18.8.0", "@react-native-firebase/app": "18.8.0", "@react-native-firebase/dynamic-links": "18.8.0", "@react-native-firebase/in-app-messaging": "18.8.0", "@react-native-firebase/messaging": "18.8.0", "@react-native-firebase/perf": "18.8.0", "@react-native-firebase/remote-config": "18.8.0", "@react-native-picker/picker": "2.6.1", "@react-native/metro-config": "0.74.0", "@react-navigation/bottom-tabs": "6.5.11", "@react-navigation/elements": "1.3.21", "@react-navigation/native": "6.1.9", "@react-navigation/stack": "6.3.20", "@sayem314/react-native-keep-awake": "1.2.2", "@sentry/react-native": "5.18.0", "@stripe/stripe-react-native": "0.36.0", "axios": "0.24.0", "color": "4.2.3", "contentful": "10.6.21", "country-telephone-data": "0.6.3", "formik": "2.4.5", "i18n-iso-countries": "7.9.0", "i18next": "23.8.2", "libphonenumber-js": "1.10.55", "moment": "2.30.1", "react": "18.2.0", "react-content-loader": "6.2.1", "react-i18next": "14.0.3", "react-native": "0.73.2", "react-native-app-auth": "7.1.0", "react-native-bootsplash": "^5.4.1", "react-native-callkeep": "4.3.7", "react-native-collapsible": "1.6.1", "react-native-color-matrix-image-filters": "6.0.7", "react-native-create-thumbnail": "2.0.0", "react-native-date-picker": "4.3.5", "react-native-device-info": "10.12.0", "react-native-fast-image": "8.6.3", "react-native-gesture-handler": "2.14.1", "react-native-image-crop-picker": "0.40.2", "react-native-image-viewing": "0.2.2", "react-native-inappbrowser-reborn": "3.7.0", "react-native-keyboard-aware-scroll-view": "0.9.5", "react-native-keychain": "8.1.2", "react-native-linear-gradient": "2.8.3", "react-native-localize": "3.0.6", "react-native-modal": "13.0.1", "react-native-permissions": "4.1.1", "react-native-qrcode-svg": "6.3.0", "react-native-rate": "1.2.12", "react-native-safe-area-context": "4.9.0", "react-native-screens": "3.29.0", "react-native-share": "10.0.2", "react-native-svg": "14.1.0", "react-native-twilio-video-webrtc": "3.2.0", "react-native-video": "6.0.0-beta.5", "react-native-voip-push-notification": "3.3.1", "react-native-webview": "13.7.0", "swr": "2.2.4", "upgrade": "1.1.0", "yup": "1.3.3" }, "devDependencies": { "@babel/core": "7.23.9", "@babel/plugin-syntax-flow": "7.23.3", "@babel/plugin-transform-react-jsx": "7.23.4", "@babel/preset-env": "7.23.9", "@babel/preset-typescript": "7.23.3", "@babel/runtime": "7.23.9", "@jest/create-cache-key-function": "29.7.0", "@react-native/babel-preset": "0.73.20", "@react-native/eslint-config": "0.74.0", "@react-native/typescript-config": "0.74.0", "@testing-library/jest-native": "5.4.3", "@testing-library/react-hooks": "8.0.1", "@testing-library/react-native": "12.4.3", "@types/color": "3.0.6", "@types/country-telephone-data": "0.6.3", "@types/jest": "29.5.11", "@types/node": "18.16.3", "@types/react": "18.2.20", "@types/react-dom": "18.2.17", "@types/react-native-share": "3.3.8", "@types/react-native-video": "5.0.19", "@types/react-test-renderer": "18.0.7", "@typescript-eslint/eslint-plugin": "6.20.0", "@typescript-eslint/parser": "6.20.0", "eslint": "8.56.0", "eslint-config-airbnb": "19.0.4", "eslint-config-airbnb-typescript": "17.1.0", "eslint-config-prettier": "9.1.0", "eslint-plugin-ft-flow": "3.0.4-alpha-0", "eslint-plugin-import": "2.29.1", "eslint-plugin-jest": "27.6.3", "eslint-plugin-jsx-a11y": "6.8.0", "eslint-plugin-prettier": "5.1.3", "eslint-plugin-react": "7.33.2", "eslint-plugin-react-hooks": "4.6.0", "eslint-plugin-react-native": "4.1.0", "eslint-plugin-testing-library": "6.2.0", "husky": "9.0.10", "jest": "29.7.0", "knip": "4.3.1", "lint-staged": "15.2.1", "patch-package": "8.0.0", "postinstall-postinstall": "2.1.0", "prettier": "3.2.5", "react-native-svg-transformer": "1.3.0", "react-test-renderer": "18.2.0", "ts-jest": "29.1.2", "typescript": "5.3.3" }, "lint-staged": { "{src,test}/**/*.{ts,tsx,js,jsx}": [ "eslint --cache", "prettier --write --cache" ] }, } ``` #### `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 source 'https://cdn.cocoapods.org/' # -- Setup required by react-native-permissions 4.0.0 # Slightly changed from what React Native suggests def node_require(script) # Resolve script with node to allow for hoisting require Pod::Executable.execute_command('node', ['-p', "require.resolve( '#{script}', {paths: [process.argv[1]]}, )", __dir__]).strip end node_require('react-native/scripts/react_native_pods.rb') node_require('react-native-permissions/scripts/setup.rb') # -- End of setup required by react-native-permissions 4.0.0 # Sets the minimum version of supported iOS devices to 13.4 platform :ios, '13.4' prepare_react_native_project! # ⬇️ uncomment wanted permissions setup_permissions([ # 'AppTrackingTransparency', # 'Bluetooth', # 'Calendars', # 'CalendarsWriteOnly', 'Camera', # 'Contacts', # 'FaceID', # 'LocationAccuracy', # 'LocationAlways', # 'LocationWhenInUse', # 'MediaLibrary', 'Microphone', # 'Motion', 'Notifications', # 'PhotoLibrary', # 'PhotoLibraryAddOnly', # 'Reminders', # 'Siri', # 'SpeechRecognition', # 'StoreKit', ]) # ignores all warnings from all pods # We do this as we cannot fix warnings from 3rd party libraries inhibit_all_warnings! $RNFirebaseAnalyticsWithoutAdIdSupport = true # If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set. # because `react-native-flipper` depends on (FlipperKit,...) that will be excluded # # To fix this you can also exclude `react-native-flipper` using a `react-native.config.js` # ```js # module.exports = { # dependencies: { # ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}), # ``` flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled linkage = ENV['USE_FRAMEWORKS'] if linkage != nil Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green use_frameworks! :linkage => linkage.to_sym end abstract_target 'Common' do # From RN setup guide config = use_native_modules! # From RN setup guide use_react_native!( path: config[:reactNativePath], # Enables Flipper. # # Note that if you have use_frameworks! enabled, Flipper will not work and # you should disable the next line. # To update Flipper version, check what the latest iOS/Cocoapods version is here: https://github.com/facebook/flipper (small image with iOS version, not necessarily the same version as the NPM package) # :flipper_configuration => FlipperConfiguration.enabled(["Debug"], { 'Flipper' => '0.203.0' }), # An absolute path to your application root. app_path: "#{Pod::Config.instance.installation_root}/.." ) # Needed for Firebase to work pod 'Firebase', modular_headers: true pod 'FirebaseCore', modular_headers: true pod 'FirebaseCoreExtension', modular_headers: true pod 'FirebaseInstallations', modular_headers: true pod 'FirebaseABTesting', modular_headers: true pod 'GoogleUtilities', modular_headers: true pod 'GoogleDataTransport', modular_headers: true pod 'nanopb', modular_headers: true $RNFirebaseAsStaticFramework = true # From RN setup guide target '--.production' do use_native_modules! end target '--.staging' do use_native_modules! end post_install do |installer| # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202 react_native_post_install( installer, config[:reactNativePath], :mac_catalyst_enabled => false ) end end ``` #### `AppDelegate.m`: ```objc #import
#import "AppDelegate.h"
#import
#import "RNAppAuthAuthorizationFlowManager.h"
#import
#import
#import "RNVoipPushNotificationManager.h"
#import
#import "RNBootSplash.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
options:(NSDictionary *)options
{
if ([self.authorizationFlowManagerDelegate resumeExternalUserAgentFlowWithURL:url]) {
return YES;
}
return [RCTLinkingManager application:application openURL:url options:options];
}
- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity
restorationHandler:(nonnull void (^)(NSArray> * _Nullable))restorationHandler
{
if ([userActivity.activityType isEqualToString:NSUserActivityTypeBrowsingWeb]) {
if (self.authorizationFlowManagerDelegate) {
BOOL resumableAuth = [self.authorizationFlowManagerDelegate resumeExternalUserAgentFlowWithURL:userActivity.webpageURL];
if (resumableAuth) {
return YES;
}
}
}
return [RCTLinkingManager application:application
continueUserActivity:userActivity
restorationHandler:restorationHandler];
}
- (void)pushRegistry:(PKPushRegistry *)registry didUpdatePushCredentials:(PKPushCredentials *)credentials forType:(PKPushType)type {
[RNVoipPushNotificationManager didUpdatePushCredentials:credentials forType:(NSString *)type];
}
- (void)pushRegistry:(PKPushRegistry *)registry didInvalidatePushTokenForType:(PKPushType)type
{
}
- (void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload forType:(PKPushType)type withCompletionHandler:(void (^)(void))completion {
[RNVoipPushNotificationManager didReceiveIncomingPushWithPayload:payload forType:(NSString *)type];
NSString *uuid = [payload.dictionaryPayload valueForKeyPath:@"data.id"];
NSString *callerName = [payload.dictionaryPayload valueForKeyPath:@"aps.alert.body"];
NSString *handle = @"caller number here";
BOOL hasVideo = [[payload.dictionaryPayload valueForKeyPath:@"data.hasVideo"] isEqualToNumber:[NSNumber numberWithInt:1]];
NSDictionary *extra = [payload.dictionaryPayload valueForKeyPath:@"data"];
[RNCallKeep reportNewIncomingCall: uuid
handle: handle
handleType: @"generic"
hasVideo: hasVideo
localizedCallerName: callerName
supportsHolding: NO
supportsDTMF: NO
supportsGrouping: NO
supportsUngrouping: NO
fromPushKit: YES
payload: extra
withCompletionHandler: completion];
dispatch_time_t delay = dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC * 60);
dispatch_after(delay, dispatch_get_main_queue(), ^(void){
int reasonId = 3;
if ([RNCallKeep isCallActive: uuid] == false) {
[RNCallKeep endCallWithUUID: uuid reason: reasonId];
}
});
completion();
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[FIRApp configure];
self.moduleName = @"--";
self.initialProps = @{};
[RNCallKeep setup:@{
@"appName": [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleName"],
@"maximumCallGroups": @1,
@"maximumCallsPerCallGroup": @1,
@"supportsVideo": @YES,
}];
[RNVoipPushNotificationManager voipRegistration];
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
return [self getBundleURL];
}
- (NSURL *)getBundleURL
{
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
#else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}
- (UIView *)createRootViewWithBridge:(RCTBridge *)bridge
moduleName:(NSString *)moduleName
initProps:(NSDictionary *)initProps {
UIView *rootView = [super createRootViewWithBridge:bridge
moduleName:moduleName
initProps:initProps];
[RNBootSplash initWithStoryboard:@"BootSplash" rootView:rootView];
return rootView;
}
@end
```
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`: ```groovy // N/A ``` #### `android/app/build.gradle`: ```groovy // N/A ``` #### `android/settings.gradle`: ```groovy // N/A ``` #### `MainApplication.java`: ```java // N/A ``` #### `AndroidManifest.xml`: ```xml ```
Environment
Click To Expand
**`react-native info` output:** ``` (node:19463) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency (Use `node --trace-warnings ...` to show where the warning was created) System: OS: macOS 14.2 CPU: (8) arm64 Apple M1 Pro Memory: 94.03 MB / 16.00 GB Shell: version: "5.9" path: /bin/zsh Binaries: Node: version: 18.18.0 path: /usr/local/bin/node Yarn: version: 1.22.21 path: /opt/homebrew/bin/yarn npm: version: 9.8.1 path: /usr/local/bin/npm Watchman: Not Found Managers: CocoaPods: Not Found SDKs: iOS SDK: Platforms: - DriverKit 23.2 - iOS 17.2 - macOS 14.2 - tvOS 17.2 - visionOS 1.0 - watchOS 10.2 Android SDK: Not Found IDEs: Android Studio: 2023.1 AI-231.9392.1.2311.11330709 Xcode: version: 15.2/15C500b path: /usr/bin/xcodebuild Languages: Java: version: 17.0.9 path: /usr/bin/javac Ruby: version: 2.6.10 path: /usr/bin/ruby npmPackages: "@react-native-community/cli": Not Found react: installed: 18.2.0 wanted: 18.2.0 react-native: installed: 0.73.2 wanted: 0.73.2 react-native-macos: Not Found npmGlobalPackages: "*react-native*": Not Found Android: hermesEnabled: true newArchEnabled: false iOS: hermesEnabled: true newArchEnabled: false ``` - **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:** - 18.8.0 - **`Firebase` module(s) you're using that has the issue:** "@react-native-firebase/analytics": "18.8.0", "@react-native-firebase/app": "18.8.0", "@react-native-firebase/dynamic-links": "18.8.0", ==> "@react-native-firebase/in-app-messaging": "18.8.0", <== "@react-native-firebase/messaging": "18.8.0", "@react-native-firebase/perf": "18.8.0", "@react-native-firebase/remote-config": "18.8.0", - **Are you using `TypeScript`?** - Yes: typescript@5.3.3
React Native Firebase
andInvertase
on Twitter for updates on the library.