Skip to content

Commit a42a573

Browse files
authored
Extension Badge Handling (#352)
Extension Badge Handling • Moves badge increment/decrement logic from the OneSignal backend to the application itself • This is accomplished using an app extension with an 'app group' to allow communication of data between the host app and it's notification extension service • This allows the app to maintain a consistent badge count • Also cleaned up some Firebase code and moved common strings to a definitions file • Changed the SDK so that it will default to group.{bundle_id}.onesignal as the App Group name if one is not provided in Info.plist Swizzle setApplicationIconBadgeNumber() • Swizzles the setApplicationIconBadgeNumber() method so the SDK always has a consistent badge count even if the developer manually sets it. Add Tests for Badge Handling • Adds a test to verify the extension badge handling logic works correctly • Verifies that manually setting the badge number using UIApplication setApplicationIconBadgeNumber() also updates OneSignal SDK's cached badge value • Verifies that the SDK correctly handles positive and negative (increment and decrement) badge_inc values Improve Badge Tests • Modularizes access to NSUserDefaults in regards to badge logic to a single implementation file • Moves the badge_inc property into the 'os_data' or 'custom' fields in push notification objects • Extends badge tests to cover more scenarios • Fixes header copyrights in multiple files
1 parent 61393b7 commit a42a573

20 files changed

+646
-131
lines changed

iOS_SDK/OneSignalSDK/OneSignal.xcodeproj/project.pbxproj

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@
148148
CA97E14F2051C0A5003B8CB8 /* OneSignalWebOpenDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = CA97E14D2051C0A5003B8CB8 /* OneSignalWebOpenDialog.m */; };
149149
CA97E1502051C0A5003B8CB8 /* OneSignalWebOpenDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = CA97E14D2051C0A5003B8CB8 /* OneSignalWebOpenDialog.m */; };
150150
CA97E1512051C0A5003B8CB8 /* OneSignalWebOpenDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = CA97E14D2051C0A5003B8CB8 /* OneSignalWebOpenDialog.m */; };
151+
CAA4ED0120646762005BD59B /* BadgeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CAA4ED0020646762005BD59B /* BadgeTests.m */; };
152+
CAABF34B205B15780042F8E5 /* OneSignalExtensionBadgeHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = CAABF34A205B15780042F8E5 /* OneSignalExtensionBadgeHandler.m */; };
153+
CAABF34C205B157B0042F8E5 /* OneSignalExtensionBadgeHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = CAABF34A205B15780042F8E5 /* OneSignalExtensionBadgeHandler.m */; };
154+
CAABF34D205B157B0042F8E5 /* OneSignalExtensionBadgeHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = CAABF34A205B15780042F8E5 /* OneSignalExtensionBadgeHandler.m */; };
151155
CAEA1C66202BB3C600FBFE9E /* OSEmailSubscription.h in Headers */ = {isa = PBXBuildFile; fileRef = CA810FCF202BA97300A60FED /* OSEmailSubscription.h */; };
152156
/* End PBXBuildFile section */
153157

@@ -283,6 +287,9 @@
283287
CA810FD0202BA97300A60FED /* OSEmailSubscription.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OSEmailSubscription.m; sourceTree = "<group>"; };
284288
CA97E14C2051C0A5003B8CB8 /* OneSignalWebOpenDialog.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OneSignalWebOpenDialog.h; sourceTree = "<group>"; };
285289
CA97E14D2051C0A5003B8CB8 /* OneSignalWebOpenDialog.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OneSignalWebOpenDialog.m; sourceTree = "<group>"; };
290+
CAA4ED0020646762005BD59B /* BadgeTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BadgeTests.m; sourceTree = "<group>"; };
291+
CAABF349205B15780042F8E5 /* OneSignalExtensionBadgeHandler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OneSignalExtensionBadgeHandler.h; sourceTree = "<group>"; };
292+
CAABF34A205B15780042F8E5 /* OneSignalExtensionBadgeHandler.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OneSignalExtensionBadgeHandler.m; sourceTree = "<group>"; };
286293
/* End PBXFileReference section */
287294

