Skip to content

Commit

Permalink
[feature][PUSH-32013]Support Android 13 notification permission
Browse files Browse the repository at this point in the history
  • Loading branch information
wfhm committed Jul 22, 2022
1 parent d727226 commit 138b10d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions PluginSource/Android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ ext {
global_minSdk = 16
global_targetSdk = 29
global_buildToolsSdk = "27.0.1"
global_versionName = "6.1.2"
pushwoosh = "6.0.0"
global_versionName = ""
pushwoosh = "6.6.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import com.pushwoosh.GDPRManager;
import com.pushwoosh.Pushwoosh;
import com.pushwoosh.RegisterForPushNotificationsResultData;
import com.pushwoosh.badge.PushwooshBadge;
import com.pushwoosh.exception.GetTagsException;
import com.pushwoosh.exception.PushwooshException;
Expand Down Expand Up @@ -84,11 +85,15 @@ public void onPause() {
}

public void registerForPushNotifications() {
Pushwoosh.getInstance().registerForPushNotifications(new Callback<String, RegisterForPushNotificationsException>() {
Pushwoosh.getInstance().registerForPushNotifications(new Callback<RegisterForPushNotificationsResultData, RegisterForPushNotificationsException>() {
@Override
public void process(@NonNull Result<String, RegisterForPushNotificationsException> result) {
public void process(@NonNull Result<RegisterForPushNotificationsResultData, RegisterForPushNotificationsException> result) {
if (result.isSuccess()) {
onRegisterEvent(result.getData());
if (result.getData() != null) {
onRegisterEvent(result.getData().getToken());
} else {
onRegisterErrorEvent("Failed to get push token from registration callback");
}
} else if (result.getException() != null) {
onRegisterErrorEvent(result.getException().getLocalizedMessage());
}
Expand Down

0 comments on commit 138b10d

Please sign in to comment.