Skip to content

Commit

Permalink
Merge pull request #91 from xendit/fix/cc-6939-add-unregisterAllBroad…
Browse files Browse the repository at this point in the history
…cast

[CC-6939] Add method unregisterAllBroadcastReceiver
  • Loading branch information
andysg012 authored Aug 8, 2022
2 parents ad46912 + 0a71be5 commit 5f80832
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion xendit-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'

group 'com.xendit'
version '3.6.2'
version '3.6.3'

ext {
bintrayOrg = 'xendit'
Expand Down
14 changes: 14 additions & 0 deletions xendit-android/src/main/java/com/xendit/Xendit.java
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,20 @@ public void onFailure(NetworkError error) {
}));
}

public void unregisterAllBroadcastReceiver() {
if (authenticationBroadcastReceiver != null) {
context.unregisterReceiver(authenticationBroadcastReceiver);
}

if (tokenBroadcastReceiver != null) {
context.unregisterReceiver(tokenBroadcastReceiver);
}

if (authenticatedTokenBroadcastReceiver != null) {
context.unregisterReceiver(authenticatedTokenBroadcastReceiver);
}
}

private void registerBroadcastReceiver(final AuthenticationCallback authenticationCallback) {
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
Expand Down

0 comments on commit 5f80832

Please sign in to comment.