@@ -193,14 +193,16 @@ AmplitudeClient.prototype.init = function init(apiKey, opt_userId, opt_config, o
193193 DeviceInfo . getCarrier ( ) ,
194194 DeviceInfo . getModel ( ) ,
195195 DeviceInfo . getManufacturer ( ) ,
196+ DeviceInfo . getVersion ( ) ,
196197 DeviceInfo . getUniqueId ( ) ,
197198 ] ) . then ( values => {
198199 this . deviceInfo = {
199200 carrier : values [ 0 ] ,
200201 model : values [ 1 ] ,
201- manufacturer : values [ 2 ]
202+ manufacturer : values [ 2 ] ,
203+ version : values [ 3 ]
202204 } ;
203- initFromStorage ( values [ 3 ] ) ;
205+ initFromStorage ( values [ 4 ] ) ;
204206 this . runQueuedFunctions ( ) ;
205207 if ( type ( opt_callback ) === 'function' ) {
206208 opt_callback ( this ) ;
@@ -1142,6 +1144,7 @@ AmplitudeClient.prototype._logEvent = function _logEvent(eventType, eventPropert
11421144 let osVersion = this . _ua . browser . major ;
11431145 let deviceModel = this . _ua . os . name ;
11441146 let deviceManufacturer ;
1147+ let versionName ;
11451148 let carrier ;
11461149 if ( BUILD_COMPAT_REACT_NATIVE ) {
11471150 osName = Platform . OS ;
@@ -1150,6 +1153,7 @@ AmplitudeClient.prototype._logEvent = function _logEvent(eventType, eventPropert
11501153 carrier = this . deviceInfo . carrier ;
11511154 deviceManufacturer = this . deviceInfo . manufacturer ;
11521155 deviceModel = this . deviceInfo . model ;
1156+ versionName = this . deviceInfo . version ;
11531157 }
11541158 }
11551159
@@ -1166,7 +1170,7 @@ AmplitudeClient.prototype._logEvent = function _logEvent(eventType, eventPropert
11661170 event_id : eventId ,
11671171 session_id : this . _sessionId || - 1 ,
11681172 event_type : eventType ,
1169- version_name : _shouldTrackField ( this , 'version_name' ) ? ( this . options . versionName || null ) : null ,
1173+ version_name : _shouldTrackField ( this , 'version_name' ) ? ( this . options . versionName || versionName || null ) : null ,
11701174 platform : _shouldTrackField ( this , 'platform' ) ? this . options . platform : null ,
11711175 os_name : _shouldTrackField ( this , 'os_name' ) ? ( osName || null ) : null ,
11721176 os_version : _shouldTrackField ( this , 'os_version' ) ? ( osVersion || null ) : null ,
0 commit comments