Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

Commit 808d922

Browse files
committed
Use directly the callNative for abandonPermissions.
1 parent 3113a3f commit 808d922

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1010
### Features
1111

1212
- (Android) Call `onRegister` when [Firebase renew token](<https://firebase.google.com/docs/reference/android/com/google/firebase/messaging/FirebaseMessagingService#onNewToken(java.lang.String)>).
13+
- (Android) Added Abandon Permissions method to Android [#1425](https://github.com/zo0r/react-native-push-notification/pull/1425)
1314
- (Android) Add a new key in `AndroidManifest.xml` to allow/remove notification in foreground.
1415

1516
```xml
@@ -20,6 +21,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2021
### Fixed
2122

2223
- (Android) `number` and `id` are now correctly handled as number in Android.
24+
- Make sure to import PushNotificationIOS from react-native first [#617](https://github.com/zo0r/react-native-push-notification/pull/617)
2325

2426
## [3.3.1] - 2020-05-01
2527

component/index.android.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,6 @@ NotificationsComponent.prototype.removeDeliveredNotifications = function(identif
127127
RNPushNotification.removeDeliveredNotifications(identifiers);
128128
}
129129

130-
NotificationsComponent.prototype.abandonPermissions = function() {
131-
RNPushNotification.abandonPermissions();
132-
}
133-
134130
module.exports = {
135131
state: false,
136132
component: new NotificationsComponent()

index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,6 @@ Notifications.localNotificationSchedule = function(details) {
204204
}
205205
};
206206

207-
/* Abandon Permissions */
208-
Notifications.abandonPermissions = function() {
209-
this.handler.abandonPermissions();
210-
}
211-
212207
/* Internal Functions */
213208
Notifications._onRegister = function(token) {
214209
if ( this.onRegister !== false ) {
@@ -340,6 +335,11 @@ Notifications.checkPermissions = function() {
340335
return this.callNative('checkPermissions', arguments);
341336
};
342337

338+
/* Abandon Permissions */
339+
Notifications.abandonPermissions = function() {
340+
return this.callNative('abandonPermissions', arguments);
341+
}
342+
343343
Notifications.registerNotificationActions = function() {
344344
return this.callNative('registerNotificationActions', arguments)
345345
}

0 commit comments

Comments
 (0)