288295
/* Begin PBXFrameworksBuildPhase section */
@@ -406,6 +413,7 @@
406413
children = (
407414
4529DECD1FA81DE000CEAB1D /* Shadows */,
408415
911E2CBC1E398AB3003112A4 /* UnitTests.m */,
416+
CAA4ED0020646762005BD59B /* BadgeTests.m */,
409417
CA63AF8320211F7400E340FB /* EmailTests.m */,
410418
CA63AF8520211FF800E340FB /* UnitTestCommonMethods.h */,
411419
CA63AF8620211FF800E340FB /* UnitTestCommonMethods.m */,
@@ -452,6 +460,8 @@
452460
4529DF0B1FA932AC00CEAB1D /* OneSignalTrackFirebaseAnalytics.m */,
453461
454F94F01FAD218000D74CCF /* OneSignalNotificationServiceExtensionHandler.h */,
454462
454F94F11FAD218000D74CCF /* OneSignalNotificationServiceExtensionHandler.m */,
463+
CAABF349205B15780042F8E5 /* OneSignalExtensionBadgeHandler.h */,
464+
CAABF34A205B15780042F8E5 /* OneSignalExtensionBadgeHandler.m */,
455465
);
456466
path = Source;
457467
sourceTree = "<group>";
@@ -731,6 +741,7 @@
731741
454F94F51FAD2E5A00D74CCF /* OSNotificationPayload.m in Sources */,
732742
9129C6BE1E89E7AB009CB6A0 /* OSSubscription.m in Sources */,
733743
912412361E73342200E41FD7 /* OneSignalTrackIAP.m in Sources */,
744+
CAABF34B205B15780042F8E5 /* OneSignalExtensionBadgeHandler.m in Sources */,
734745
CA08FC7F1FE99B25004C445F /* Requests.m in Sources */,
735746
);
736747
runOnlyForDeploymentPostprocessing = 0;
@@ -768,6 +779,7 @@
768779
1AF75EB01E8569720097B315 /* NSString+OneSignal.m in Sources */,
769780
9129C6BF1E89E7AB009CB6A0 /* OSSubscription.m in Sources */,
770781
912412371E73342200E41FD7 /* OneSignalTrackIAP.m in Sources */,
782+
CAABF34C205B157B0042F8E5 /* OneSignalExtensionBadgeHandler.m in Sources */,
771783
CA08FC801FE99B25004C445F /* Requests.m in Sources */,
772784
);
773785
runOnlyForDeploymentPostprocessing = 0;
@@ -785,9 +797,11 @@
785797
CA70E3372023D51300019273 /* OneSignalSetEmailParameters.m in Sources */,
786798
4529DED81FA8253D00CEAB1D /* NSUserDefaultsOverrider.m in Sources */,
787799
4529DEED1FA83C5D00CEAB1D /* OneSignalHelperOverrider.m in Sources */,
800+
CAABF34D205B157B0042F8E5 /* OneSignalExtensionBadgeHandler.m in Sources */,
788801
912412301E73342200E41FD7 /* OneSignalSelectorHelpers.m in Sources */,
789802
91F58D851E7C88230017D24D /* OneSignalNotificationSettingsIOS10.m in Sources */,
790803
912412241E73342200E41FD7 /* OneSignalLocation.m in Sources */,
804+
CAA4ED0120646762005BD59B /* BadgeTests.m in Sources */,
791805
912412491E73369800E41FD7 /* OneSignalHelper.m in Sources */,
792806
4529DEE41FA82C6200CEAB1D /* NSURLSessionOverrider.m in Sources */,
793807
4529DED21FA81EA800CEAB1D /* NSObjectOverrider.m in Sources */,

iOS_SDK/OneSignalSDK/Source/OSNotificationPayload.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ -(void)parseCommonOneSignalFields:(NSDictionary*)payload {
118118
_launchURL = payload[@"u"];
119119
_templateID = payload[@"ti"];
120120
_templateName = payload[@"tn"];
121+
_badgeIncrement = [payload[@"badge_inc"] integerValue];
121122
}
122123

