26
26
#define STR_EXPAND (x ) #x
27
27
28
28
static NSString *const RCNDeviceContextKeyVersion = @" app_version" ;
29
+ static NSString *const RCNDeviceContextKeyBuild = @" app_build" ;
29
30
static NSString *const RCNDeviceContextKeyOSVersion = @" os_version" ;
30
31
static NSString *const RCNDeviceContextKeyDeviceLocale = @" device_locale" ;
31
32
static NSString *const RCNDeviceContextKeyLocaleLanguage = @" locale_language" ;
32
33
static NSString *const RCNDeviceContextKeyGMPProjectIdentifier = @" GMP_project_Identifier" ;
33
34
34
35
NSString *FIRRemoteConfigAppVersion () {
36
+ return [[NSBundle mainBundle ] infoDictionary ][@" CFBundleShortVersionString" ];
37
+ }
38
+
39
+ NSString *FIRRemoteConfigAppBuildVersion () {
35
40
return [[NSBundle mainBundle ] infoDictionary ][@" CFBundleVersion" ];
36
41
}
37
42
@@ -205,6 +210,7 @@ int FIRRemoteConfigSDKVersion() {
205
210
NSString *GMPProjectIdentifier) {
206
211
NSMutableDictionary *deviceContext = [[NSMutableDictionary alloc ] init ];
207
212
deviceContext[RCNDeviceContextKeyVersion] = FIRRemoteConfigAppVersion ();
213
+ deviceContext[RCNDeviceContextKeyBuild] = FIRRemoteConfigAppBuildVersion ();
208
214
deviceContext[RCNDeviceContextKeyOSVersion] = [GULAppEnvironmentUtil systemVersion ];
209
215
deviceContext[RCNDeviceContextKeyDeviceLocale] = FIRRemoteConfigDeviceLocale ();
210
216
// NSDictionary setObjectForKey will fail if there's no GMP project ID, must check ahead.
@@ -219,6 +225,9 @@ BOOL FIRRemoteConfigHasDeviceContextChanged(NSDictionary *deviceContext,
219
225
if (![deviceContext[RCNDeviceContextKeyVersion] isEqual: FIRRemoteConfigAppVersion ()]) {
220
226
return YES ;
221
227
}
228
+ if (![deviceContext[RCNDeviceContextKeyBuild] isEqual: FIRRemoteConfigAppBuildVersion ()]) {
229
+ return YES ;
230
+ }
222
231
if (!
223
232
[deviceContext[RCNDeviceContextKeyOSVersion] isEqual: [GULAppEnvironmentUtil systemVersion ]]) {
224
233
return YES ;
0 commit comments