Skip to content

Commit 4527ec4

Browse files
committed
Fixed Pollfish linker error and slow launch URL
* 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.
1 parent 8040e6f commit 4527ec4

File tree

6 files changed

+21
-9
lines changed

6 files changed

+21
-9
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 = "1.10.0"
3+
s.version = "1.10.1"
44
s.summary = "OneSignal push notification library for mobile apps."
55
s.homepage = "https://onesignal.com"
66
s.license = { :type => 'MIT', :file => 'LICENSE' }

iOS_SDK/Framework/OneSignal.framework/Versions/A/Headers/OneSignal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ typedef void (^OneSignalHandleNotificationBlock)(NSString* message, NSDictionary
4242

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

45-
extern NSString* const VERSION;
45+
extern NSString* const ONESIGNAL_VERSION;
4646

4747
typedef NS_ENUM(NSUInteger, ONE_S_LOG_LEVEL) {
4848
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
-234 KB
Binary file not shown.

iOS_SDK/OneSignal.xcodeproj/project.xcworkspace/xcshareddata/OneSignal.xccheckout

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
<key>IDESourceControlProjectIdentifier</key>
88
<string>82DF9B41-8B65-40E7-832A-C61D19DFA081</string>
99
<key>IDESourceControlProjectName</key>
10-
<string>OneSignal</string>
10+
<string>project</string>
1111
<key>IDESourceControlProjectOriginsDictionary</key>
1212
<dict>
1313
<key>5A4AFF41A71B5F8D4741699EC46766398BC4FE44</key>
1414
<string>https://github.com/Hiptic/OneSignal</string>
1515
</dict>
1616
<key>IDESourceControlProjectPath</key>
17-
<string>SDK/iOS/iOS_SDK/OneSignal.xcodeproj</string>
17+
<string>SDK/iOS/iOS_SDK/OneSignal.xcodeproj/project.xcworkspace</string>
1818
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
1919
<dict>
2020
<key>5A4AFF41A71B5F8D4741699EC46766398BC4FE44</key>

iOS_SDK/OneSignal/OneSignal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ typedef void (^OneSignalHandleNotificationBlock)(NSString* message, NSDictionary
4242

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

45-
extern NSString* const VERSION;
45+
extern NSString* const ONESIGNAL_VERSION;
4646

4747
typedef NS_ENUM(NSUInteger, ONE_S_LOG_LEVEL) {
4848
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

iOS_SDK/OneSignal/OneSignal.m

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535

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

38-
NSString* const VERSION = @"011000";
39-
4038
#define NOTIFICATION_TYPE_BADGE 1
4139
#define NOTIFICATION_TYPE_SOUND 2
4240
#define NOTIFICATION_TYPE_ALERT 4
@@ -62,6 +60,8 @@ @interface OneSignal ()
6260

6361
@implementation OneSignal
6462

63+
NSString* const ONESIGNAL_VERSION = @"011001";
64+
6565
@synthesize app_id = _GT_publicKey;
6666
@synthesize httpClient = _GT_httpRequest;
6767
@synthesize lastMessageReceived;
@@ -174,6 +174,7 @@ - (id)initWithLaunchOptions:(NSDictionary*)launchOptions appId:(NSString*)appId
174174
else if ([[UIApplication sharedApplication] respondsToSelector:@selector(registerForRemoteNotifications)])
175175
[[UIApplication sharedApplication] registerForRemoteNotifications];
176176

177+
177178
if (mUserId != nil)
178179
[self registerUser];
179180
else // Fall back incase Apple does not responsed in time.
@@ -371,7 +372,7 @@ - (void)registerUser {
371372
[NSNumber numberWithInt:0], @"device_type",
372373
[[[UIDevice currentDevice] identifierForVendor] UUIDString], @"ad_id",
373374
[self getSoundFiles], @"sounds",
374-
VERSION, @"sdk",
375+
ONESIGNAL_VERSION, @"sdk",
375376
mDeviceToken, @"identifier", // identifier MUST be at the end as it could be nil.
376377
nil];
377378

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

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

771774
if ([[UIApplication sharedApplication] applicationState] != UIApplicationStateActive && [customDict objectForKey:@"u"] != nil) {
772775
NSURL *url = [NSURL URLWithString:[customDict objectForKey:@"u"]];
773-
[[UIApplication sharedApplication] openURL:url];
776+
dispatch_async(dispatch_get_main_queue(), ^{
777+
[[UIApplication sharedApplication] openURL:url];
778+
});
774779
}
775780

776781
self.lastMessageReceived = messageDict;
@@ -1144,12 +1149,18 @@ static Class getClassWithProtocolInHierarchy(Class searchClass, Protocol* protoc
11441149
return searchClass;
11451150
}
11461151

1152+
1153+
1154+
1155+
1156+
11471157
static void injectSelector(Class newClass, SEL newSel, Class addToClass, SEL makeLikeSel) {
11481158
Method newMeth = class_getInstanceMethod(newClass, newSel);
11491159
IMP imp = method_getImplementation(newMeth);
11501160
const char* methodTypeEncoding = method_getTypeEncoding(newMeth);
11511161

11521162
BOOL successful = class_addMethod(addToClass, makeLikeSel, imp, methodTypeEncoding);
1163+
11531164
if (!successful) {
11541165
class_addMethod(addToClass, newSel, imp, methodTypeEncoding);
11551166
newMeth = class_getInstanceMethod(addToClass, newSel);
@@ -1252,6 +1263,7 @@ + (void)load {
12521263
static Class delegateClass = nil;
12531264

12541265
- (void) setOneSignalDelegate:(id<UIApplicationDelegate>)delegate {
1266+
12551267
if (delegateClass != nil) {
12561268
[self setOneSignalDelegate:delegate];
12571269
return;

0 commit comments

Comments
 (0)