title: Observe and delete (screenshot), if a screenshot is taken while using my App in Iphone
body: <p>I am trying to observe if a screenshot is taken while using my App on Iphone. If a screenshot is taken while using my App, I would like that screenshot to be deleted.</p>
  
  <p>I also understand that during deletion, user needs to give permission for deletion. </p>
  
  <p>I used an Observer method successfully to check if a screenshot is taken while using my app. </p>
  
  <p>I am stuck at a point where I need to access that screenshot and delete it, of course with user permission.</p>
  
  <pre><code>```public override void OnActivated(UIApplication application)
      {
          try
          {
              // Start observing screenshot notification
              if (_screenshotNotification == null)
              {
                  _screenshotNotification = NSNotificationCenter.DefaultCenter.AddObserver(UIApplication.UserDidTakeScreenshotNotification,
                              (NSNotification n) =&gt; {
  
  Console.WriteLine("UserTookScreenshot");                                    
  
  var photosOptions = new PHFetchOptions();                                   
  
  photosOptions.SortDescriptors = new NSSortDescriptor[] { new 
  
  NSSortDescriptor("creationDate", false) };                                  
  
  photosOptions.FetchLimit = 1;                                                                       
  
  var photo = PHAsset.FetchAssets(photosOptions);                                 
  
  Console.WriteLine(photo);                                   
  
  var filePath = photo.Path;                                  
  
  System.IO.File.Delete(filePath);                                    
  
  n.Dispose();
                                         }
                       );
              }
          }
          catch (Exception ex)
          {
              Console.WriteLine(ex.Message);
              Console.WriteLine(ex.StackTrace);
          }
      }```
  </code></pre>
  
  <p>I know the above code does not work with deleting the current screenshot taken while using my App. It gives a general idea on what I want to achieve.</p>
  
  <p>How can I delete the screenshot taken while using my APP from Iphone instantly (with user permission)? I would also like to know if it is possible.</p>