Can not capture network_credentials event Photon


#1

cloud_status_connected can work but can not capture network_credentials event.

void handle_cloud_status(system_event_t event, int param)
{      
        if (param == cloud_status_connected) {

        }               
}                                                                                                         
                                    
void handle_network_credenticals(system_event_t event, int param)
{     
        if (param == network_credentials_added) {     
                has_credentials = true;
                Serial.printf("add credentials\r\n");                                                     
                Serial.flush();                                                                           
        } else if (param == network_credentials_cleared) {                                                
                has_credentials = false;                                                                  
                Serial.printf("clear credentials\r\n");                                                   
                Serial.flush();                                                                           
        }                                                                                                 
                                                                                                          
        Serial.printf("clear credentials\r\n");                                                           
        Serial.flush();                                                                                   
        while(1);                                                                                         
}                                                                                                         
                                                                                                          
void init_system_event_handle(void)                                                                       
{                                                                                                         
        System.on(cloud_status, handle_cloud_status);                                                     
        System.on(network_credentials, handle_network_credenticals);                                      
}