Skip to content

Commit

Permalink
Fixed Pollfish linker error and slow launch URL
Browse files Browse the repository at this point in the history
* Fixed _VERSION link error when Xcode project contains both Pollfish and OneSignal.
* Fixed issue where opening a notification with a launch URL would sometimes take to up 10 seconds before Safari would start.
  • Loading branch information
jkasten2 committed Sep 15, 2015
1 parent 8040e6f commit 4527ec4
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 9 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 = "1.10.0"
s.version = "1.10.1"
s.summary = "OneSignal push notification library for mobile apps."
s.homepage = "https://onesignal.com"
s.license = { :type => 'MIT', :file => 'LICENSE' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ typedef void (^OneSignalHandleNotificationBlock)(NSString* message, NSDictionary

@property(nonatomic, readonly, copy) NSString* app_id;

extern NSString* const VERSION;
extern NSString* const ONESIGNAL_VERSION;

typedef NS_ENUM(NSUInteger, ONE_S_LOG_LEVEL) {
ONE_S_LL_NONE, ONE_S_LL_FATAL, ONE_S_LL_ERROR, ONE_S_LL_WARN, ONE_S_LL_INFO, ONE_S_LL_DEBUG, ONE_S_LL_VERBOSE
Expand Down
Binary file modified iOS_SDK/Framework/OneSignal.framework/Versions/A/OneSignal
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
<key>IDESourceControlProjectIdentifier</key>
<string>82DF9B41-8B65-40E7-832A-C61D19DFA081</string>
<key>IDESourceControlProjectName</key>
<string>OneSignal</string>
<string>project</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>5A4AFF41A71B5F8D4741699EC46766398BC4FE44</key>
<string>https://github.com/Hiptic/OneSignal</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>SDK/iOS/iOS_SDK/OneSignal.xcodeproj</string>
<string>SDK/iOS/iOS_SDK/OneSignal.xcodeproj/project.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>5A4AFF41A71B5F8D4741699EC46766398BC4FE44</key>
Expand Down
2 changes: 1 addition & 1 deletion iOS_SDK/OneSignal/OneSignal.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ typedef void (^OneSignalHandleNotificationBlock)(NSString* message, NSDictionary

@property(nonatomic, readonly, copy) NSString* app_id;

extern NSString* const VERSION;
extern NSString* const ONESIGNAL_VERSION;

typedef NS_ENUM(NSUInteger, ONE_S_LOG_LEVEL) {
ONE_S_LL_NONE, ONE_S_LL_FATAL, ONE_S_LL_ERROR, ONE_S_LL_WARN, ONE_S_LL_INFO, ONE_S_LL_DEBUG, ONE_S_LL_VERBOSE
Expand Down
20 changes: 16 additions & 4 deletions iOS_SDK/OneSignal/OneSignal.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@

#define DEFAULT_PUSH_HOST @"https://onesignal.com/api/v1/"

NSString* const VERSION = @"011000";

#define NOTIFICATION_TYPE_BADGE 1
#define NOTIFICATION_TYPE_SOUND 2
#define NOTIFICATION_TYPE_ALERT 4
Expand All @@ -62,6 +60,8 @@ @interface OneSignal ()

@implementation OneSignal

NSString* const ONESIGNAL_VERSION = @"011001";

@synthesize app_id = _GT_publicKey;
@synthesize httpClient = _GT_httpRequest;
@synthesize lastMessageReceived;
Expand Down Expand Up @@ -174,6 +174,7 @@ - (id)initWithLaunchOptions:(NSDictionary*)launchOptions appId:(NSString*)appId
else if ([[UIApplication sharedApplication] respondsToSelector:@selector(registerForRemoteNotifications)])
[[UIApplication sharedApplication] registerForRemoteNotifications];


if (mUserId != nil)
[self registerUser];
else // Fall back incase Apple does not responsed in time.
Expand Down Expand Up @@ -371,7 +372,7 @@ - (void)registerUser {
[NSNumber numberWithInt:0], @"device_type",
[[[UIDevice currentDevice] identifierForVendor] UUIDString], @"ad_id",
[self getSoundFiles], @"sounds",
VERSION, @"sdk",
ONESIGNAL_VERSION, @"sdk",
mDeviceToken, @"identifier", // identifier MUST be at the end as it could be nil.
nil];

Expand All @@ -396,6 +397,8 @@ - (void)registerUser {
id asIdManager = [ASIdentifierManagerClass valueForKey:@"sharedManager"];
if ([[asIdManager valueForKey:@"advertisingTrackingEnabled"] isEqual:[NSNumber numberWithInt:1]])
dataDic[@"as_id"] = [[asIdManager valueForKey:@"advertisingIdentifier"] UUIDString];
else
dataDic[@"as_id"] = @"OptedOut";
}

UIApplicationReleaseMode releaseMode = [OneSignalMobileProvision releaseMode];
Expand Down Expand Up @@ -770,7 +773,9 @@ - (void) handleNotificationOpened:(NSDictionary*)messageDict isActive:(BOOL)isAc

if ([[UIApplication sharedApplication] applicationState] != UIApplicationStateActive && [customDict objectForKey:@"u"] != nil) {
NSURL *url = [NSURL URLWithString:[customDict objectForKey:@"u"]];
[[UIApplication sharedApplication] openURL:url];
dispatch_async(dispatch_get_main_queue(), ^{
[[UIApplication sharedApplication] openURL:url];
});
}

self.lastMessageReceived = messageDict;
Expand Down Expand Up @@ -1144,12 +1149,18 @@ static Class getClassWithProtocolInHierarchy(Class searchClass, Protocol* protoc
return searchClass;
}






static void injectSelector(Class newClass, SEL newSel, Class addToClass, SEL makeLikeSel) {
Method newMeth = class_getInstanceMethod(newClass, newSel);
IMP imp = method_getImplementation(newMeth);
const char* methodTypeEncoding = method_getTypeEncoding(newMeth);

BOOL successful = class_addMethod(addToClass, makeLikeSel, imp, methodTypeEncoding);

if (!successful) {
class_addMethod(addToClass, newSel, imp, methodTypeEncoding);
newMeth = class_getInstanceMethod(addToClass, newSel);
Expand Down Expand Up @@ -1252,6 +1263,7 @@ + (void)load {
static Class delegateClass = nil;

- (void) setOneSignalDelegate:(id<UIApplicationDelegate>)delegate {

if (delegateClass != nil) {
[self setOneSignalDelegate:delegate];
return;
Expand Down

0 comments on commit 4527ec4

Please sign in to comment.