Skip to content

Commit

Permalink
Android User bridge methods should resolve
Browse files Browse the repository at this point in the history
* A few methods were missing the `replySuccess` to resolve the call from the app developer.
  • Loading branch information
nan-li committed Jan 31, 2024
1 parent 92a2d61 commit 85526ba
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,15 @@ private void setLanguage(MethodCall call, Result result) {
language = null;
}
OneSignal.getUser().setLanguage(language);
replySuccess(result, null);
}

private void addAliases(MethodCall call, Result result) {
// call.arguments is being casted to a Map<String, Object> so a try-catch with
// a ClassCastException will be thrown
try {
OneSignal.getUser().addAliases((Map<String, String>) call.arguments);
replySuccess(result, null);
} catch(ClassCastException e) {
replyError(result, "OneSignal", "addAliases failed with error: " + e.getMessage() + "\n" + e.getStackTrace(), null);
}
Expand All @@ -75,6 +77,7 @@ private void removeAliases(MethodCall call, Result result) {
// a ClassCastException will be thrown
try {
OneSignal.getUser().removeAliases((List<String>) call.arguments);
replySuccess(result, null);
} catch(ClassCastException e) {
replyError(result, "OneSignal", "removeAliases failed with error: " + e.getMessage() + "\n" + e.getStackTrace(), null);
}
Expand Down Expand Up @@ -105,6 +108,7 @@ private void addTags(MethodCall call, Result result) {
// a ClassCastException will be thrown
try {
OneSignal.getUser().addTags((Map<String, String>) call.arguments);
replySuccess(result, null);
} catch(ClassCastException e) {
replyError(result, "OneSignal", "addTags failed with error: " + e.getMessage() + "\n" + e.getStackTrace(), null);
}
Expand All @@ -115,6 +119,7 @@ private void removeTags(MethodCall call, Result result) {
// a ClassCastException will be thrown
try {
OneSignal.getUser().removeTags((List<String>) call.arguments);
replySuccess(result, null);
} catch(ClassCastException e) {
replyError(result, "OneSignal", "deleteTags failed with error: " + e.getMessage() + "\n" + e.getStackTrace(), null);
}
Expand Down

0 comments on commit 85526ba

Please sign in to comment.