Skip to content

Commit

Permalink
Release 1.23.34
Browse files Browse the repository at this point in the history
  • Loading branch information
gbhrdt committed Sep 25, 2024
1 parent ed86a01 commit 4fdce35
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 1.23.34 (25.09.2024)
* Implemented `setIgnoreDisabledNotificationPermission`

## 1.23.33 (18.09.2024)
* Updated native iOS + Android SDKs

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ public void onMethodCall(MethodCall call, Result result) {
this.setTrackingConsentRequired(call, result);
} else if (call.method.contentEquals("CleverPush#setTrackingConsent")) {
this.setTrackingConsent(call, result);
} else if (call.method.contentEquals("CleverPush#setIgnoreDisabledNotificationPermission")) {
this.setIgnoreDisabledNotificationPermission(call, result);
} else if (call.method.contentEquals("CleverPush#setBrandingColor")) {
this.setBrandingColor(call, result);
} else if (call.method.contentEquals("CleverPush#enableAppBanners")) {
Expand Down Expand Up @@ -602,6 +604,12 @@ private void setTrackingConsent(MethodCall call, final Result result) {
replySuccess(result, null);
}

private void setIgnoreDisabledNotificationPermission(MethodCall call, final Result result) {
Boolean ignore = call.argument("ignore");
CleverPush.getInstance(context).setIgnoreDisabledNotificationPermission(ignore);
replySuccess(result, null);
}

private void setBrandingColor(MethodCall call, final Result result) {
String color = call.argument("color");
CleverPush.getInstance(context).setBrandingColor(ColorUtils.parseColor(color));
Expand Down
7 changes: 7 additions & 0 deletions ios/Classes/CleverPushPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
[self setTrackingConsentRequired:call withResult:result];
else if ([@"CleverPush#setTrackingConsent" isEqualToString:call.method])
[self setTrackingConsent:call withResult:result];
else if ([@"CleverPush#setIgnoreDisabledNotificationPermission" isEqualToString:call.method])
[self setIgnoreDisabledNotificationPermission:call withResult:result];
else if ([@"CleverPush#setBrandingColor" isEqualToString:call.method])
[self setBrandingColor:call withResult:result];
else if ([@"CleverPush#enableAppBanners" isEqualToString:call.method])
Expand Down Expand Up @@ -359,6 +361,11 @@ - (void)setTrackingConsent:(FlutterMethodCall *)call withResult:(FlutterResult)r
result(nil);
}

- (void)setIgnoreDisabledNotificationPermission:(FlutterMethodCall *)call withResult:(FlutterResult)result {
[CleverPush setIgnoreDisabledNotificationPermission:[call.arguments[@"ignore"] boolValue]];
result(nil);
}

- (void)enableAppBanners:(FlutterMethodCall *)call withResult:(FlutterResult)result {
[CleverPush enableAppBanners];
result(nil);
Expand Down
4 changes: 4 additions & 0 deletions lib/cleverpush_flutter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ class CleverPush {
return await _channel.invokeMethod("CleverPush#setTrackingConsent", {'hasConsent': hasConsent});
}

Future<dynamic> setIgnoreDisabledNotificationPermission(bool ignore) async {
return await _channel.invokeMethod("CleverPush#setIgnoreDisabledNotificationPermission", {'ignore': ignore});
}

Future<dynamic> trackPageView(String url) async {
return await _channel.invokeMethod("CleverPush#trackPageView", {'url': url});
}
Expand Down

0 comments on commit 4fdce35

Please sign in to comment.