@@ -18,6 +18,7 @@ public class FBConfig {
1818
1919 private boolean offline ;
2020 private Duration startWaitTime ;
21+ private boolean disableEvents ;
2122
2223 private String streamingURL ;
2324
@@ -59,10 +60,15 @@ public String getEventURL() {
5960 return eventURL ;
6061 }
6162
63+ public boolean isDisableEvents () {
64+ return disableEvents ;
65+ }
66+
6267 public FBConfig (Builder builder ) {
6368 this .offline = builder .offline ;
6469 this .streamingURL = builder .streamingURL ;
6570 this .eventURL = builder .eventURL ;
71+ this .disableEvents = builder .disableEvents ;
6672 this .startWaitTime = builder .startWaitTime == null ? DEFAULT_START_WAIT_TIME : builder .startWaitTime ;
6773 if (builder .offline ) {
6874 Loggers .CLIENT .info ("FB JAVA SDK: SDK is in offline mode" );
@@ -72,7 +78,7 @@ public FBConfig(Builder builder) {
7278 this .dataSynchronizerFactory =
7379 builder .dataSynchronizerFactory == null ? Factory .dataSynchronizerFactory () : builder .dataSynchronizerFactory ;
7480 this .insightProcessorFactory =
75- builder .insightProcessorFactory == null ? Factory .insightProcessorFactory () : builder .insightProcessorFactory ;
81+ builder .insightProcessorFactory == null ? ( this . disableEvents ? Factory .externalEventTrack () : Factory . insightProcessorFactory () ) : builder .insightProcessorFactory ;
7682 }
7783 this .dataStorageFactory =
7884 builder .dataStorageFactory == null ? Factory .inMemoryDataStorageFactory () : builder .dataStorageFactory ;
@@ -88,6 +94,7 @@ public FBConfig(Builder builder) {
8894 * .eventURL("your event URI")
8995 * .startWaitTime(Duration.ZERO)
9096 * .offline(false)
97+ * .disableEvents(false)
9198 * .build()
9299 * </code></pre>
93100 */
@@ -99,6 +106,8 @@ public static class Builder {
99106 private InsightProcessorFactory insightProcessorFactory ;
100107 private Duration startWaitTime ;
101108 private boolean offline = false ;
109+ private boolean disableEvents = false ;
110+
102111
103112 private String streamingURL ;
104113
@@ -206,6 +215,17 @@ public Builder eventURL(String eventURL) {
206215 return this ;
207216 }
208217
218+ /**
219+ * Set whether disable to send events
220+ *
221+ * @param disableEvents
222+ * @return the builder
223+ */
224+ public Builder disableEvents (boolean disableEvents ) {
225+ this .disableEvents = disableEvents ;
226+ return this ;
227+ }
228+
209229 /**
210230 * Builds the configured {@link FBConfig}
211231 *
0 commit comments