@@ -47,7 +47,8 @@ class CoreBeaconFactory {
4747 id: beacon. id, mobileFeatures: mobileFeatures,
4848 trustDeviceTiming: conf. trustDeviceTiming,
4949 hybridAgentId: conf. hybridAgentId,
50- hybridAgentVersion: conf. hybridAgentVersion)
50+ hybridAgentVersion: conf. hybridAgentVersion,
51+ enableAppStateDetection: conf. enableAppStateDetection)
5152 cbeacon. append ( properties)
5253 switch beacon {
5354 case let item as HTTPBeacon :
@@ -292,32 +293,34 @@ extension CoreBeacon {
292293 hybridAgentId: String ? ,
293294 hybridAgentVersion: String ? ,
294295 connection: NetworkUtility . ConnectionType = InstanaSystemUtils . networkUtility. connectionType,
295- ect: NetworkUtility . CellularType ? = nil )
296+ ect: NetworkUtility . CellularType ? = nil ,
297+ enableAppStateDetection: Bool ? = nil )
296298 -> CoreBeacon {
297- CoreBeacon ( v: viewName,
298- k: key,
299- ti: String ( timestamp) ,
300- sid: sid. uuidString,
301- usi: usi? . uuidString,
302- bid: id,
303- uf: mobileFeatures,
304- bi: InstanaSystemUtils . applicationBundleIdentifier,
305- ul: Locale . current. languageCode,
306- ab: InstanaSystemUtils . applicationBuildNumber,
307- av: InstanaSystemUtils . applicationVersion,
308- p: InstanaSystemUtils . systemName,
309- osn: InstanaSystemUtils . systemName,
310- osv: InstanaSystemUtils . systemVersion,
311- dmo: InstanaSystemUtils . deviceModel,
312- agv: CoreBeacon . getInstanaAgentVersion ( hybridAgentId: hybridAgentId,
313- hybridAgentVersion: hybridAgentVersion) ,
314- ro: String ( InstanaSystemUtils . isDeviceJailbroken) ,
315- vw: String ( Int ( InstanaSystemUtils . screenSize. width) ) ,
316- vh: String ( Int ( InstanaSystemUtils . screenSize. height) ) ,
317- cn: connection. cellular. carrierName,
318- ct: connection. description,
319- ect: ect? . description ?? connection. cellular. description,
320- tdt: trustDeviceTiming. map { $0 ? " 1 " : nil } ?? nil ,
321- cas: InstanaApplicationStateHandler . shared. getAppStateForBeacon ( ) )
299+ let cas = ( enableAppStateDetection != false ) ? InstanaApplicationStateHandler . shared. getAppStateForBeacon ( ) : nil
300+ return CoreBeacon ( v: viewName,
301+ k: key,
302+ ti: String ( timestamp) ,
303+ sid: sid. uuidString,
304+ usi: usi? . uuidString,
305+ bid: id,
306+ uf: mobileFeatures,
307+ bi: InstanaSystemUtils . applicationBundleIdentifier,
308+ ul: Locale . current. languageCode,
309+ ab: InstanaSystemUtils . applicationBuildNumber,
310+ av: InstanaSystemUtils . applicationVersion,
311+ p: InstanaSystemUtils . systemName,
312+ osn: InstanaSystemUtils . systemName,
313+ osv: InstanaSystemUtils . systemVersion,
314+ dmo: InstanaSystemUtils . deviceModel,
315+ agv: CoreBeacon . getInstanaAgentVersion ( hybridAgentId: hybridAgentId,
316+ hybridAgentVersion: hybridAgentVersion) ,
317+ ro: String ( InstanaSystemUtils . isDeviceJailbroken) ,
318+ vw: String ( Int ( InstanaSystemUtils . screenSize. width) ) ,
319+ vh: String ( Int ( InstanaSystemUtils . screenSize. height) ) ,
320+ cn: connection. cellular. carrierName,
321+ ct: connection. description,
322+ ect: ect? . description ?? connection. cellular. description,
323+ tdt: trustDeviceTiming. map { $0 ? " 1 " : nil } ?? nil ,
324+ cas: cas)
322325 }
323326}
0 commit comments