Is there a way to determine when the drone has been powered down (when the remote controller is still powered on)? For example a pilot may change the drone battery but does not power down the remote controller.
I have tried using keyManager to listen to the DJIParamConnection param of DJIProductKey, DJIFlightControllerKey and DJIAirLinkKey.
I also tried listening to the DJISDKManagerDelegate methods productConnected, productDisconnected, productChanged, componentConnectedWithKey, and componentDisconnectedWithKey.
But none of these key values or delegate methods are triggered when the drone is powered down. They only trigger when the Remote controller is also powered down.
Is there another way to detect this event?
Tested on M300 and Mavic Pro with iOS SDK 4.15.2
EDIT
I should have mentioned that this is running on a react native, native module. When creating a RN native module, RN puts the module on a background thread unless specified.
componentDisconnectedWithKey and productConnected delegate functions were not firing for me because the instance running the DJISDKManagerDelegate protocol was not running on the main thread so bizarrely sometimes they would fire and sometimes not.
I should have mentioned in my original post, this is a native module running on a react native app. Most of the DJI samples have the DJISDKManagerDelegate attached to a ViewController which I assume runs on the main thread. When creating a RN native module, RN puts the module on a background thread unless specified. There may be a more elegant solution but I solved this issue by specifying that this native module should run on the main thread.
- (dispatch_queue_t)methodQueue
{
return dispatch_get_main_queue();
}