The number of connected mobile devices and Internet of Things (IoT) is growing around us, rapidly. Since, most of the people daily activities are relying on these connected things or devices. Specifically, this past year (with COVID-19) changed daily life in abroad and this is increased the use of IoT enabled technologies in health sector, work, and play. Further, the most common service via using these technologies is the localization/positioning service for different applications including: geo-tagging, billing, contact tracing, health-care system, point-of-interest recommendations, social networking, security, and more. Despite the availability of a large number of localization solutions in the literature, the precision of localization cannot meet the needs of consumers. For that reason, this paper provides an in-depth investigation of the existing technologies and techniques in the localization field, within the IoT era. Furthermore, the benefits and drawbacks of each technique with enabled technologies are illustrated and a comparison between the utilized technologies in the localization is made. The paper as a guideline is also going through all of the metrics that may be used to assess the localization solutions. Finally, the state-of-the-art solutions are examined, with challenges and perspectives regarding indoors/outdoors environments are demonstrated.