Post

Replies

Boosts

Views

Activity

Unexpected behavior when iPad is unlock and the application goes to Foreground. something happens and the application goes to background and foreground in a small period of time.
I have the our device connected , with Assistive Touch enabled and the application running in the foreground. At this point, I place the screen on standby and leave the device unattended for 10 minutes. After this period, I return, unlock the screen, and observe that our app is still running, and the connection with the device is re-initiated. However, something occurs at this stage that causes the application to briefly switch to the background and then immediately return to the foreground. This behavior leads to system instability. Ideally, once the application is running in the foreground, it should not transition to the background automatically. However, it seems to be doing so for a short duration—momentarily switching from the foreground to the background, then back to the foreground—which is causing the observed instability. OK, the iPad screen is unlocked AND App Appears. 2024-10-01 13:15:55 LOG: APP > Scene did become active 2024-10-01 13:15:55 LOG: APP > Init device Suddenly the application goes to background by itself?!?!?! 2024-10-01 13:15:55 LOG: APP > Scene will change from Foreground to Background 2024-10-01 13:15:55 LOG: APP > Scene changed to Background 2024-10-01 13:15:56 LOG: APP > Scene Will Enter to Foreground 2024-10-01 13:15:56 LOG: APP > Nib Name previous load : Home Other example OK, the iPad screen is unlocked AND App Appears. 2024-10-01 11:23:55 LOG: APP > Scene Will Enter to Foreground 2024-10-01 11:23:56 LOG: APP > Scene did become active 2024-10-01 11:23:56 LOG: APP > Init connection Suddenly the application goes to background by itself?!?!?! 2024-10-01 11:23:56 LOG: APP > Scene will change from Foreground to Background 2024-10-01 11:23:56 LOG: APP > Scene changed to Background 2024-10-01 11:23:56 LOG: APP > Scene Will Enter to Foreground 2024-10-01 11:23:56 LOG: APP > Scene did become active 2024-10-01 11:23:56 LOG: APP > Scene will change from Foreground to Background 2024-10-01 11:23:56 LOG: APP > Scene changed to Background 2024-10-01 11:23:56 LOG: APP > Scene Will Enter to Foreground 2024-10-01 11:23:56 LOG: APP > Nib Name previous load : Home FA FB15345245 this is happening under iPadOS18.1 beta5 and iPad12.9" 6th gen. Would you mind taking a look at this issue ?
2
0
329
Oct ’24
App running in background with External accessory background mode enabled doesn't receive sometimes the EAAccessoryDidConnect or the EAAccessoryDidDisconnect notification
Hi there! folks. Hope you are fine We want our two applications to listen to connection and disconnection notifications in the External accessory when we connect a device to USB These application are running in the background and we need to know when the device connects and disconnects from USB. In those cases, we have configured our apps to listen to local notifications as follows: EAAccessoryManager.shared().registerForLocalNotifications() NotificationCenter.default.addObserver(self, selector: #selector(didConnectAccessory(_:)), name: Notification.Name.EAAccessoryDidConnect, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(didDisconnectAccessory(_:)), name: Notification.Name.EAAccessoryDidDisconnect, object: nil) When the apps are running in foreground, everything works correctly. On the other hand, when the apps are running in the background mode and with the external accessory background mode enabled, the disconnection or connection event is not sent to the applications, causing them to not be able to initialize correctly. We attach traces of the two applications running in the background in a connection event through the USB. in The first application the Notification event is received correctly. In The second application the Notification event is NOT received correctly We would like to investigate with you what may be happening. We have opened a case in the feedback assistant (FB13800710) so you can investigate further. We open the case here so that other people can collaborate with us in depth. Thank you so much Looking forward to hearing from your side. All the best! LogsApplication
3
0
624
May ’24
EASession, EAAccessoryDelegate and [EASession dealloc] - 212 unable to close session for _accessory
Hi folks We are working with our MFI External Accessory device working with our own library. We are encountering problems reestablishing EASession after disconnect/connect event of our device when the app is running in background. Our app was working great until iOS 15.7. This is happening under iOS16.1/ iOS16.2 version. This is the behavior : the app goes into background. In that state, we disconnect our device and connect it again to the iPad and then the APP returns to foreground. When the app goes to foreground we are logging both disconnect and connect events (that's correct) but when our code reaches to EAAccessoryManager.shared().registerForLocalNotifications()         return EAAccessoryManager.shared().connectedAccessories Although our device are connected to the iPad and the HID is shown in the iPad, EAAccessoryManager.shared().connectedAccessories function most of the time returns empty or nil LOG: APP > Scene changed to Foreground 2022-12-20 17:14:35 LOG: APP > Scene changed to Foreground 2022-12-20 17:14:35.700475+0100 [APP][2737:448291] -[EAAccessoryManager _applicationWillEnterForeground:]: NSConcreteNotification 0x2828eff80 {name = UIApplicationWillEnterForegroundNotification; object = <UIApplication: 0x104204b40>} 2022-12-20 17:14:35.700553+0100 [APP][2737:448610] -[EAAccessoryManager _checkForConnectedAccessories:backgroundTaskIdentifier:] inBackground 0, identifier 0 2022-12-20 17:14:35.700674+0100 [APP][2737:448610] IAPAppConnectedAccessories: __eaClientHasCheckedForConnectedAccessories 1 -> 1 2022-12-20 17:14:35.701088+0100 [APP][2737:448610] IAPAppConnectedAccessories: IAPDHasLaunched 0, IAP2DHasLaunched 0 2022-12-20 17:14:35.916878+0100 [APP][2737:448291] initialConnectedAccessories count 0 2022-12-20 17:14:35.916961+0100 [APP][2737:448291] _connectedAccessories (1) 2022-12-20 17:14:35.917000+0100 [APP][2737:448291] Done attaching initialConnectedAccessories 2022-12-20 17:14:35.917511+0100 [APP][2737:448562] Connection 1: encountered error(1:53) 2022-12-20 17:14:35.917809+0100 [APP][2737:448291] CoreAccessories accessoryInfo for departure = {     ACCExternalAccessoryPPIDKey = 509e9916a9f04f77;     ACCExternalAccessoryPrimaryUUID = "FF13BA35-002A-4F44-94EB-F090E71AAB08";     ACCExternalAccessoryProtocolDetailsKey =     {         "com.irisbond.messages" =         {             ACCExternalAccessoryMatchAction = 1;             ACCExternalAccessoryProtocolEndpointUUID = "FF13BA35-002A-4F44-94EB-F090E71AAB08";             ACCExternalAccessoryProtocolIndex = 0;             ACCExternalAccessoryProtocolType = 0;             ACCExternalAccessorySessionUsesSocketInterfaceKey = 1;         };     };     ACCExternalAccessoryRegionCodeKey = "<null>";     IAPAppAccessoryCapabilitiesKey = 3;     IAPAppAccessoryDockTypeKey = "";     IAPAppAccessoryFirmwareRevisionKey = "1.1.21\n";     IAPAppAccessoryFirmwareRevisionPendingKey = "<null>";     IAPAppAccessoryHardwareRevisionKey = "1.0";     IAPAppAccessoryManufacturerKey = Irisbond;     IAPAppAccessoryModelNumberKey = Hiru;     IAPAppAccessoryNameKey = Hiru;     IAPAppAccessoryPreferredAppKey = 77H2H4F7F4;     IAPAppAccessoryProtocolsKey =     {         "com.irisbond.data" = 1;         "com.irisbond.messages" = 0;         "com.irisbond.updates" = 3;         "com.irisbond.video" = 2;     };     IAPAppAccessorySerialNumberKey = 1117;     IAPAppAccessoryTransportType = 8;     IAPAppAccessoryVehicleInfoInitialDataKey =     {     };     IAPAppConnectionIDKey = 43587966; } 2022-12-20 17:14:35.918708+0100 [APP][2737:448562] Connection 1: received failure notification 2022-12-20 17:14:35.918797+0100 [APP][2737:448291] -[EAAccessoryManager _externalAccessoryDisconnected:]: connectionID 43587966 2022-12-20 17:14:35 LOG: CONN > [Protocol-Updates]: disconnected from accesory Hiru 2022-12-20 17:14:35.919886+0100 [APP][2737:448562] [] nw_endpoint_flow_fillout_data_transfer_snapshot copy_info() returned NULL 2022-12-20 17:14:35.919931+0100 [APP][2737:448562] [connection] nw_connection_copy_connected_local_endpoint_block_invoke [C1] Connection has no connected path 2022-12-20 17:14:35.919962+0100 [APP][2737:448562] [connection] nw_connection_copy_connected_remote_endpoint_block_invoke [C1] Connection has no connected path 2022-12-20 17:14:35.921228+0100 [APP][2737:448291] Removing EASession F15E5A13-88CA-4D75-A288-4A63E8024DAE from list of sessionUUIDs 2022-12-20 17:14:35 LOG: CONN > [Protocol-Updates]: EA session closed. 2022-12-20 17:14:35.922326+0100 [APP][2737:448291] On: 1084 Accessory Disconnected. UUID FF13BA35-002A-4F44-94EB-F090E71AAB08 connectionID 43587966 createdByCoreAccessories 1. RegisteredForLocalNotifications Count: 5 2022-12-20 17:14:35 LOG: APP > HIRU disconnected 2022-12-20 17:14:35 LOG: CONN > [Protocol-Messages]: Connection event: 16 2022-12-20 17:14:35.927947+0100 [APP][2737:448291] On: 1050 RegisteredForLocalNotifications Count: 6 2022-12-20 17:14:35.928124+0100 [APP][2737:448291] Returning connectedAccessories count 0 2022-12-20 17:14:35 LOG: CONN > 2022-12-20 17:14:35 LOG: CONN > We didn't find devices, OUT But in the rare case that it returns information from our connected device, we're not able to open our session again --> this is the error we receive --> 212 unable to close session for _accessory 2022-12-19 14:51:57 LOG: CONN > [Protocol-Messages]: Connection event 2022-12-19 14:51:57.052193+0100 APP[521:15745] On: 1050 RegisteredForLocalNotifications Count: 6 2022-12-19 14:51:57.052246+0100 APP[521:15745] Returning connectedAccessories count 1 2022-12-19 14:51:57 LOG: CONN > APP: Accessory identified. 2022-12-19 14:51:57 LOG: CONN > [Protocol-Messages]: Hiru Accessory identified. 2022-12-19 14:51:57.252593+0100 Calibration Hiru[521:15745] ERROR - opening session failed 2022-12-19 14:51:57.252713+0100 Calibration Hiru[521:15745] ERROR - /Library/Caches/com.apple.xbs/Sources/ExternalAccessory/EASession.m:-[EASession dealloc] - 212 unable to close session for _accessory=0x281520430 and sessionID=65536 If we perform this same test when the app is in the foreground, everything works correctly. Background disconnect/connect test was working perfectly in our app on iOS15, but not on iOS16 :( We have found a similar thread, but we don't know if it is related to our bug https://developer.apple.com/forums/thread/102806 looking forward to hearing from your side ! All the best
2
0
1.4k
Dec ’22