-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
298ede9
commit ccaee05
Showing
10 changed files
with
239 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,4 +96,4 @@ SPEC CHECKSUMS: | |
|
||
PODFILE CHECKSUM: cd1911d751c59f56b7f0243af0b5eba4ce54bf26 | ||
|
||
COCOAPODS: 1.12.0 | ||
COCOAPODS: 1.11.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// | ||
// QONRemoteConfigurationSource.h | ||
// Qonversion | ||
// | ||
// Created by Suren Sarkisyan on 30.08.2023. | ||
// Copyright © 2023 Qonversion Inc. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
typedef NS_ENUM(NSInteger, QONRemoteConfigurationAssignmentType) { | ||
QONRemoteConfigurationAssignmentTypeUnknown = -1, | ||
QONRemoteConfigurationAssignmentTypeAuto = 0, | ||
QONRemoteConfigurationAssignmentTypeManual = 1 | ||
} NS_SWIFT_NAME(Qonversion.QONRemoteConfigurationAssignmentType); | ||
|
||
typedef NS_ENUM(NSInteger, QONRemoteConfigurationSourceType) { | ||
QONRemoteConfigurationSourceTypeUnknown = -1, | ||
QONRemoteConfigurationSourceTypeExperimentControlGroup = 0, | ||
QONRemoteConfigurationSourceTypeExperimentTreatmentGroup = 1, | ||
QONRemoteConfigurationSourceTypeRemoteConfiguration = 2 | ||
} NS_SWIFT_NAME(Qonversion.RemoteConfigurationSourceType); | ||
|
||
NS_SWIFT_NAME(Qonversion.RemoteConfigurationSource) | ||
@interface QONRemoteConfigurationSource : NSObject | ||
|
||
/** | ||
Remote configuration source name. In this field, the experiment identifier or default remote configuration identifier depends on the source of the payload. | ||
*/ | ||
@property (nonatomic, copy, readonly) NSString *identifier; | ||
|
||
/** | ||
Remote configuration source name. In this field, the experiment name or default remote configuration name depends on the source of the payload.. | ||
*/ | ||
@property (nonatomic, copy, readonly) NSString *name; | ||
|
||
/** | ||
Remote configuration source type | ||
*/ | ||
@property (nonatomic, assign, readonly) QONRemoteConfigurationSourceType type; | ||
|
||
/** | ||
Remote config assignment type that indicates how the current payload was assigned to the user. | ||
*/ | ||
@property (nonatomic, assign, readonly) QONRemoteConfigurationAssignmentType assignmentType; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
// | ||
// QONRemoteConfigurationSource.m | ||
// Qonversion | ||
// | ||
// Created by Suren Sarkisyan on 30.08.2023. | ||
// Copyright © 2023 Qonversion Inc. All rights reserved. | ||
// | ||
|
||
#import "QONRemoteConfigurationSource.h" | ||
|
||
@implementation QONRemoteConfigurationSource | ||
|
||
- (instancetype)initWithIdentifier:(NSString *)identifier | ||
name:(NSString *)name | ||
type:(QONRemoteConfigurationSourceType)type | ||
assignmentType:(QONRemoteConfigurationAssignmentType)assignmentType { | ||
self = [super init]; | ||
|
||
if (self) { | ||
_identifier = identifier; | ||
_name = name; | ||
_type = type; | ||
_assignmentType = assignmentType; | ||
} | ||
|
||
return self; | ||
} | ||
|
||
- (NSString *)description { | ||
NSMutableString *description = [NSMutableString stringWithFormat:@"<%@: ", NSStringFromClass([self class])]; | ||
[description appendFormat:@"identifier=%@\n", self.identifier]; | ||
[description appendFormat:@"name=%@\n", self.name]; | ||
[description appendFormat:@"type=%@ (enum value = %li),\n", [self prettyType], (long) self.type]; | ||
[description appendFormat:@"assignmentType=%@ (enum value = %li),\n", [self prettyAssignmentType], (long) self.assignmentType]; | ||
[description appendString:@">"]; | ||
|
||
return [description copy]; | ||
} | ||
|
||
- (NSString *)prettyAssignmentType { | ||
NSString *result; | ||
|
||
switch (self.assignmentType) { | ||
case QONRemoteConfigurationAssignmentTypeAuto: | ||
result = @"auto"; break; | ||
|
||
case QONRemoteConfigurationAssignmentTypeManual: | ||
result = @"manual"; break; | ||
|
||
default: | ||
result = @"unknown"; break; | ||
} | ||
|
||
return result; | ||
} | ||
|
||
- (NSString *)prettyType { | ||
NSString *result; | ||
|
||
switch (self.type) { | ||
case QONRemoteConfigurationSourceTypeRemoteConfiguration: | ||
result = @"remote configuration"; break; | ||
|
||
case QONRemoteConfigurationSourceTypeExperimentControlGroup: | ||
result = @"experiment control group"; break; | ||
|
||
case QONRemoteConfigurationSourceTypeExperimentTreatmentGroup: | ||
result = @"experiment source group"; break; | ||
|
||
default: | ||
result = @"unknown"; break; | ||
} | ||
|
||
return result; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
Sources/Qonversion/Qonversion/Models/Protected/QONRemoteConfigurationSource+Protected.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// QONRemoteConfigInfo+Protected.h | ||
// Qonversion | ||
// | ||
// Created by Suren Sarkisyan on 30.08.2023. | ||
// Copyright © 2023 Qonversion Inc. All rights reserved. | ||
// | ||
|
||
#import <Qonversion/Qonversion.h> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface QONRemoteConfigurationSource () | ||
|
||
- (instancetype)initWithIdentifier:(NSString *)identifier | ||
name:(NSString *)name | ||
type:(QONRemoteConfigurationSourceType)type | ||
assignmentType:(QONRemoteConfigurationAssignmentType)assignmentType; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |