I'm creating a Sharepoint Application (using Shrepoint Framework) and I'm not being able to retrieve the Phto BLOB returned when calling MSGraph "/me/photo/$value" api. I don't know how to convert the BLOB into a Base64 string. I have made many attempts, I'm writing one to explain what I'm trying to accomplish:
this.context.msGraphClientFactory
.getClient()
.then((client: MSGraphClient): void => {
client.api('/me/photo/$value').get((error, response: any, rawResponse?: any) => {
const blobUrl = window.URL.createObjectURL(rawResponse.body);
document.getElementById("myPhoto").setAttribute("src", blobUrl);
});
});
This code fails because creteObjectURL has been deprecated. The MSGraph call works, but I can't process the response. Any suggestions?