Skip to content

Commit 0181aba

Browse files
Nightsd01jkasten2
authored andcommitted
Remote Delegate Parameter
• Removes the `withDefaultDisplayType` convenience parameter from `OSNotificationDisplayTypeDelegate`'s `willPresentInFocusNotificationWithPayload:withCompletion` method • This parameter was provided as a convenience for developers so that if they wanted to use the existing default display type, they could just call the callback with this value • However to simplify things we will remove it, and developers can just call the callback with OneSignal.inFocusDisplayType to achieve the same goal
1 parent 9f564fc commit 0181aba

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

iOS_SDK/OneSignalSDK/Source/OneSignal.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ typedef void (^OSNotificationDisplayTypeResponse)(OSNotificationDisplayType disp
219219
// Allows apps to customize per-notification display-type
220220
@protocol OSNotificationDisplayTypeDelegate <NSObject>
221221
- (void)willPresentInFocusNotificationWithPayload:(OSNotificationPayload *)payload
222-
withDefaultDisplayType:(OSNotificationDisplayType)displayType
223222
withCompletion:(OSNotificationDisplayTypeResponse)completion;
224223
@end
225224

iOS_SDK/OneSignalSDK/Source/OneSignal.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1800,7 +1800,7 @@ + (void)displayTypeForNotificationPayload:(NSDictionary *)payload withCompletion
18001800
userInfo:notificationId
18011801
repeats:false];
18021802

1803-
[_displayDelegate willPresentInFocusNotificationWithPayload:osPayload withDefaultDisplayType:type withCompletion:^(OSNotificationDisplayType displayType) {
1803+
[_displayDelegate willPresentInFocusNotificationWithPayload:osPayload withCompletion:^(OSNotificationDisplayType displayType) {
18041804
[OneSignalHelper runOnMainThread:^{
18051805
NSMutableArray<OSNotificationDisplayTypeResponse> *callbacks = _pendingDisplayTypeCallbacks[notificationId];
18061806

iOS_SDK/OneSignalSDK/Source/OneSignalCommonDefines.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ typedef enum {GET, POST, HEAD, PUT, DELETE, OPTIONS, CONNECT, TRACE} HTTPMethod;
149149

150150
// Defines how long the SDK will wait for OSNotificationDisplayTypeDelegate to execute
151151
// the callback to set the display type for a given notification
152-
#define CUSTOM_DISPLAY_TYPE_TIMEOUT 0.2
152+
#define CUSTOM_DISPLAY_TYPE_TIMEOUT 0.05
153153
#endif
154154

155155
// A max timeout for a request, which might include multiple reattempts

iOS_SDK/OneSignalSDK/UnitTests/DummyNotificationDisplayTypeDelegate.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ - (instancetype)init {
3939
return self;
4040
}
4141

42-
- (void)willPresentInFocusNotificationWithPayload:(OSNotificationPayload *)payload withDefaultDisplayType:(OSNotificationDisplayType)displayType withCompletion:(OSNotificationDisplayTypeResponse)completion {
42+
- (void)willPresentInFocusNotificationWithPayload:(OSNotificationPayload *)payload
43+
withCompletion:(OSNotificationDisplayTypeResponse)completion {
4344
_notificationId = payload.notificationID;
4445

4546
if (_shouldFireCompletionBlock)

0 commit comments

Comments
 (0)