File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
packages/react-native-version-check/ios Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -17,30 +17,29 @@ - (dispatch_queue_t)methodQueue
17
17
18
18
- (NSString *) country
19
19
{
20
- NSString *country = [[NSLocale currentLocale ] objectForKey: NSLocaleCountryCode ];
21
- return country;
20
+ return [[NSLocale currentLocale ] objectForKey: NSLocaleCountryCode ] ?: @" " ;
22
21
}
23
22
24
23
- (NSString *) packageName
25
24
{
26
- return [[NSBundle mainBundle ] objectForInfoDictionaryKey: @" CFBundleIdentifier" ];
25
+ return [[NSBundle mainBundle ] objectForInfoDictionaryKey: @" CFBundleIdentifier" ] ?: @" " ;
27
26
}
28
27
29
28
- (NSString *) currentVersion
30
29
{
31
- return [[NSBundle mainBundle ] objectForInfoDictionaryKey: @" CFBundleShortVersionString" ];
30
+ return [[NSBundle mainBundle ] objectForInfoDictionaryKey: @" CFBundleShortVersionString" ] ?: @" 0 " ;
32
31
}
33
32
34
33
- (NSString *) currentBuildNumber
35
34
{
36
- return [[NSBundle mainBundle ] objectForInfoDictionaryKey: @" CFBundleVersion" ];
35
+ return [[NSBundle mainBundle ] objectForInfoDictionaryKey: @" CFBundleVersion" ] ?: @" 0 " ;
37
36
}
38
37
39
38
40
39
- (NSDictionary *)constantsToExport
41
40
{
42
41
return @{
43
- @" country" : ( self.country ) ? self. country : @" " ,
42
+ @" country" : self.country ,
44
43
@" packageName" : self.packageName ,
45
44
@" currentVersion" : self.currentVersion ,
46
45
@" currentBuildNumber" : self.currentBuildNumber ,
You can’t perform that action at this time.
0 commit comments