summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicoleYarroch <nicole@livio.io>2019-03-06 09:34:07 -0500
committerNicoleYarroch <nicole@livio.io>2019-03-06 09:34:07 -0500
commit163df4a223c06f1cb9bcaf09981fcc1a618cdd31 (patch)
treea168aaef626b1046576e62eab5ab283ae2787b79
parentbee8e25ced87eb19fa67196228c2a495459d828f (diff)
downloadsdl_ios-163df4a223c06f1cb9bcaf09981fcc1a618cdd31.tar.gz
Renamed appName to nicknames in CloudAppProperties
* Renamed `appName` to `nicknames` in CloudAppProperties
-rw-r--r--SmartDeviceLink/SDLCloudAppProperties.h13
-rw-r--r--SmartDeviceLink/SDLCloudAppProperties.m16
-rw-r--r--SmartDeviceLink/SDLNames.h1
-rw-r--r--SmartDeviceLink/SDLNames.m1
-rw-r--r--SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetCloudAppPropertiesSpec.m2
-rw-r--r--SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetCloudAppPropertiesResponseSpec.m2
-rw-r--r--SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLCloudAppPropertiesSpec.m24
7 files changed, 30 insertions, 29 deletions
diff --git a/SmartDeviceLink/SDLCloudAppProperties.h b/SmartDeviceLink/SDLCloudAppProperties.h
index 30636b273..1c7dc5cc3 100644
--- a/SmartDeviceLink/SDLCloudAppProperties.h
+++ b/SmartDeviceLink/SDLCloudAppProperties.h
@@ -21,16 +21,15 @@ NS_ASSUME_NONNULL_BEGIN
/**
* Convenience init for required parameters.
*
- * @param appName The name of the cloud app
* @param appID The id of the cloud app
* @return A SDLCloudAppProperties object
*/
-- (instancetype)initWithAppName:(NSString *)appName appID:(NSString *)appID NS_DESIGNATED_INITIALIZER;
+- (instancetype)initWithAppID:(NSString *)appID NS_DESIGNATED_INITIALIZER;
/**
* Convenience init for all parameters.
*
- * @param appName The name of the cloud app
+ * @param nicknames An array of app names a cloud app is allowed to register with
* @param appID The id of the cloud app
* @param enabled If true, cloud app will be included in HMI RPC UpdateAppList
* @param authToken Used to authenticate websocket connection on app activation
@@ -39,14 +38,14 @@ NS_ASSUME_NONNULL_BEGIN
* @param endpoint The websocket endpoint
* @return A SDLCloudAppProperties object
*/
-- (instancetype)initWithAppName:(NSString *)appName appID:(NSString *)appID enabled:(BOOL)enabled authToken:(nullable NSString *)authToken cloudTransportType:(nullable NSString *)cloudTransportType hybridAppPreference:(nullable SDLHybridAppPreference)hybridAppPreference endpoint:(nullable NSString *)endpoint;
+- (instancetype)initWithNicknames:( NSArray<NSString *> *)nicknames appID:(NSString *)appID enabled:(BOOL)enabled authToken:(nullable NSString *)authToken cloudTransportType:(nullable NSString *)cloudTransportType hybridAppPreference:(nullable SDLHybridAppPreference)hybridAppPreference endpoint:(nullable NSString *)endpoint;
/**
- * The name of the cloud app.
+ * An array of app names a cloud app is allowed to register with. If included in a `SetCloudAppProperties` request, this value will overwrite the existing "nicknames" field in the app policies section of the policy table.
*
- * String, Required, maxlength="100"
+ * Array of Strings, Optional, String length: minlength="0" maxlength="100", Array size: minsize="0" maxsize="100"
*/
-@property (strong, nonatomic) NSString *appName;
+@property (nullable, strong, nonatomic) NSArray<NSString *> *nicknames;
/**
* The id of the cloud app.
diff --git a/SmartDeviceLink/SDLCloudAppProperties.m b/SmartDeviceLink/SDLCloudAppProperties.m
index c30d95d9a..28568a19a 100644
--- a/SmartDeviceLink/SDLCloudAppProperties.m
+++ b/SmartDeviceLink/SDLCloudAppProperties.m
@@ -16,24 +16,24 @@ NS_ASSUME_NONNULL_BEGIN
@implementation SDLCloudAppProperties
-- (instancetype)initWithAppName:(NSString *)appName appID:(NSString *)appID {
+- (instancetype)initWithAppID:(NSString *)appID {
self = [super init];
if (!self) {
return nil;
}
- self.appName = appName;
self.appID = appID;
return self;
}
-- (instancetype)initWithAppName:(NSString *)appName appID:(NSString *)appID enabled:(BOOL)enabled authToken:(nullable NSString *)authToken cloudTransportType:(nullable NSString *)cloudTransportType hybridAppPreference:(nullable SDLHybridAppPreference)hybridAppPreference endpoint:(nullable NSString *)endpoint {
- self = [self initWithAppName:appName appID:appID];
+- (instancetype)initWithNicknames:( NSArray<NSString *> *)nicknames appID:(NSString *)appID enabled:(BOOL)enabled authToken:(nullable NSString *)authToken cloudTransportType:(nullable NSString *)cloudTransportType hybridAppPreference:(nullable SDLHybridAppPreference)hybridAppPreference endpoint:(nullable NSString *)endpoint {
+ self = [self initWithAppID:appID];
if (!self) {
return nil;
}
+ self.nicknames = nicknames;
self.enabled = @(enabled);
self.authToken = authToken;
self.cloudTransportType = cloudTransportType;
@@ -43,12 +43,12 @@ NS_ASSUME_NONNULL_BEGIN
return self;
}
-- (void)setAppName:(NSString *)appName {
- [store sdl_setObject:appName forName:SDLNameAppName];
+- (void)setNicknames:(nullable NSArray<NSString *> *)nicknames {
+ [store sdl_setObject:nicknames forName:SDLNameNicknames];
}
-- (NSString *)appName {
- return [store sdl_objectForName:SDLNameAppName];
+- (nullable NSArray<NSString *> *)nicknames {
+ return [store sdl_objectForName:SDLNameNicknames];
}
- (void)setAppID:(NSString *)appID {
diff --git a/SmartDeviceLink/SDLNames.h b/SmartDeviceLink/SDLNames.h
index 9454acb60..5d657fa3d 100644
--- a/SmartDeviceLink/SDLNames.h
+++ b/SmartDeviceLink/SDLNames.h
@@ -375,6 +375,7 @@ extern SDLName const SDLNameNavigationText1;
extern SDLName const SDLNameNavigationText2;
extern SDLName const SDLNameNextTurnIcon;
extern SDLName const SDLNameNGNMediaScreenAppName;
+extern SDLName const SDLNameNicknames;
extern SDLName const SDLNameNightColorScheme;
extern SDLName const SDLNameNotification;
extern SDLName const SDLNameNumber;
diff --git a/SmartDeviceLink/SDLNames.m b/SmartDeviceLink/SDLNames.m
index 5748588fa..a8073897e 100644
--- a/SmartDeviceLink/SDLNames.m
+++ b/SmartDeviceLink/SDLNames.m
@@ -368,6 +368,7 @@ SDLName const SDLNameNavigationText1 = @"navigationText1";
SDLName const SDLNameNavigationText2 = @"navigationText2";
SDLName const SDLNameNextTurnIcon = @"nextTurnIcon";
SDLName const SDLNameNGNMediaScreenAppName = @"ngnMediaScreenAppName";
+SDLName const SDLNameNicknames = @"nicknames";
SDLName const SDLNameNightColorScheme = @"nightColorScheme";
SDLName const SDLNameNotification = @"notification";
SDLName const SDLNameNumber = @"number";
diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetCloudAppPropertiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetCloudAppPropertiesSpec.m
index de9653e9f..8b6697038 100644
--- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetCloudAppPropertiesSpec.m
+++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetCloudAppPropertiesSpec.m
@@ -19,7 +19,7 @@ describe(@"Getter/Setter Tests", ^{
__block SDLCloudAppProperties *testProperties = nil;
beforeEach(^{
- testProperties = [[SDLCloudAppProperties alloc] initWithAppName:@"testAppName" appID:@"testAppID"];
+ testProperties = [[SDLCloudAppProperties alloc] initWithAppID:@"testAppID"];
});
it(@"Should set and get correctly", ^{
diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetCloudAppPropertiesResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetCloudAppPropertiesResponseSpec.m
index bb884d244..bdc69487c 100644
--- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetCloudAppPropertiesResponseSpec.m
+++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetCloudAppPropertiesResponseSpec.m
@@ -19,7 +19,7 @@ describe(@"Getter/Setter Tests", ^{
__block SDLCloudAppProperties *testProperties = nil;
beforeEach(^{
- testProperties = [[SDLCloudAppProperties alloc] initWithAppName:@"testAppName" appID:@"testAppID"];
+ testProperties = [[SDLCloudAppProperties alloc] initWithAppID:@"testAppID"];
});
it(@"Should set and get correctly", ^{
diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLCloudAppPropertiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLCloudAppPropertiesSpec.m
index a7ed2662d..66599eb3b 100644
--- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLCloudAppPropertiesSpec.m
+++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLCloudAppPropertiesSpec.m
@@ -16,7 +16,7 @@
QuickSpecBegin(SDLCloudAppPropertiesSpec)
describe(@"Getter/Setter Tests", ^{
- __block NSString *testAppName = nil;
+ __block NSArray<NSString *> *testNicknames = nil;
__block NSString *testAppID = nil;
__block BOOL testEnabled = nil;
__block NSString *testAuthToken = nil;
@@ -25,7 +25,7 @@ describe(@"Getter/Setter Tests", ^{
__block NSString *testEndpoint = nil;
beforeEach(^{
- testAppName = @"testAppName";
+ testNicknames = @[@"testNickname1", @"testNickname2", @"testNickname3"];
testAppID = @"testAppID";
testEnabled = false;
testAuthToken = @"testAuthToken";
@@ -36,7 +36,7 @@ describe(@"Getter/Setter Tests", ^{
it(@"Should set and get correctly", ^{
SDLCloudAppProperties *testStruct = [[SDLCloudAppProperties alloc] init];
- testStruct.appName = testAppName;
+ testStruct.nicknames = testNicknames;
testStruct.appID = testAppID;
testStruct.enabled = @(testEnabled);
testStruct.authToken = testAuthToken;
@@ -44,7 +44,7 @@ describe(@"Getter/Setter Tests", ^{
testStruct.hybridAppPreference = testHybridAppPreference;
testStruct.endpoint = testEndpoint;
- expect(testStruct.appName).to(equal(testAppName));
+ expect(testStruct.nicknames).to(equal(testNicknames));
expect(testStruct.appID).to(equal(testAppID));
expect(testStruct.enabled).to(equal(testEnabled));
expect(testStruct.authToken).to(equal(testAuthToken));
@@ -54,7 +54,7 @@ describe(@"Getter/Setter Tests", ^{
});
it(@"Should get correctly when initialized with a dictionary", ^{
- NSDictionary *dict = @{SDLNameAppName:testAppName,
+ NSDictionary *dict = @{SDLNameNicknames:testNicknames,
SDLNameAppId:testAppID,
SDLNameEnabled:@(testEnabled),
SDLNameAuthToken:testAuthToken,
@@ -64,7 +64,7 @@ describe(@"Getter/Setter Tests", ^{
};
SDLCloudAppProperties *testStruct = [[SDLCloudAppProperties alloc] initWithDictionary:dict];
- expect(testStruct.appName).to(equal(testAppName));
+ expect(testStruct.nicknames).to(equal(testNicknames));
expect(testStruct.appID).to(equal(testAppID));
expect(testStruct.enabled).to(equal(testEnabled));
expect(testStruct.authToken).to(equal(testAuthToken));
@@ -73,11 +73,11 @@ describe(@"Getter/Setter Tests", ^{
expect(testStruct.endpoint).to(equal(testEndpoint));
});
- it(@"Should get correctly when initialized with initWithAppName:appID:", ^{
- SDLCloudAppProperties *testStruct = [[SDLCloudAppProperties alloc] initWithAppName:testAppName appID:testAppID];
+ it(@"Should get correctly when initialized with initWithAppID:", ^{
+ SDLCloudAppProperties *testStruct = [[SDLCloudAppProperties alloc] initWithAppID:testAppID];
- expect(testStruct.appName).to(equal(testAppName));
expect(testStruct.appID).to(equal(testAppID));
+ expect(testStruct.nicknames).to(beNil());
expect(testStruct.enabled).to(beNil());
expect(testStruct.authToken).to(beNil());
expect(testStruct.cloudTransportType).to(beNil());
@@ -86,9 +86,9 @@ describe(@"Getter/Setter Tests", ^{
});
it(@"Should get correctly when initialized with initWithAppName:appID:enabled:authToken:cloudTransportType: hybridAppPreference:endpoint:", ^{
- SDLCloudAppProperties *testStruct = [[SDLCloudAppProperties alloc] initWithAppName:testAppName appID:testAppID enabled:testEnabled authToken:testAuthToken cloudTransportType:testCloudTransportType hybridAppPreference:testHybridAppPreference endpoint:testEndpoint];
+ SDLCloudAppProperties *testStruct = [[SDLCloudAppProperties alloc] initWithNicknames:testNicknames appID:testAppID enabled:testEnabled authToken:testAuthToken cloudTransportType:testCloudTransportType hybridAppPreference:testHybridAppPreference endpoint:testEndpoint];
- expect(testStruct.appName).to(equal(testAppName));
+ expect(testStruct.nicknames).to(equal(testNicknames));
expect(testStruct.appID).to(equal(testAppID));
expect(testStruct.enabled).to(equal(testEnabled));
expect(testStruct.authToken).to(equal(testAuthToken));
@@ -100,7 +100,7 @@ describe(@"Getter/Setter Tests", ^{
it(@"Should return nil if not set", ^{
SDLCloudAppProperties *testStruct = [[SDLCloudAppProperties alloc] init];
- expect(testStruct.appName).to(beNil());
+ expect(testStruct.nicknames).to(beNil());
expect(testStruct.appID).to(beNil());
expect(testStruct.enabled).to(beNil());
expect(testStruct.authToken).to(beNil());