Search code examples
iosswiftsentry

how to prevent an event from being sent to sentry in swift (iOS)


I'm developing a framework for iOS and I want to use sentry for crash report. i want to just sends crash events related to my framework and not all the crashes that happens in host app. is there any way of preventing an event from being delivered or sent to sentry in sentry iOS sdk (assuming I have a solution of filtering some of the events)?


Solution

  • I think what you are looking for is the shouldSendEvent callback, it can be used like this:

    Client.shared?.shouldSendEvent = { event in
      // check for event stuff here
      // event.
      //return true 
      // OR
      return false
    }