Skip to content

Commit 10c2c3e

Browse files
committed
2.6.4 Release
1 parent 556ebb0 commit 10c2c3e

File tree

10 files changed

+94
-2
lines changed

10 files changed

+94
-2
lines changed
Binary file not shown.

OneSignalExample/Assets/OneSignal/Platforms/iOS/OneSignal.h

+1
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 */
Binary file not shown.
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.6.3
1+
2.6.4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>$(DEVELOPMENT_LANGUAGE)</string>
7+
<key>CFBundleDisplayName</key>
8+
<string>OneSignalNotificationServiceExtension</string>
9+
<key>CFBundleExecutable</key>
10+
<string>$(EXECUTABLE_NAME)</string>
11+
<key>CFBundleIdentifier</key>
12+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13+
<key>CFBundleInfoDictionaryVersion</key>
14+
<string>6.0</string>
15+
<key>CFBundleName</key>
16+
<string>$(PRODUCT_NAME)</string>
17+
<key>CFBundlePackageType</key>
18+
<string>XPC!</string>
19+
<key>CFBundleShortVersionString</key>
20+
<string>1.0</string>
21+
<key>CFBundleVersion</key>
22+
<string>1</string>
23+
<key>NSExtension</key>
24+
<dict>
25+
<key>NSExtensionPointIdentifier</key>
26+
<string>com.apple.usernotifications.service</string>
27+
<key>NSExtensionPrincipalClass</key>
28+
<string>NotificationService</string>
29+
</dict>
30+
</dict>
31+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//
2+
// NotificationService.h
3+
// OneSignalNotificationServiceExtension
4+
//
5+
// Created by Brad Hesse on 3/23/18.
6+
//
7+
8+
#import <UserNotifications/UserNotifications.h>
9+
10+
@interface NotificationService : UNNotificationServiceExtension
11+
12+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#import "OneSignal.h"
2+
3+
#import "NotificationService.h"
4+
5+
@interface NotificationService ()
6+
7+
@property (nonatomic, strong) void (^contentHandler)(UNNotificationContent *contentToDeliver);
8+
@property (nonatomic, strong) UNNotificationRequest *receivedRequest;
9+
@property (nonatomic, strong) UNMutableNotificationContent *bestAttemptContent;
10+
11+
@end
12+
13+
@implementation NotificationService
14+
15+
- (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler {
16+
self.receivedRequest = request;
17+
self.contentHandler = contentHandler;
18+
self.bestAttemptContent = [request.content mutableCopy];
19+
20+
[OneSignal didReceiveNotificationExtensionRequest:self.receivedRequest withMutableNotificationContent:self.bestAttemptContent];
21+
22+
// DEBUGGING: Uncomment the 2 lines below and comment out the one above to ensure this extension is excuting
23+
// Note, this extension only runs when mutable-content is set
24+
// Setting an attachment or action buttons automatically adds this
25+
// NSLog(@"Running NotificationServiceExtension");
26+
// self.bestAttemptContent.body = [@"[Modified] " stringByAppendingString:self.bestAttemptContent.body];
27+
28+
self.contentHandler(self.bestAttemptContent);
29+
}
30+
31+
- (void)serviceExtensionTimeWillExpire {
32+
// Called just before the extension will be terminated by the system.
33+
// Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used.
34+
35+
[OneSignal serviceExtensionTimeWillExpireRequest:self.receivedRequest withMutableNotificationContent:self.bestAttemptContent];
36+
37+
self.contentHandler(self.bestAttemptContent);
38+
}
39+
40+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>aps-environment</key>
6+
<string>development</string>
7+
</dict>
8+
</plist>
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
m_EditorVersion: 2017.4.0f1
1+
m_EditorVersion: 2017.3.0f3

OneSignalSDK.unitypackage

-3.42 MB
Binary file not shown.

0 commit comments

Comments
 (0)