This repository has been archived by the owner on Aug 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Showing
16 changed files
with
241 additions
and
9 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
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,17 @@ | ||
// | ||
// GYAttributionItem+Private.h | ||
// Glassfy | ||
// | ||
// Created by Luca Garbolino on 02/11/22. | ||
// | ||
|
||
#import "GYAttributionItem.h" | ||
#import "GYCodableProtocol.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface GYAttributionItem (Private) <GYEncodeProtocol> | ||
@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,53 @@ | ||
// | ||
// GYAttributionItem.h | ||
// Glassfy | ||
// | ||
// Created by Luca Garbolino on 02/11/22. | ||
// | ||
|
||
#import "GYAttributionItem+Private.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface GYAttributionItem() | ||
@property(nonatomic, strong, nullable) NSString *value; | ||
@property(nonatomic, assign) GYAttributionType type; | ||
@end | ||
|
||
@implementation GYAttributionItem (Private) | ||
|
||
- (id)encodedObject | ||
{ | ||
NSMutableDictionary *attributionInfo = [NSMutableDictionary dictionary]; | ||
NSString *nameStr = [self.class attributionTypeToString:self.type]; | ||
attributionInfo[nameStr] = self.value ?: [NSNull null]; | ||
|
||
return [NSDictionary dictionaryWithDictionary:attributionInfo]; | ||
} | ||
|
||
+ (NSString *)attributionTypeToString:(GYAttributionType)type { | ||
switch (type) { | ||
case GYAttributionTypeAdjustID: return @"adjustid"; | ||
case GYAttributionTypeAppsFlyerID: return @"appsflyerid"; | ||
case GYAttributionTypeIDFA: return @"idfa"; | ||
case GYAttributionTypeIDFV: return @"idfv"; | ||
case GYAttributionTypeIP: return @"ip"; | ||
} | ||
} | ||
|
||
@end | ||
|
||
@implementation GYAttributionItem | ||
|
||
+ (instancetype)attributionItemWithType:(GYAttributionType)type value:(NSString *_Nullable)value | ||
{ | ||
GYAttributionItem *item = [GYAttributionItem new]; | ||
item.type = type; | ||
item.value = value; | ||
|
||
return item; | ||
} | ||
|
||
@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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// | ||
// GYStoreInfo+Private.h.h | ||
// GYStoreInfo+Private.h | ||
// Glassfy | ||
// | ||
// Created by Luca Garbolino on 12/04/22. | ||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// | ||
// GYStoreInfo+Private.h.h | ||
// GYStoreInfo+Private.h | ||
// Glassfy | ||
// | ||
// Created by Luca Garbolino on 12/04/22. | ||
|
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,24 @@ | ||
// | ||
// GYAttributionItem.h | ||
// Glassfy | ||
// | ||
// Created by Luca Garbolino on 02/11/22. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#if __has_include(<Glassfy/GYTypes.h>) | ||
#import <Glassfy/GYTypes.h> | ||
#else | ||
#import "GYTypes.h" | ||
#endif | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
NS_SWIFT_NAME(Glassfy.AttributionItem) | ||
@interface GYAttributionItem : NSObject | ||
|
||
+ (instancetype)attributionItemWithType:(GYAttributionType)name value:(NSString *_Nullable)value; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
Oops, something went wrong.