@@ -69,8 +69,8 @@ public class Web3Auth: NSObject {
6969 )
7070
7171 AnalyticsManager . shared. setGlobalProperties ( [
72- " sdk_name " : AnalyticsSdkType . ios ,
73- " sdk_version " : AnalyticsEvents . sdkVersion ,
72+ " sdk_name " : options . getSdkName ( ) ,
73+ " sdk_version " : options . getSdkVersion ( ) ,
7474 " web3auth_client_id " : options. clientId,
7575 " web3auth_network " : options. web3AuthNetwork
7676 ] )
@@ -269,7 +269,7 @@ public class Web3Auth: NSObject {
269269 " chain_id " : web3AuthOptions. defaultChainId? . description ?? " " ,
270270 " dapp_url " : loginParams. dappUrl ?? " " ,
271271 " chains " : web3AuthOptions. chains? . description ?? " [] " ,
272- " integration_type " : " ios " ,
272+ " integration_type " : web3AuthOptions . getSdkName ( ) ,
273273 " is_sfa " : false
274274 ]
275275
@@ -499,7 +499,7 @@ public class Web3Auth: NSObject {
499499 " chain_id " : web3AuthOptions. defaultChainId? . description ?? " " ,
500500 " dapp_url " : loginParams. dappUrl ?? " " ,
501501 " chains " : web3AuthOptions. chains? . description ?? " [] " ,
502- " integration_type " : " ios " ,
502+ " integration_type " : web3AuthOptions . getSdkName ( ) ,
503503 " is_sfa " : true
504504 ]
505505
@@ -540,7 +540,7 @@ public class Web3Auth: NSObject {
540540 AnalyticsManager . shared. trackEvent (
541541 AnalyticsEvents . mfaEnablementStarted,
542542 properties: [
543- " integration_type " : AnalyticsSdkType . ios ,
543+ " integration_type " : web3AuthOptions . getSdkName ( ) ,
544544 " dapp_url " : loginParams? . dappUrl ?? " " ,
545545 " connector " : " auth " ,
546546 " duration " : duration
@@ -576,7 +576,7 @@ public class Web3Auth: NSObject {
576576 let newSessionId = try SessionManager . generateRandomSessionID ( ) !
577577 let loginIdObject : [ String : String ? ] = [
578578 " loginId " : newSessionId,
579- " platform " : " iOS " ,
579+ " platform " : web3AuthOptions . getSdkName ( ) ,
580580 ]
581581
582582 let jsonEncoder = JSONEncoder ( )
@@ -646,7 +646,7 @@ public class Web3Auth: NSObject {
646646 " chain_id " : self . web3AuthOptions. defaultChainId? . description ?? " " ,
647647 " dapp_url " : loginParams? . dappUrl ?? " " ,
648648 " chains " : self . web3AuthOptions. chains? . description ?? " [] " ,
649- " integration_type " : " ios " ,
649+ " integration_type " : self . web3AuthOptions . getSdkName ( ) ,
650650 " is_sfa " : false
651651 ]
652652
@@ -679,7 +679,7 @@ public class Web3Auth: NSObject {
679679 AnalyticsManager . shared. trackEvent (
680680 AnalyticsEvents . mfaManagementStarted,
681681 properties: [
682- " integration_type " : " ios " ,
682+ " integration_type " : web3AuthOptions . getSdkName ( ) ,
683683 " dapp_url " : loginParams? . dappUrl ?? " " ,
684684 " connector " : " auth "
685685 ]
@@ -764,7 +764,7 @@ public class Web3Auth: NSObject {
764764 " chain_id " : self . web3AuthOptions. defaultChainId? . description ?? " " ,
765765 " dapp_url " : loginParams? . dappUrl ?? " " ,
766766 " chains " : self . web3AuthOptions. chains? . description ?? " [] " ,
767- " integration_type " : " ios " ,
767+ " integration_type " : self . web3AuthOptions . getSdkName ( ) ,
768768 " is_sfa " : false
769769 ]
770770
@@ -800,7 +800,7 @@ public class Web3Auth: NSObject {
800800 AnalyticsManager . shared. trackEvent (
801801 AnalyticsEvents . walletUIClicked,
802802 properties: [
803- " integration_type " : AnalyticsSdkType . ios ,
803+ " integration_type " : web3AuthOptions . getSdkName ( ) ,
804804 " dapp_url " : loginParams? . dappUrl ?? " "
805805 ]
806806 )
@@ -868,7 +868,7 @@ public class Web3Auth: NSObject {
868868 AnalyticsManager . shared. trackEvent (
869869 AnalyticsEvents . walletServicesFailed,
870870 properties: [
871- " integration_type " : AnalyticsSdkType . ios ,
871+ " integration_type " : web3AuthOptions . getSdkName ( ) ,
872872 " dapp_url " : loginParams? . dappUrl ?? " " ,
873873 " duration " : Int ( Date ( ) . timeIntervalSince1970 * 1000 ) - Int( startTime) ,
874874 " error " : " Wallet Services Error: SessionId not found. Please login first. "
@@ -1038,31 +1038,26 @@ public class Web3Auth: NSObject {
10381038 // os_log("fetchProjectConfig API response is: %@", log: getTorusLogger(log: Web3AuthLogger.network, type: .info), type: .info, "\(String(describing: result))")
10391039 projectConfigResponse = result
10401040 AnalyticsManager . shared. setGlobalProperties ( [
1041- " sdk_name " : AnalyticsSdkType . ios ,
1042- " sdk_version " : AnalyticsEvents . sdkVersion ,
1041+ " sdk_name " : web3AuthOptions . getSdkName ( ) ,
1042+ " sdk_version " : web3AuthOptions . getSdkVersion ( ) ,
10431043 " web3auth_client_id " : web3AuthOptions. clientId,
10441044 " web3auth_network " : web3AuthOptions. web3AuthNetwork,
10451045 " team_id " : projectConfigResponse? . teamId. toString ( )
10461046 ] )
10471047
10481048 let duration = Int ( Date ( ) . timeIntervalSince1970 * 1000 ) - Int( startTime)
1049-
1049+ let chainIds : [ String ] = web3AuthOptions . chains ? . compactMap { $0 . chainId } ?? [ ]
10501050 let properties : [ String : Any ] = [
1051- " chain_ids " : [ " eip155 " , " solana " , " other " ] ,
1051+ " chain_ids " : chainIds,
1052+ " chain_nameSpaces " : [ " eip155 " , " solana " , " other " ] ,
10521053 " logging_enabled " : web3AuthOptions. enableLogging,
10531054 " auth_build_env " : web3AuthOptions. authBuildEnv? . rawValue,
1054- " auth_ux_mode " : " popup " ,
1055- " auth_mfa_settings " : [ String] ( ) ,
1055+ " auth_mfa_settings " : web3AuthOptions. mfaSettings,
10561056 " whitelabel_logo_light_enabled " : web3AuthOptions. whiteLabel? . logoLight != nil ,
10571057 " whitelabel_logo_dark_enabled " : web3AuthOptions. whiteLabel? . logoDark != nil ,
10581058 " whitelabel_theme_mode " : web3AuthOptions. whiteLabel? . theme as Any ,
1059- " ui_login_methods_order " : [
1060- " google " , " twitter " , " facebook " , " discord " , " farcaster " , " apple " ,
1061- " github " , " reddit " , " line " , " kakao " , " linkedin " , " twitch " ,
1062- " wechat " , " email_passwordless " , " sms_passwordless "
1063- ] ,
10641059 " duration " : duration,
1065- " integration_type " : " ios " ,
1060+ " integration_type " : web3AuthOptions . getSdkName ( ) ,
10661061 " dapp_url " : self . loginParams? . dappUrl as Any
10671062 ]
10681063
@@ -1074,6 +1069,8 @@ public class Web3Auth: NSObject {
10741069 web3AuthOptions. originData = result. whitelist. signedUrls. merging ( web3AuthOptions. originData ?? [ : ] ) { _, new in new }
10751070 web3AuthOptions. authConnectionConfig =
10761071 ( web3AuthOptions. authConnectionConfig ?? [ ] ) + ( projectConfigResponse? . embeddedWalletAuth ?? [ ] )
1072+ web3AuthOptions. mfaSettings = web3AuthOptions. mfaSettings? . merge ( with: projectConfigResponse? . mfaSettings)
1073+ ?? projectConfigResponse? . mfaSettings
10771074 if let whiteLabelData = result. whitelabel {
10781075 web3AuthOptions. whiteLabel = web3AuthOptions. whiteLabel? . merge ( with: whiteLabelData) ?? whiteLabelData
10791076 if web3AuthOptions. walletServicesConfig == nil {
@@ -1089,7 +1086,7 @@ public class Web3Auth: NSObject {
10891086 //print("Decoding failed: \(error)")
10901087 let duration = Int ( Date ( ) . timeIntervalSince1970 * 1000 ) - Int( startTime)
10911088 let properties : [ String : Any ] = [
1092- " integration_type " : AnalyticsSdkType . ios ,
1089+ " integration_type " : web3AuthOptions . getSdkName ( ) ,
10931090 " dapp_url " : self . loginParams? . dappUrl ?? " " ,
10941091 " duration " : duration,
10951092 " error_message " : error
0 commit comments