A geofence is a virtual perimeter for a real-world positioning area. Geo-fencing involves a location-aware device of a location-based service user or asset entering or exiting a virtual area. Rather than geofences being static, in indoor positioning systems they need to be dynamically updated, frequently, efciently and on-demand. Furthermore, the underlying geofencing framework must work to incorporate the changes in the system's operational context (signal obstruction, static and dynamic obstacles, etc.) and compensate for their infuence on the location calculations. In this paper, we propose the Geofencing Micro-location Asset Tracking (GEMAT) framework for dynamic security geofencing management and notifcation/actuation based on the Bluetooth Low Energy Micro-location Asset Tracking (BLEMAT) IoT system. We show how an indoor geofencing framework that includes and compensates for contextual updates provides more functional geofencing capabilities, both in terms of precision and sophisticated use cases. We present the main functionalities of the geofencing framework and test them in a real-world IoT environment. Furthermore, we elaborate on a performance analysis model for geofencing frameworks with ten criteria defned. Conducted experiments and performance analysis show that the proposed GEMAT framework is a good candidate for solving problems in a wide range of indoor geofencing use cases.