iOS Question Firebase Push Notifications - Reset Token

aaronk

Well-Known Member
Licensed User
Longtime User
Hi,

I am using firebase push notifications and just wondering if there is a way in resetting the token ?

In B4A you can do it with this code but just wondering if there is something like this for B4i ?
 

aaronk

Well-Known Member
Licensed User
Longtime User
I was hoping to clear all notifications that the user is subscribed to without knowing which topics they are already subscribed to.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
1. Add this code:
B4X:
#if OBJC
#import <FirebaseInstanceId/FirebaseInstanceId.h>
- (void)DeleteInstanceId {
  [[FIRInstanceID instanceID] deleteIDWithHandler:^void(NSError *_Nullable error){
    if (error) {
      NSLog(@"Error: %@", error);
    } else {
     NSLog(@"Deleted");
    }
  }];
}
#End If

2.
B4X:
#AdditionalLib: FirebaseInstanceId.framework.3

3.
B4X:
Dim no As NativeObject = Me
no.RunMethod("DeleteInstanceId", Null)
 
Upvote 0
Top