Skip to content

Commit

Permalink
update JMOMobileProvisionning with configuration type
Browse files Browse the repository at this point in the history
  • Loading branch information
leverdeterre committed May 10, 2014
1 parent 762e6e9 commit 45e9abc
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>D6008877-C990-4257-A197-5743A20C79CE</string>
<string>CBA42CAF-EF54-400E-80A7-7CD4D46CE682</string>
<key>IDESourceControlProjectName</key>
<string>iAppInfos</string>
<key>IDESourceControlProjectOriginsDictionary</key>
Expand Down
2 changes: 1 addition & 1 deletion iAppInfos/iAppInfos/iAppInfos/AppInformationsManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ - (id)infoForKey:(NSString *)key
return [self freeDiskSpace];
}
else if ([key isEqualToString:AppVersionManagerKeyBatteryLevel]) {
int batteryLevel = [self batteryLevel];
int batteryLevel = (int)[self batteryLevel];
return [NSString stringWithFormat:@"%d%%",batteryLevel];
}
else if ([key isEqualToString:AppVersionManagerKeyMobileProvisionning]) {
Expand Down
7 changes: 7 additions & 0 deletions iAppInfos/iAppInfos/iAppInfos/JMOMobileProvisionning.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
#define MobileProvisioningGetTaskAllow @"get-task-allow"
#define MobileProvisioningApsEnvironment @"aps-environment"

typedef NS_ENUM(NSUInteger, JMOMobileProvisionningPushConfiguration) {
JMOMobileProvisionningPushConfigurationDisable,
JMOMobileProvisionningPushConfigurationDevelopment,
JMOMobileProvisionningPushConfigurationProduction
};

@interface JMOMobileProvisionning : NSObject

@property (strong, nonatomic) NSDictionary *summary;
Expand All @@ -32,6 +38,7 @@
@property (strong, nonatomic) NSString *teamName;
@property (strong, nonatomic) NSString *isDevMobileProvisioning;
@property (strong, nonatomic) NSString *apsEnvironment;
@property (assign, readonly, nonatomic) JMOMobileProvisionningPushConfiguration pushConfiguration;

- (instancetype)initWithDictionary:(NSDictionary *)dict;

Expand Down
11 changes: 11 additions & 0 deletions iAppInfos/iAppInfos/iAppInfos/JMOMobileProvisionning.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ - (instancetype)initWithDictionary:(NSDictionary *)dict
return self;
}

- (JMOMobileProvisionningPushConfiguration)pushConfiguration
{
if ([_apsEnvironment isEqualToString:@"development"]) {
return JMOMobileProvisionningPushConfigurationDevelopment;
} else if ([_apsEnvironment isEqualToString:@"production"]) {
return JMOMobileProvisionningPushConfigurationProduction;
}

return JMOMobileProvisionningPushConfigurationDisable;
}

- (NSDictionary *)summary //Overided setter, to change keyName
{
NSMutableDictionary *editedDict = [_summary mutableCopy];
Expand Down

0 comments on commit 45e9abc

Please sign in to comment.