I have a problem in configuration for push notification on iOS, I had added the service list to the project in Xcode, and added the Firebase SDK to the project, and configured the APNS from the developer website.
the project build successfully on Xcode but the app doesn’t start on the simulater from the Xcode or from vs code terminal.
when I try to run (npx react-native run-ios) I got the following error
error Failed to build iOS project. “xcodebuild” exited with error code ’65’. To debug build logs further, consider building your app with Xcode.app, by opening ‘mag11.xcworkspace’.
Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace mag.xcworkspace -configuration Debug -scheme mag -destination id=92D5357D-9552-4709-9C26-AB2372F45C7D
/FirebaseCoreInternal/FirebaseCoreInternal.modulemap’ not found
1 error generated.
I have added the dependency
“@react-native-community/push-notification-ios”: “^1.11.0”,
“@react-native-firebase/app”: “^20.0.0”,
“@react-native-firebase/messaging”: “^20.0.0”,
**here is my AppDelegate.m
**
#import "AppDelegate.h"
#import <Firebase.h>
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <UserNotifications/UserNotifications.h>
#import <RNCPushNotificationIOS.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
if ([FIRApp defaultApp] == nil) {
[FIRApp configure];
}
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
moduleName:@"mag"
initialProperties:nil];
rootView.backgroundColor = [UIColor whiteColor];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [UIViewController new];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
return YES;
}
@end
**here is my podFile
**
# Resolve react_native_pods.rb with node to allow for hoisting
require Pod::Executable.execute_command('node', ['-p',
'require.resolve(
"react-native/scripts/react_native_pods.rb",
{paths: [process.argv[1]]},
)', __dir__]).strip
platform :ios, min_ios_version_supported
prepare_react_native_project!
linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
use_frameworks! :linkage => :static
$RNFirebaseAsStaticFramework = true
end
target 'mag' do
config = use_native_modules!
# Flags change depending on the env values.
flags = get_default_flags()
# use_frameworks! :linkage => :static
pod 'FirebaseMessaging'
pod 'FirebaseCore', :modular_headers => true
pod 'FirebaseCoreInternal', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true
use_react_native!(
:path => config[:reactNativePath],
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
target 'magTests' do
inherit! :complete
# Pods for testing
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,
# :ccache_enabled => true
)
end
end
I had build and recreate the pod multiple time with no luck.
I had added the service list to the project in Xcode, and added the Firebase SDK to the project, and configured the APNS from the developer website.
I added the push notification, backend mode to the cabapilities
I have added the dependency
“@react-native-community/push-notification-ios”: “^1.11.0”,
“@react-native-firebase/app”: “^20.0.0”,
“@react-native-firebase/messaging”: “^20.0.0”,
I had build and recreate the pod multiple time with no luck.
Amr Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.