Skip to content

Commit ad36e12

Browse files
pushwooshpushwoosh
authored andcommitted
Release 2.3.6
1 parent c6deec2 commit ad36e12

File tree

13 files changed

+29
-37
lines changed

13 files changed

+29
-37
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ body:
5858
label: Your Pushwoosh Flutter plugin version
5959
description: Your version of the Flutter plugin integrated into the application. You may find it on the [releases page](https://github.com/Pushwoosh/pushwoosh-flutter/releases)
6060
options:
61+
- 2.3.6
6162
- 2.3.5
6263
- 2.3.4
6364
- 2.3.3

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Pushwoosh Flutter Plugin
1515

1616
```yaml
1717
dependencies:
18-
pushwoosh_flutter: '^2.3.5'
18+
pushwoosh_flutter: '^2.3.6'
1919
```
2020
2121
2\. Configure Firebase Android project in [Firebase console](https://console.firebase.google.com).

Source/pushwoosh/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,3 +394,8 @@
394394
## 2.3.5
395395
### Added
396396
* ```setEmail```, ```setEmails```, ```setUserEmails``` methods added
397+
398+
## 2.3.6
399+
### Fixed
400+
* Correctly implemented swizzling for ```application:didReceiveRemoteNotification:fetchCompletionHandler:``` method.
401+

Source/pushwoosh/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
```yaml
66
dependencies:
7-
pushwoosh_flutter: '^2.3.5'
7+
pushwoosh_flutter: '^2.3.6'
88
```
99
1010
2) Configure Firebase Android project in [Firebase console](https://console.firebase.google.com).

Source/pushwoosh/ios/Classes/PushwooshPlugin.m

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
#define kPushwooshPluginImplementationInfoPlistKey @"Pushwoosh_PLUGIN_NOTIFICATION_HANDLER"
1212

13+
static IMP pw_original_didReceiveRemoteNotification_Imp;
14+
1315
@interface NSError (FlutterError)
1416

1517
@property(readonly, nonatomic) FlutterError *flutterError;
@@ -36,24 +38,8 @@ @interface PushwooshPlugin () <PushNotificationDelegate>
3638
@property (nonatomic) NSString *cachedDeepLink;
3739
@property (nonatomic) NSString *lastPushwooshHash;
3840

39-
- (void) application:(UIApplication *)application pwplugin_didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler;
40-
4141
@end
4242

43-
void pushwoosh_swizzle(Class class, SEL fromChange, SEL toChange, IMP impl, const char * signature) {
44-
Method method = nil;
45-
method = class_getInstanceMethod(class, fromChange);
46-
47-
if (method) {
48-
//method exists add a new method and swap with original
49-
class_addMethod(class, toChange, impl, signature);
50-
method_exchangeImplementations(class_getInstanceMethod(class, fromChange), class_getInstanceMethod(class, toChange));
51-
} else {
52-
//just add as orignal method
53-
class_addMethod(class, fromChange, impl, signature);
54-
}
55-
}
56-
5743
@implementation PushwooshPlugin {
5844
API_AVAILABLE(ios(10))
5945
__weak id<UNUserNotificationCenterDelegate> _originalNotificationCenterDelegate;
@@ -121,7 +107,15 @@ + (void) swizzleNotificationSettingsHandler {
121107
return;
122108
}
123109

124-
pushwoosh_swizzle([self class], @selector(application:didReceiveRemoteNotification:fetchCompletionHandler:), @selector(application:pwplugin_didReceiveRemoteNotification:fetchCompletionHandler:), (IMP)pwplugin_didReceiveRemoteNotification, "v@::::");
110+
Class delegateClass = [delegate class];
111+
Method originalMethod = class_getInstanceMethod(delegateClass, @selector(application:didReceiveRemoteNotification:fetchCompletionHandler:));
112+
pw_original_didReceiveRemoteNotification_Imp = method_setImplementation(originalMethod, (IMP)_replacement_didReceiveRemoteNotification);
113+
}
114+
115+
void _replacement_didReceiveRemoteNotification(id self, SEL _cmd, UIApplication * application, NSDictionary * userInfo, void (^completionHandler)(UIBackgroundFetchResult)) {
116+
((void(*)(id, SEL, UIApplication *, NSDictionary *, void(^)(UIBackgroundFetchResult)))pw_original_didReceiveRemoteNotification_Imp)(self, _cmd, application, userInfo, completionHandler);
117+
118+
[[PushNotificationManager pushManager] handlePushReceived:userInfo];
125119
}
126120

127121
#pragma mark - FlutterPlugin
@@ -285,14 +279,6 @@ + (BOOL)isSystemVersionGreaterOrEqualTo:(NSString *)systemVersion {
285279
return ([[[UIDevice currentDevice] systemVersion] compare:systemVersion options:NSNumericSearch] != NSOrderedAscending);
286280
}
287281

288-
void pwplugin_didReceiveRemoteNotification(id self, SEL _cmd, UIApplication * application, NSDictionary * userInfo, void (^completionHandler)(UIBackgroundFetchResult)) {
289-
if ([self respondsToSelector:@selector(application:pwplugin_didReceiveRemoteNotification:fetchCompletionHandler:)]) {
290-
[self application:application pwplugin_didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
291-
}
292-
293-
[[Pushwoosh sharedInstance] handlePushReceived:userInfo];
294-
}
295-
296282
#pragma mark - UNUserNotificationCenter Delegate Methods
297283
#pragma mark -
298284

Source/pushwoosh/ios/pushwoosh_flutter.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
Pod::Spec.new do |s|
55
s.name = 'pushwoosh_flutter'
6-
s.version = '2.3.5'
6+
s.version = '2.3.6'
77
s.summary = 'Pushwoosh Flutter plugin'
88
s.homepage = 'https://pushwoosh.com'
99
s.license = { :file => '../LICENSE' }

Source/pushwoosh/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: pushwoosh_flutter
22
description: This plugin allows you to receive push notifications. Powered by Pushwoosh (www.pushwoosh.com).
3-
version: 2.3.5
3+
version: 2.3.6
44
homepage: https://www.pushwoosh.com/
55

66
dependencies:

Source/pushwoosh_geozones/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Install the library from pub:
44

55
```yaml
66
dependencies:
7-
pushwoosh_geozones: '^2.3.5'
7+
pushwoosh_geozones: '^2.3.6'
88
```
99
1010
## Usage

Source/pushwoosh_geozones/ios/pushwoosh_geozones.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
Pod::Spec.new do |s|
55
s.name = 'pushwoosh_geozones'
6-
s.version = '2.3.5'
6+
s.version = '2.3.6'
77
s.summary = 'Pushwoosh Geozones Flutter plugin'
88
s.homepage = 'http://pushwoosh.com'
99
s.license = { :file => '../LICENSE' }

Source/pushwoosh_geozones/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
name: pushwoosh_geozones
22
description: This plugin enables Pushwoosh Geozones feature.
3-
version: 2.3.5
3+
version: 2.3.6
44
homepage: https://www.pushwoosh.com/v1.0/docs/geozones
55

66
dependencies:
77
flutter:
88
sdk: flutter
9-
pushwoosh_flutter: ^2.3.5
9+
pushwoosh_flutter: ^2.3.6
1010

1111
environment:
1212
sdk: '>=2.12.0 <4.0.0'

Source/pushwoosh_inbox/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Install the library from pub:
44

55
```yaml
66
dependencies:
7-
pushwoosh_inbox: '^2.3.5'
7+
pushwoosh_inbox: '^2.3.6'
88
```
99
1010
## Usage

Source/pushwoosh_inbox/ios/pushwoosh_inbox.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
Pod::Spec.new do |s|
55
s.name = 'pushwoosh_inbox'
6-
s.version = '2.3.5'
6+
s.version = '2.3.6'
77
s.summary = 'Pushwoosh Inbox Flutter plugin'
88
s.homepage = 'http://pushwoosh.com'
99
s.license = { :file => '../LICENSE' }

Source/pushwoosh_inbox/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
name: pushwoosh_inbox
22
description: This plugin enables Pushwoosh Inbox feature.
3-
version: 2.3.5
3+
version: 2.3.6
44
homepage: https://www.pushwoosh.com/v1.0/docs/message-inbox
55

66
dependencies:
77
flutter:
88
sdk: flutter
9-
pushwoosh_flutter: ^2.3.5
9+
pushwoosh_flutter: ^2.3.6
1010

1111
environment:
1212
sdk: '>=2.12.0 <4.0.0'

0 commit comments

Comments
 (0)