Unlock Flyzone Sample
Sample Introduction
The unlock fly zone function provides developers with flight safety notifications, which include listening to flight safety information, flight safety warnings, critical flight safety alerts, return-to-home information, and changes in fly zones around the aircraft. By using the unlock fly zone function, developers can get the fly zone within a specific kilometer range around the aircraft and unlock the fly zone. Once unlocked, no further fly zone notifications will appear, and takeoff restrictions are lifted. If the aircraft reboots, notifications and restrictions will resume.
Fly Zone Division
The fly zone range of MSDK can refer to the enumeration value FlyZoneCategory
. For the introduction of fly zone type, you can refer to the GEO Zone Information.

Notes:
- If the aircraft enters restricted or authorization zones, or exceeds altitude limits, it will hover before the zone and will not be able to advance using the controller sticks.
- For enterprise models such as M300 RTK, M350 RTK, M30 series, and M3 series, users can directly input the flyZoneID to unlock authorization zones. After restarting the aircraft, authorization zones will be restricted again.
- For DJI Mini 3 and DJI Mini 3 Pro, refer to the Unlocking a GEO Zone on Your DJI Drone. After applying for an unlock on the DJI Flysafe official website, use
downloadFlyZoneLicensesFromServer
andpushFlyZoneLicensesToAircraft
to unlock the authorization zones.- Methods for searching fly zones:
1. Using the MSDK API –getFlyZonesInSurroundingArea()
to get the fly zones within a specific range around the aircraft.
2. Using the DJI official website GEO Zone Information by entering an "address" or "latitude, longitude" to search.- To get the fly zone information around the aircraft, MSDK must be connected.
Unlock through License
The unlocking process through license is introduced below. Enhanced warning zones and authorization zones can be unlocked directly through the MSDK API.
- Register a DJI account and apply for the license.
- Use
downloadFlyZoneLicensesFromServer()
to get licenses from the server and download them to the App. CalllogInDJIUserAccount()
first to log in and get the license for the account. - Use
pushFlyZoneLicensesToAircraft()
to push licenses with the same serial number as the aircraft to the flight control.
Note: If successful, usepullFlyZoneLicensesFromAircraft()
to get the license list in the aircraft. Developers can perform custom operations based on the current license list. - Use
setFlyZoneLicensesEnabled()
to enable or disable the license. Once the license is enabled, the aircraft can take off in the fly zone.
Note: Fly zone license information class –FlyZoneLicenseInfo()
introduces license type, validity period, and bound flight control serial number, among other details.
Obtain Unlock Information
There are two methods for obtaining unlock information. One is to pull unlock information belonging to the account from the server using downloadFlyZoneLicensesFromServer()
. The other is to obtain unlock information stored on the aircraft's control system using pullFlyZoneLicensesFromAircraft()
. Information pulled from the server might be incomplete, while complete unlock information can be obtained from the aircraft.
downloadFlyZoneLicensesFromServer()
– obtain account unlock informationpushFlyZoneLicensesToAircraft()
– synchronize the unlock information with the aircraftpullFlyZoneLicensesFromAircraft()
– obtain complete unlock information
Interface Calling Process
The figure below provides an example of a complete interface call. Call interfaces according to the actual scenario. For more details, refer to the fly zone management class IFlyZoneManager in the MSDK API documentation and sample code.
.png)