0

How do I disable Parse Analytics during development. I tried commenting out the setApplicationId: clientKey: call but as there are events being tracked throughout my code this causes an exception.

1 Answers1

1

Parse doesn't have a native functionality for disabling analytics during development, but you can wrap your events code using an #ifdef - #else - #endif statement

#ifdef DEBUG
#else
    [PFAnalytics trackEvent:@"eventName" dimensions:@{ @"parameter": @"value" }];
#endif

As long as you are running with DEBUG enabled (dev environments), this event tracker will not run.

You may also need to check the settings for your build to ensure it is DEBUG mode. See this answer for help: Xcode / iOS: How to determine whether code is running in DEBUG / RELEASE build?

Community
  • 1
  • 1
Ryan Kreager
  • 3,571
  • 1
  • 20
  • 35
  • Thanks. Pretty surprised they don't have a simple flag a can set once which makes the library ignore events. –  Jan 02 '15 at 16:01