Invoke writeValue API when applicationWillTerminate was been called

Hello,


We want to send a command to our BLE device before our APP was been terminated.

So we try to invoke CBPeripheral::writeValue when delegate function "applicationWillTerminate" was been called.


We found it only 30~50% BLE device can receive the command from APP.

But we checked the APP log and we are sure that APP have called CBPeripheral::writeValue API everytime during "applicationWillTerminate" function was been called.


How can APP send a command to BLE device successfully everytime before it was been terminated?


Thank you.