@@ -18,6 +18,7 @@ public class FBConfig {
18
18
19
19
private boolean offline ;
20
20
private Duration startWaitTime ;
21
+ private boolean disableEvents ;
21
22
22
23
private String streamingURL ;
23
24
@@ -59,10 +60,15 @@ public String getEventURL() {
59
60
return eventURL ;
60
61
}
61
62
63
+ public boolean isDisableEvents () {
64
+ return disableEvents ;
65
+ }
66
+
62
67
public FBConfig (Builder builder ) {
63
68
this .offline = builder .offline ;
64
69
this .streamingURL = builder .streamingURL ;
65
70
this .eventURL = builder .eventURL ;
71
+ this .disableEvents = builder .disableEvents ;
66
72
this .startWaitTime = builder .startWaitTime == null ? DEFAULT_START_WAIT_TIME : builder .startWaitTime ;
67
73
if (builder .offline ) {
68
74
Loggers .CLIENT .info ("FB JAVA SDK: SDK is in offline mode" );
@@ -72,7 +78,7 @@ public FBConfig(Builder builder) {
72
78
this .dataSynchronizerFactory =
73
79
builder .dataSynchronizerFactory == null ? Factory .dataSynchronizerFactory () : builder .dataSynchronizerFactory ;
74
80
this .insightProcessorFactory =
75
- builder .insightProcessorFactory == null ? Factory .insightProcessorFactory () : builder .insightProcessorFactory ;
81
+ builder .insightProcessorFactory == null ? ( this . disableEvents ? Factory .externalEventTrack () : Factory . insightProcessorFactory () ) : builder .insightProcessorFactory ;
76
82
}
77
83
this .dataStorageFactory =
78
84
builder .dataStorageFactory == null ? Factory .inMemoryDataStorageFactory () : builder .dataStorageFactory ;
@@ -88,6 +94,7 @@ public FBConfig(Builder builder) {
88
94
* .eventURL("your event URI")
89
95
* .startWaitTime(Duration.ZERO)
90
96
* .offline(false)
97
+ * .disableEvents(false)
91
98
* .build()
92
99
* </code></pre>
93
100
*/
@@ -99,6 +106,8 @@ public static class Builder {
99
106
private InsightProcessorFactory insightProcessorFactory ;
100
107
private Duration startWaitTime ;
101
108
private boolean offline = false ;
109
+ private boolean disableEvents = false ;
110
+
102
111
103
112
private String streamingURL ;
104
113
@@ -206,6 +215,17 @@ public Builder eventURL(String eventURL) {
206
215
return this ;
207
216
}
208
217
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
+
209
229
/**
210
230
* Builds the configured {@link FBConfig}
211
231
*
0 commit comments