Skip to content

Commit

Permalink
Renamed hashing methods so as not to conflict with Apple's private APIs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph Kalash authored and Joseph Kalash committed Sep 6, 2016
1 parent e1d1b6e commit 00fecb2
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion OneSignal.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "OneSignal"
s.version = "2.1.2"
s.version = "2.1.3"
s.summary = "OneSignal push notification library for mobile apps."
s.homepage = "https://onesignal.com"
s.license = { :type => 'MIT', :file => 'LICENSE' }
Expand Down
Binary file modified iOS_SDK/Framework/OneSignal.framework/Versions/A/OneSignal
Binary file not shown.
Binary file modified iOS_SDK/Framework/OneSignal.framework/Versions/B/OneSignal
Binary file not shown.
4 changes: 2 additions & 2 deletions iOS_SDK/OneSignal/NSString+Hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

@interface NSString (Hash)

- (NSString*)sha1;
- (NSString*)md5;
- (NSString*)hashUsingSha1;
- (NSString*)hashUsingMD5;

@end
4 changes: 2 additions & 2 deletions iOS_SDK/OneSignal/NSString+Hash.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

@implementation NSString (Hash)

- (NSString*)sha1 {
- (NSString*)hashUsingSha1 {
const char *cstr = [self UTF8String];
uint8_t digest[CC_SHA1_DIGEST_LENGTH];
CC_SHA1(cstr, (CC_LONG)strlen(cstr), digest);
Expand All @@ -41,7 +41,7 @@ - (NSString*)sha1 {
return output;
}

- (NSString*)md5 {
- (NSString*)hashUsingMD5 {
const char *cstr = [self UTF8String];
uint8_t digest[CC_MD5_DIGEST_LENGTH];
CC_MD5(cstr, (CC_LONG)strlen(cstr), digest);
Expand Down
6 changes: 3 additions & 3 deletions iOS_SDK/OneSignal/OneSignal.m
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@

@implementation OneSignal

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

const NSString* lowEmail = [email lowercaseString];
const NSString* md5 = [lowEmail md5];
const NSString* sha1 = [lowEmail sha1];
const NSString* md5 = [lowEmail hashUsingMD5];
const NSString* sha1 = [lowEmail hashUsingSha1];

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

Expand Down

0 comments on commit 00fecb2

Please sign in to comment.