Skip to content

Commit 855d426

Browse files
emawbyrgomezp
andauthored
Rename session type (#766)
* Renamed Session type to OSSession to avoid cross-package conflicts * Updating influences to use OSSesstion * removing blank files Co-authored-by: Rodrigo <[email protected]>
1 parent 8b35b1b commit 855d426

File tree

11 files changed

+27
-27
lines changed

11 files changed

+27
-27
lines changed

iOS_SDK/OneSignalSDK/Source/OSChannelTracker.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ THE SOFTWARE.
3333

3434
@interface OSChannelTracker : NSObject
3535

36-
@property (nonatomic, readwrite) Session influenceType;
36+
@property (nonatomic, readwrite) OSSession influenceType;
3737
@property (strong, nonatomic, readwrite, nullable) NSString *directId;
3838
@property (strong, nonatomic, readwrite, nullable) NSArray *indirectIds;
3939
@property (strong, nonatomic, readonly, nonnull) OSInfluenceDataRepository *dataRepository;

iOS_SDK/OneSignalSDK/Source/OSIndirectInfluence.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
/**
22
Modified MIT License
3-
3+
44
Copyright 2019 OneSignal
5-
5+
66
Permission is hereby granted, free of charge, to any person obtaining a copy
77
of this software and associated documentation files (the "Software"), to deal
88
in the Software without restriction, including without limitation the rights
99
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1010
copies of the Software, and to permit persons to whom the Software is
1111
furnished to do so, subject to the following conditions:
12-
12+
1313
1. The above copyright notice and this permission notice shall be included in
1414
all copies or substantial portions of the Software.
15-
15+
1616
2. All copies of substantial portions of the Software may only be used in connection
1717
with services provided by OneSignal.
18-
18+
1919
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2020
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2121
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE

iOS_SDK/OneSignalSDK/Source/OSInfluence.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ THE SOFTWARE.
3333
@interface OSInfluenceBuilder : NSObject
3434

3535
@property (nonatomic) OSInfluenceChannel influenceChannel;
36-
@property (nonatomic) Session influenceType;
36+
@property (nonatomic) OSSession influenceType;
3737
@property (nonatomic, copy) NSArray * _Nullable ids;
3838

3939
@end
4040

4141
@interface OSInfluence : NSObject
4242

4343
@property (nonatomic, readonly) OSInfluenceChannel influenceChannel;
44-
@property (nonatomic, readonly) Session influenceType;
44+
@property (nonatomic, readonly) OSSession influenceType;
4545
@property (nonatomic, readwrite) NSArray * _Nullable ids;
4646

4747
- (id _Nonnull)initWithBuilder:(OSInfluenceBuilder * _Nonnull)builder;

iOS_SDK/OneSignalSDK/Source/OSInfluence.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ - (instancetype)init
4040

4141
@implementation OSInfluence
4242

43-
- (id)initWithInfluenceType:(Session)influenceType
43+
- (id)initWithInfluenceType:(OSSession)influenceType
4444
forInfluenceChannel:(OSInfluenceChannel)influenceChannel
4545
withIds:(NSArray *)ids {
4646
if (self = [super init]) {

iOS_SDK/OneSignalSDK/Source/OSInfluenceDataRepository.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ THE SOFTWARE.
3232

3333
@interface OSInfluenceDataRepository : NSObject
3434

35-
- (void)cacheNotificationInfluenceType:(Session) influenceType;
36-
- (Session)notificationCachedInfluenceType;
35+
- (void)cacheNotificationInfluenceType:(OSSession) influenceType;
36+
- (OSSession)notificationCachedInfluenceType;
3737

38-
- (void)cacheIAMInfluenceType:(Session) influenceType;
39-
- (Session)iamCachedInfluenceType;
38+
- (void)cacheIAMInfluenceType:(OSSession) influenceType;
39+
- (OSSession)iamCachedInfluenceType;
4040

4141
- (void)cacheNotificationOpenId:(NSString * _Nullable)notificationId;
4242
- (NSString * _Nullable)cachedNotificationOpenId;

iOS_SDK/OneSignalSDK/Source/OSInfluenceDataRepository.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,20 @@ of this software and associated documentation files (the "Software"), to deal
3333

3434
@implementation OSInfluenceDataRepository
3535

36-
- (void)cacheNotificationInfluenceType:(Session) influenceType {
36+
- (void)cacheNotificationInfluenceType:(OSSession) influenceType {
3737
[OneSignalUserDefaults.initShared saveStringForKey:OSUD_CACHED_NOTIFICATION_INFLUENCE withValue:OS_INFLUENCE_TYPE_TO_STRING(influenceType)];
3838
}
3939

40-
- (Session)notificationCachedInfluenceType {
40+
- (OSSession)notificationCachedInfluenceType {
4141
NSString *sessionString = [OneSignalUserDefaults.initShared getSavedStringForKey:OSUD_CACHED_NOTIFICATION_INFLUENCE defaultValue:OS_INFLUENCE_TYPE_TO_STRING(UNATTRIBUTED)];
4242
return OS_INFLUENCE_TYPE_FROM_STRING(sessionString);
4343
}
4444

45-
- (void)cacheIAMInfluenceType:(Session) influenceType {
45+
- (void)cacheIAMInfluenceType:(OSSession) influenceType {
4646
[OneSignalUserDefaults.initShared saveStringForKey:OSUD_CACHED_IAM_INFLUENCE withValue:OS_INFLUENCE_TYPE_TO_STRING(influenceType)];
4747
}
4848

49-
- (Session)iamCachedInfluenceType {
49+
- (OSSession)iamCachedInfluenceType {
5050
NSString *sessionString = [OneSignalUserDefaults.initShared getSavedStringForKey:OSUD_CACHED_IAM_INFLUENCE defaultValue:OS_INFLUENCE_TYPE_TO_STRING(UNATTRIBUTED)];
5151
return OS_INFLUENCE_TYPE_FROM_STRING(sessionString);
5252
}

iOS_SDK/OneSignalSDK/Source/OSNotificationTracker.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ - (void)saveChannelObjects:(NSArray * _Nonnull)channelObjects {
6666
}
6767

6868
- (void)initInfluencedTypeFromCache {
69-
Session influenceType = [self.dataRepository notificationCachedInfluenceType];
69+
OSSession influenceType = [self.dataRepository notificationCachedInfluenceType];
7070
self.influenceType = influenceType;
7171

7272
if (influenceType == INDIRECT)

iOS_SDK/OneSignalSDK/Source/OSOutcomeEvent.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
@interface OSOutcomeEvent () <OSJSONEncodable>
3434

35-
- (id _Nonnull)initWithSession:(Session)session
35+
- (id _Nonnull)initWithSession:(OSSession)session
3636
notificationIds:(NSArray * _Nullable)notificationIds
3737
name:(NSString * _Nonnull)name
3838
timestamp:(NSNumber * _Nonnull)timestamp

iOS_SDK/OneSignalSDK/Source/OSOutcomeEvent.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ of this software and associated documentation files (the "Software"), to deal
3131

3232
@implementation OSOutcomeEvent
3333

34-
- (id _Nonnull)initWithSession:(Session)influenceType
34+
- (id _Nonnull)initWithSession:(OSSession)influenceType
3535
notificationIds:(NSArray * _Nullable)notificationIds
3636
name:(NSString * _Nonnull)name
3737
timestamp:(NSNumber * _Nonnull)timestamp
@@ -50,9 +50,9 @@ - (id _Nonnull)initWithSession:(Session)influenceType
5050
- (id)initFromOutcomeEventParams:(OSOutcomeEventParams *)outcomeEventParams {
5151
if (self = [super init]) {
5252
OSOutcomeSource *source = outcomeEventParams.outcomeSource;
53-
Session influenceType = UNATTRIBUTED;
53+
OSSession influenceType = UNATTRIBUTED;
5454
NSArray *notificationId = nil;
55-
55+
5656
if (source) {
5757
if (source.directBody && source.directBody.notificationIds && source.directBody.notificationIds.count > 0) {
5858
influenceType = DIRECT;
@@ -62,7 +62,7 @@ - (id)initFromOutcomeEventParams:(OSOutcomeEventParams *)outcomeEventParams {
6262
notificationId = source.indirectBody.notificationIds;
6363
}
6464
}
65-
65+
6666
_session = influenceType;
6767
_notificationIds = notificationId;
6868
_name = outcomeEventParams.outcomeId;

iOS_SDK/OneSignalSDK/Source/OSSessionManager.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ - (void)attemptSessionUpgrade:(AppEntryAction)entryAction withDirectId:(NSString
196196
/*
197197
Called when the session for the app changes, caches the state, and broadcasts the session that just ended
198198
*/
199-
- (BOOL)setSessionForChannel:(OSChannelTracker *)channelTracker withInfluenceType:(Session)influenceType directId:(NSString *)directId indirectIds:(NSArray *)indirectIds {
199+
- (BOOL)setSessionForChannel:(OSChannelTracker *)channelTracker withInfluenceType:(OSSession)influenceType directId:(NSString *)directId indirectIds:(NSArray *)indirectIds {
200200
if (![self willChangeSessionForChannel:channelTracker withInfluenceType:influenceType directId:directId indirectIds:indirectIds])
201201
return NO;
202202

@@ -226,7 +226,7 @@ - (BOOL)setSessionForChannel:(OSChannelTracker *)channelTracker withInfluenceTyp
226226
2. Is DIRECT session data different from incoming DIRECT session data?
227227
3. Is INDIRECT session data different from incoming INDIRECT session data?
228228
*/
229-
- (BOOL)willChangeSessionForChannel:(OSChannelTracker *)channelTracker withInfluenceType:(Session)influenceType directId:(NSString *)directId indirectIds:(NSArray *)indirectIds {
229+
- (BOOL)willChangeSessionForChannel:(OSChannelTracker *)channelTracker withInfluenceType:(OSSession)influenceType directId:(NSString *)directId indirectIds:(NSArray *)indirectIds {
230230
if (channelTracker.influenceType != influenceType)
231231
return true;
232232

0 commit comments

Comments
 (0)