Get Notification of folder change in Personal OneDrive using Xamarin CrossPlatform & Graph

Universal Camera 276 Reputation points
2021-07-02T18:11:01.783+00:00

I have a Xamarin Forms CrossPlatform working App using Graph LargeFile tutorial

var fileUploadTask = new LargeFileUploadTask<DriveItem>(uploadSession, stream, maxSliceSize);

I would like to add folder change notification from OneDrive. I have looked at documentation for Graph WebHook but have not been able to run the sample provided.

Since I already have the Token to get DriveItem, Graph documentation states that I should be able to get from OneDrive notification when a file is deleted from a folder.

Can someone tell me what can I do to get the notification from OneDrive when a <DriveItem> file is deleted.

Thanks in advance!

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,354 questions
OneDrive Management
OneDrive Management
OneDrive: A Microsoft file hosting and synchronization service.Management: The act or process of organizing, handling, directing or controlling something.
1,254 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Jason Johnston 1 Reputation point
    2021-08-04T18:22:25.707+00:00

    Graph cannot notify your mobile app directly. If you want Graph to proactively notify your app of a change, you have to either stand up a web service to receive a POST from Graph (typically referred to as a webhook) and then work out some method to have your web service notify your mobile app, or you have to setup an Azure event hub and devise some method for the event hub to notify back to your mobile app.

    Alternatively, you could instead just have your mobile app use change tracking, making periodic calls to Graph to get any changes since the last call.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.