I've built a spfx webpart that creates a list item in a list by using the following
const client = await this.props.context.msGraphClientFactory.getClient();
await client
.api("sites/MYSITEID/lists/MYLISTID/items")
.version("v1.0")
.post(MYDATA, (err, res, success) => {
if (err) {
//console.error('This Error' + err);
return;
}
if (success)
{
// console.log("success");
}
}) ;
It works fine in all browsers however it doesnt work in the sharepoint app. Just wondering on if anyone had any pointers on fixing this and or debugging this?
Also my Graph calls are not working within the sharepoint app i.e.
const client = await this.props.context.msGraphClientFactory
.getClient();
client.api('me')
.version('beta')
.get( async (error, response: any) => {
console.log(response);
})
}