Skip to content

Commit 00fecb2

Browse files
Joseph KalashJoseph Kalash
authored andcommitted
Renamed hashing methods so as not to conflict with Apple's private APIs.
1 parent e1d1b6e commit 00fecb2

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

OneSignal.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "OneSignal"
3-
s.version = "2.1.2"
3+
s.version = "2.1.3"
44
s.summary = "OneSignal push notification library for mobile apps."
55
s.homepage = "https://onesignal.com"
66
s.license = { :type => 'MIT', :file => 'LICENSE' }
3.7 KB
Binary file not shown.
47.8 KB
Binary file not shown.

iOS_SDK/OneSignal/NSString+Hash.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
@interface NSString (Hash)
3131

32-
- (NSString*)sha1;
33-
- (NSString*)md5;
32+
- (NSString*)hashUsingSha1;
33+
- (NSString*)hashUsingMD5;
3434

3535
@end

iOS_SDK/OneSignal/NSString+Hash.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
@implementation NSString (Hash)
3333

34-
- (NSString*)sha1 {
34+
- (NSString*)hashUsingSha1 {
3535
const char *cstr = [self UTF8String];
3636
uint8_t digest[CC_SHA1_DIGEST_LENGTH];
3737
CC_SHA1(cstr, (CC_LONG)strlen(cstr), digest);
@@ -41,7 +41,7 @@ - (NSString*)sha1 {
4141
return output;
4242
}
4343

44-
- (NSString*)md5 {
44+
- (NSString*)hashUsingMD5 {
4545
const char *cstr = [self UTF8String];
4646
uint8_t digest[CC_MD5_DIGEST_LENGTH];
4747
CC_MD5(cstr, (CC_LONG)strlen(cstr), digest);

iOS_SDK/OneSignal/OneSignal.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171

7272
@implementation OneSignal
7373

74-
NSString* const ONESIGNAL_VERSION = @"020102";
74+
NSString* const ONESIGNAL_VERSION = @"020103";
7575
static NSString* mSDKType = @"native";
7676
static BOOL coldStartFromTapOnNotification = NO;
7777
static BOOL registeredWithApple = NO; //Has attempted to register for push notifications with Apple.
@@ -1157,8 +1157,8 @@ + (void)syncHashedEmail:(NSString *)email {
11571157
}
11581158

11591159
const NSString* lowEmail = [email lowercaseString];
1160-
const NSString* md5 = [lowEmail md5];
1161-
const NSString* sha1 = [lowEmail sha1];
1160+
const NSString* md5 = [lowEmail hashUsingMD5];
1161+
const NSString* sha1 = [lowEmail hashUsingSha1];
11621162

11631163
onesignal_Log(ONE_S_LL_DEBUG, [NSString stringWithFormat:@"%@ - MD5: %@, SHA1:%@", lowEmail, md5, sha1]);
11641164

0 commit comments

Comments
 (0)