processEventMessage method
Processing the event message
Implementation
NUIMiniProgramMessage? processEventMessage(String message){
try{
final decoded = jsonDecode(message);
final programMessage = NUIMiniProgramMessage.empty().fromJson(decoded); // Decoding the message from the json
if(programMessage.data == null){
print("NUIMiniProgramEngine: No channel or payload found for this message");
return null;
}
return programMessage;
}catch(e, s){
print("NUIMiniProgramEngine: Failed to process event message with error: $e, stacktrace: $s");
return null;
}
}