123124
-(void)parseApnsFields {

iOS_SDK/OneSignalSDK/Source/OneSignal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ typedef NS_ENUM(NSUInteger, OSNotificationDisplayType) {
122122

123123
/* The badge assigned to the application icon */
124124
@property(readonly)NSUInteger badge;
125+
@property(readonly)NSInteger badgeIncrement;
125126

126127
/* The sound parameter passed to the notification
127128
By default set to UILocalNotificationDefaultSoundName */

iOS_SDK/OneSignalSDK/Source/OneSignal.m

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050

5151
#import "OSObservable.h"
5252

53+
#import "OneSignalExtensionBadgeHandler.h"
54+
5355
#import <stdlib.h>
5456
#import <stdio.h>
5557
#import <sys/types.h>
@@ -908,14 +910,14 @@ + (void)postNotification:(NSDictionary*)jsonData onSuccess:(OSResultSuccessBlock
908910

909911
onesignal_Log(ONE_S_LL_DEBUG, [NSString stringWithFormat: @"HTTP create notification success %@", jsonResultsString]);
910912
if (successBlock)
911-
successBlock(result);
913+
successBlock(result);
912914
});
913915
} onFailure:^(NSError *error) {
914916
dispatch_async(dispatch_get_main_queue(), ^{
915917
onesignal_Log(ONE_S_LL_ERROR, @"Create notification failed");
916918
onesignal_Log(ONE_S_LL_INFO, [NSString stringWithFormat: @"%@", error]);
917919
if (failureBlock)
918-
failureBlock(error);
920+
failureBlock(error);
919921
});
920922
}];
921923
}
@@ -1536,7 +1538,7 @@ + (void)submitNotificationOpened:(NSString*)messageId {
15361538

15371539
+ (BOOL) clearBadgeCount:(BOOL)fromNotifOpened {
15381540

1539-
NSNumber *disableBadgeNumber = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"OneSignal_disable_badge_clearing"];
1541+
NSNumber *disableBadgeNumber = [[NSBundle mainBundle] objectForInfoDictionaryKey:ONESIGNAL_DISABLE_BADGE_CLEARING];
15401542

15411543
if (disableBadgeNumber)
15421544
disableBadgeClearing = [disableBadgeNumber boolValue];
@@ -1943,9 +1945,21 @@ + (void)load {
19431945
// Swizzle - UIApplication delegate
19441946
injectToProperClass(@selector(setOneSignalDelegate:), @selector(setDelegate:), @[], [OneSignalAppDelegate class], [UIApplication class]);
19451947

1948+
injectToProperClass(@selector(onesignalSetApplicationIconBadgeNumber:), @selector(setApplicationIconBadgeNumber:), @[], [OneSignalAppDelegate class], [UIApplication class]);
1949+
19461950
[self setupUNUserNotificationCenterDelegate];
19471951
}
19481952

1953+
/*
1954+
In order for the badge count to be consistent even in situations where the developer manually sets the badge number,
1955+
We swizzle the 'setApplicationIconBadgeNumber()' to intercept these calls so we always know the latest count
1956+
*/
1957+
- (void)onesignalSetApplicationIconBadgeNumber:(NSInteger)badge {
1958+
[OneSignalExtensionBadgeHandler updateCachedBadgeValue:badge];
1959+
1960+
[self onesignalSetApplicationIconBadgeNumber:badge];
1961+
}
1962+
19491963
+(void)setupUNUserNotificationCenterDelegate {
19501964
// Swizzle - UNUserNotificationCenter delegate - iOS 10+
19511965
if (!NSClassFromString(@"UNUserNotificationCenter"))

iOS_SDK/OneSignalSDK/Source/OneSignalCommonDefines.h

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,29 @@
1-
//
2-
// OneSignalCommonDefines.h
3-
// OneSignal
4-
//
5-
// Created by Brad Hesse on 2/1/18.
6-
// Copyright © 2018 Hiptic. All rights reserved.
7-
//
1+
/**
2+
* Modified MIT License
3+
*
4+
* Copyright 2017 OneSignal
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* 1. The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* 2. All copies of substantial portions of the Software may only be used in connection
17+
* with services provided by OneSignal.
18+
*
19+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25+
* THE SOFTWARE.
26+
*/
827

928
#ifndef OneSignalCommonDefines_h
1029
#define OneSignalCommonDefines_h
@@ -28,4 +47,15 @@
2847
#define PROMPT_BEFORE_OPENING_PUSH_URL @"PROMPT_BEFORE_OPENING_PUSH_URL"
2948
#define DEPRECATED_SELECTORS @[@"application:didReceiveLocalNotification:", @"application:handleActionWithIdentifier:forLocalNotification:completionHandler:", @"application:handleActionWithIdentifier:forLocalNotification:withResponseInfo:completionHandler:"]
3049

50+
// Badge handling
51+
#define ONESIGNAL_DISABLE_BADGE_CLEARING @"OneSignal_disable_badge_clearing"
52+
#define ONESIGNAL_APP_GROUP_NAME_KEY @"OneSignal_app_groups_key"
53+
#define ONESIGNAL_BADGE_KEY @"onesignalBadgeCount"
54+
55+
// Firebase
56+
#define ONESIGNAL_FB_ENABLE_FIREBASE @"OS_ENABLE_FIREBASE_ANALYTICS"
57+
#define ONESIGNAL_FB_LAST_TIME_RECEIVED @"OS_LAST_RECIEVED_TIME"
58+
#define ONESIGNAL_FB_LAST_GAF_CAMPAIGN_RECEIVED @"OS_LAST_RECIEVED_GAF_CAMPAIGN"
59+
#define ONESIGNAL_FB_LAST_NOTIFICATION_ID_RECEIVED @"OS_LAST_RECIEVED_NOTIFICATION_ID"
60+
3161
#endif /* OneSignalCommonDefines_h */
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
* Modified MIT License
3+
*
4+
* Copyright 2017 OneSignal
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* 1. The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* 2. All copies of substantial portions of the Software may only be used in connection
17+
* with services provided by OneSignal.
18+
*
19+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25+
* THE SOFTWARE.
26+
*/
27+
28+
#import <Foundation/Foundation.h>
29+
#import <UserNotifications/UserNotifications.h>
30+
#import "OneSignal.h"
31+
32+
@interface OneSignalExtensionBadgeHandler : NSObject
33+
+ (void)handleBadgeCountWithNotificationRequest:(UNNotificationRequest *)request withNotificationPayload:(OSNotificationPayload *)payload withMutableNotificationContent:(UNMutableNotificationContent *)replacementContent;
34+
+ (void)updateCachedBadgeValue:(NSInteger)value;
35+
+ (NSInteger)currentCachedBadgeValue;
36+
+ (NSString *)appGroupName;
37+
@end
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/**
2+
* Modified MIT License
3+
*
4+
* Copyright 2017 OneSignal
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* 1. The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* 2. All copies of substantial portions of the Software may only be used in connection
17+
* with services provided by OneSignal.
18+
*
19+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25+
* THE SOFTWARE.
26+
*/
27+
28+
#import "OneSignalExtensionBadgeHandler.h"
29+
#import "OneSignalCommonDefines.h"
30+
#import "OneSignalHelper.h"
31+
#import "OneSignalTrackFirebaseAnalytics.h"
32+
#import "OSNotificationPayload+Internal.h"
33+
34+
@implementation OneSignalExtensionBadgeHandler
35+
36+
+ (void)handleBadgeCountWithNotificationRequest:(UNNotificationRequest *)request withNotificationPayload:(OSNotificationPayload *)payload withMutableNotificationContent:(UNMutableNotificationContent *)replacementContent {
37+
38+
//if the user is setting the badge directly instead of incrementing/decrementing,
39+
//make sure the OneSignal cached value is updated to this value
40+
if (!payload.badgeIncrement) {
41+
if (payload.badge)
42+
[OneSignalExtensionBadgeHandler updateCachedBadgeValue:payload.badge];
43+
44+
return;
45+
}
46+
47+
var currentValue = (int)OneSignalExtensionBadgeHandler.currentCachedBadgeValue ?: 0;
48+
49+
currentValue += (int)payload.badgeIncrement;
50+
51+
//cannot have negative badge values
52+
if (currentValue < 0)
53+
currentValue = 0;
54+
55+
replacementContent.badge = @(currentValue);
56+
57+
[OneSignalExtensionBadgeHandler updateCachedBadgeValue:currentValue];
58+
}
59+
60+
+ (NSInteger)currentCachedBadgeValue {
61+
let userDefaults = [[NSUserDefaults alloc] initWithSuiteName:OneSignalExtensionBadgeHandler.appGroupName];
62+
63+
return [(NSNumber *)[userDefaults objectForKey:ONESIGNAL_BADGE_KEY] integerValue];
64+
}
65+
66+
+ (void)updateCachedBadgeValue:(NSInteger)value {
67+
//since badge logic can be executed in an extension, we need to use app groups to get
68+
//a shared NSUserDefaults from the app group suite name
69+
let userDefaults = [[NSUserDefaults alloc] initWithSuiteName:OneSignalExtensionBadgeHandler.appGroupName];
70+
71+
[userDefaults setObject:@(value) forKey:ONESIGNAL_BADGE_KEY];
72+
73+
[userDefaults synchronize];
74+
}
75+
76+
+ (NSString *)appGroupName {
77+
var appGroupName = (NSString *)[[NSBundle mainBundle] objectForInfoDictionaryKey:ONESIGNAL_APP_GROUP_NAME_KEY];
78+
79+
if (!appGroupName)
80+
appGroupName = [NSString stringWithFormat:@"group.%@.%@", [[NSBundle mainBundle] bundleIdentifier], @"onesignal"];
81+
82+
return [appGroupName stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
83+
}
84+
85+
@end

iOS_SDK/OneSignalSDK/Source/OneSignalNotificationServiceExtensionHandler.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*/
2727

2828
#import "OneSignalNotificationServiceExtensionHandler.h"
29-
29+
#import "OneSignalExtensionBadgeHandler.h"
3030
#import "OneSignalHelper.h"
3131
#import "OneSignalTrackFirebaseAnalytics.h"
3232
#import "OSNotificationPayload+Internal.h"
@@ -40,6 +40,9 @@ +(UNMutableNotificationContent*)didReceiveNotificationExtensionRequest:(UNNotifi
4040

4141
let payload = [OSNotificationPayload parseWithApns:request.content.userInfo];
4242

43+
//handle badge count
44+
[OneSignalExtensionBadgeHandler handleBadgeCountWithNotificationRequest:request withNotificationPayload:payload withMutableNotificationContent:replacementContent];
45+
4346
// Track receieved
4447
[OneSignalTrackFirebaseAnalytics trackReceivedEvent:payload];
4548

iOS_SDK/OneSignalSDK/Source/OneSignalSetEmailParameters.h

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,29 @@
1-
//
2-
// OneSignalSetEmailParameters.h
3-
// OneSignal
4-
//
5-
// Created by Brad Hesse on 2/1/18.
6-
// Copyright © 2018 Hiptic. All rights reserved.
7-
//
1+
/**
2+
* Modified MIT License
3+
*
4+
* Copyright 2017 OneSignal
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* 1. The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* 2. All copies of substantial portions of the Software may only be used in connection
17+
* with services provided by OneSignal.
18+
*
19+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25+
* THE SOFTWARE.
26+
*/
827

928
#import <Foundation/Foundation.h>
1029
#import "OneSignal.h"

0 commit comments

Comments
 (0)