I am using custom authentication in an app so it's not set to use firebase auth, now I used a custom function to initialize the flutter local notifications and it works fine on android, receiving the notifications properly but on IOS the app would just not start and keep showing a blank screen with the following errors
11.4.0 - [FirebaseCore][I-COR000005] No app has been configured yet. 11.4.0 - [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. no valid “aps-environment” entitlement string found for application no valid “aps-environment” entitlement string found for application 11.4.0 - [FirebaseMessaging][I-FCM012002] Error in application:didFailToRegisterForRemoteNotificationsWithError: no valid “aps-environment” entitlement string found for application Syncing files to device iPhone 15 Pro Max... [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Invalid argument(s): iOS settings must be set when targeting iOS platform. #0 FlutterLocalNotificationsPlugin.initialize (package:flutter_local_notifications/src/flutter_local_notifications_plugin.dart:134:9) #1 initializeNotifications (package:rdaid/custom_code/actions/initialize_notifications.dart:38:10) #2 main (package:rdaid/main.dart:34:17) <asynchronous suspension>
this is my custom code for initialize notifications
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
Future initializeNotifications() async {
// Check if the plugin is already initialized
FlutterLocalNotificationsPlugin? flutterLocalNotificationsPlugin;
FFAppState().update(() {
FFAppState().flutterLocalNotificationInstance =
flutterLocalNotificationsPlugin;
});
if (FFAppState().flutterLocalNotificationInstance == null) {
FFAppState().flutterLocalNotificationInstance =
FlutterLocalNotificationsPlugin();
// Configure Android initialization settings
var initializationSettingsAndroid =
AndroidInitializationSettings('@mipmap/ic_launcher');
// Combine all initialization settings
var initializationSettings =
InitializationSettings(android: initializationSettingsAndroid);
// Initialize the plugin
await FFAppState()
.flutterLocalNotificationInstance!
.initialize(initializationSettings);
}
}
Yes I am using an app state to store the localNotification instance because I need to use it in another action and I did not find any other way and it works fine on android, but can't figure out what to do on IOS