A social and pervasive IoT platform for developing smart environments