This repository was archived by the owner on Jan 14, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +15
-10
lines changed
android/src/main/java/com/dieam/reactnativepushnotification/modules Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -265,11 +265,16 @@ public void removeDeliveredNotifications(ReadableArray identifiers) {
265265 * Unregister for all remote notifications received
266266 */
267267 public void abandonPermissions () {
268- try {
269- FirebaseInstanceId .getInstance ().deleteInstanceId ();
270- } catch (IOException e ) {
271- Log .e (LOG_TAG , "exception" , e );
272- return ;
273- }
268+ new Thread (new Runnable () {
269+ @ Override
270+ public void run () {
271+ try {
272+ FirebaseInstanceId .getInstance ().deleteInstanceId ();
273+ Log .i (LOG_TAG , "InstanceID deleted" );
274+ } catch (IOException e ) {
275+ Log .e (LOG_TAG , "exception" , e );
276+ }
277+ }
278+ }).start ();
274279 }
275280}
Original file line number Diff line number Diff line change @@ -127,6 +127,10 @@ NotificationsComponent.prototype.removeDeliveredNotifications = function(identif
127127 RNPushNotification . removeDeliveredNotifications ( identifiers ) ;
128128}
129129
130+ NotificationsComponent . prototype . abandonPermissions = function ( ) {
131+ RNPushNotification . abandonPermissions ( ) ;
132+ }
133+
130134module . exports = {
131135 state : false ,
132136 component : new NotificationsComponent ( )
Original file line number Diff line number Diff line change @@ -102,10 +102,6 @@ export default class App extends Component {
102102 style = { styles . button }
103103 onPress = { ( ) => {
104104 this . notif . abandonPermissions ( ) ;
105- Alert . alert (
106- 'Abandon Permissions' ,
107- 'Reload the app to register again with a new token'
108- ) ;
109105 } } >
110106 < Text > Abandon Permissions</ Text >
111107 </ TouchableOpacity >
You can’t perform that action at this time.
0 commit comments