Selectively Enabling the SDK

In some cases you may wish to disable Specto—for example during CI, or for certain build types.

Android

On Android, this can be done during the initialization call:

class MyApplication : Application() {

    override fun onCreate() {
        super.onCreate()

        Specto.init(this) {
            enabled(false)
        }

        // …
    }
}
class MyApplication extends Application {
  
    @Override
    public void onCreate() {
        super.onCreate();

        Specto.init(this, new SpectoConfiguration.Builder()
            .enabled(false)
            .build());
      
        // …
    }
}

If disabled, all other calls to Specto functions will do nothing. Specto cannot be re-enabled until the application is recreated.

iOS

On iOS, we recommend that you simply do not call Specto.setUp(APIKey:) at app startup if you don't want to enable the SDK. Any calls to Specto APIs will be a no-op.