infobip / mobile-messaging-flutter-plugin

Mobile Messaging SDK plugin for Flutter projects
Other
9 stars 6 forks source link

Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value #18

Open HashirBM opened 3 months ago

HashirBM commented 3 months ago

Hi, I am trying to run the chatbot on iOS, it is working fine when app is in debug mode. but failed on release mode. when i click on chat button on screen it stuck and print this error

Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value

and pointing here

if currentInstall.isPushRegistrationEnabled && internalData().currentDepersonalizationStatus == .undefined { messageHandler.start({ _ in }). //here }

this is at startComponents of MobileMessaging.

these are the logs :

SDK successfully initialized! 2024-07-30 10:43:21:813 [MobileMessaging] 🛠 [MMCoreDataStorage] Adding persistent store at file:///Users/hashir/Library/Developer/CoreSimulator/Devices/96B587A7-A0FE-4262-BC0E-524024B8A7F0/data/Containers/Data/Application/AB69D83C-BA70-45C9-80D3-BFBF31EAD3B8/Library/Application%20Support/com.mobile-messaging.database/MessageStorage.sqlite 2024-07-30 10:43:21:822 [MobileMessaging] 🛠 [MMCoreDataStorage] Persistent store added successfully 2024-07-30 10:43:21:822 [MobileMessaging] ℹ️ [MobileMessaging] Stopping MobileMessaging service... 2024-07-30 10:43:21:830 [MobileMessaging] ℹ️ [MobileMessaging] MobileMessaging service stopped 2024-07-30 10:43:21:830 [MobileMessaging] 🛠 [MobileMessaging] Starting service (with apns registration disabled=false, apns unregistering disabled=false, notification center delegate disabled=false)... 2024-07-30 10:43:21:830 [MobileMessaging] 💬 Unarchived Optional(<MobileMessaging.InternalData: 0x6000029287e0>) from /Users/hashir/Library/Developer/CoreSimulator/Devices/96B587A7-A0FE-4262-BC0E-524024B8A7F0/data/Containers/Data/Application/AB69D83C-BA70-45C9-80D3-BFBF31EAD3B8/Library/Application Support/com.mobile-messaging.internal-data 2024-07-30 10:43:21:830 [MobileMessaging] 💬 Setting cached value <NSThread: 0x6000017520c0>{number = 49, name = (null)} <MobileMessaging.InternalData: 0x6000029287e0> /Users/hashir/Library/Developer/CoreSimulator/Devices/96B587A7-A0FE-4262-BC0E-524024B8A7F0/data/Containers/Data/Application/AB69D83C-BA70-45C9-80D3-BFBF31EAD3B8/Library/Application Support/com.mobile-messaging.internal-data 2024-07-30 10:43:21:833 [MobileMessaging] 💬 Using cached value <NSThread: 0x6000017520c0>{number = 49, name = (null)} /Users/hashir/Library/Developer/CoreSimulator/Devices/96B587A7-A0FE-4262-BC0E-524024B8A7F0/data/Containers/Data/Application/AB69D83C-BA70-45C9-80D3-BFBF31EAD3B8/Library/Application Support/com.mobile-messaging.internal-data 2024-07-30 10:43:21:833 [MobileMessaging] 💬 Setting cached value <NSThread: 0x6000017520c0>{number = 49, name = (null)} /Users/hashir/Library/Developer/CoreSimulator/Devices/96B587A7-A0FE-4262-BC0E-524024B8A7F0/data/Containers/Data/Application/AB69D83C-BA70-45C9-80D3-BFBF31EAD3B8/Library/Application Support/com.mobile-messaging.internal-data 2024-07-30 10:43:21:833 [MobileMessaging] 💬 Archiving <NSThread: 0x6000017520c0>{number = 49, name = (null)} at /Users/hashir/Library/Developer/CoreSimulator/Devices/96B587A7-A0FE-4262-BC0E-524024B8A7F0/data/Containers/Data/Application/AB69D83C-BA70-45C9-80D3-BFBF31EAD3B8/Library/Application Support/com.mobile-messaging.internal-data 2024-07-30 10:43:21:835 [MobileMessaging] 💬 Unarchived Optional(<MobileMessaging.MMInstallation: 0x10350fa10>) from /Users/hashir/Library/Developer/CoreSimulator/Devices/96B587A7-A0FE-4262-BC0E-524024B8A7F0/data/Containers/Data/Application/AB69D83C-BA70-45C9-80D3-BFBF31EAD3B8/Library/Application Support/com.mobile-messaging.installation 2024-07-30 10:43:21:835 [MobileMessaging] 💬 Setting cached value <NSThread: 0x6000017520c0>{number = 49, name = (null)} <MobileMessaging.MMInstallation: 0x10350fa10> /Users/hashir/Library/Developer/CoreSimulator/Devices/96B587A7-A0FE-4262-BC0E-524024B8A7F0/data/Containers/Data/Application/AB69D83C-BA70-45C9-80D3-BFBF31EAD3B8/Library/Application Support/com.mobile-messaging.installation 2024-07-30 10:43:21:835 [MobileMessaging] 💬 Using cached value <NSThread: 0x6000017520c0>{number = 49, name = (null)} /Users/hashir/Library/Developer/CoreSimulator/Devices/96B587A7-A0FE-4262-BC0E-524024B8A7F0/data/Containers/Data/Application/AB69D83C-BA70-45C9-80D3-BFBF31EAD3B8/Library/Application Support/com.mobile-messaging.internal-data MobileMessaging/MobileMessaging.swift:761: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value

i am using latest version of, infobip_mobilemessaging: ^6.1.1

Looking forward to your response.

Regards,

riskpp commented 3 months ago

Hello @HashirBM, could you please provide the full code of how you are calling the InfobipMobilemessagingFlutterPlugin.init. Have you changed the configuration provided in this method?