Skip to content

Commit

Permalink
Merge pull request #88 from m1ga/master
Browse files Browse the repository at this point in the history
[bugfix][PUSH-33500] Update sdk versions
  • Loading branch information
wfhm authored Mar 2, 2023
2 parents 5bf9e68 + 3224b63 commit 56fa73f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Module-Source/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ext {
pushwoosh = "6.4.4"
pushwoosh = "6.6.9"
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion Module-Source/android/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# this is your module manifest and used by Titanium
# during compilation, packaging, distribution, etc.
#
version: 6.0.9
version: 6.1.0
apiversion: 4
architectures: arm64-v8a armeabi-v7a x86 x86_64
description: pushnotifications
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@
import androidx.annotation.NonNull;

import com.pushwoosh.Pushwoosh;
import com.pushwoosh.RegisterForPushNotificationsResultData;
import com.pushwoosh.badge.PushwooshBadge;
import com.pushwoosh.exception.GetTagsException;
import com.pushwoosh.exception.RegisterForPushNotificationsException;
import com.pushwoosh.function.Callback;
import com.pushwoosh.function.Result;
import com.pushwoosh.inapp.PushwooshInApp;
import com.pushwoosh.inapp.InAppManager;
import com.pushwoosh.internal.utils.JsonUtils;
import com.pushwoosh.notification.LocalNotification;
import com.pushwoosh.notification.LocalNotificationReceiver;
Expand Down Expand Up @@ -149,11 +150,11 @@ public void registerForPushNotifications(KrollFunction success, KrollFunction er
registrationSuccessCallback.set(success);
registrationErrorCallback.set(error);

Pushwoosh.getInstance().registerForPushNotifications(new Callback<String, RegisterForPushNotificationsException>() {
Pushwoosh.getInstance().registerForPushNotifications(new Callback<RegisterForPushNotificationsResultData, RegisterForPushNotificationsException>() {
@Override
public void process(Result<String, RegisterForPushNotificationsException> result) {
public void process(@NonNull Result<RegisterForPushNotificationsResultData, RegisterForPushNotificationsException> result) {
if (result.isSuccess()) {
onRegistrationSucceed(result.getData());
onRegistrationSucceed(result.getData().getToken());
} else if (result.getException() != null) {
onRegistrationFailed(result.getException().getLocalizedMessage());
}
Expand All @@ -170,7 +171,7 @@ public void unregister() {

@Kroll.method
public void setTags(HashMap params) {
Pushwoosh.getInstance().sendTags(Tags.fromJson(JsonUtils.mapToJson(params)), null);
Pushwoosh.getInstance().setTags(Tags.fromJson(JsonUtils.mapToJson(params)), null);
}

@Kroll.method
Expand Down Expand Up @@ -240,12 +241,12 @@ public void addBadgeNumber(int deltaBadge) {

@Kroll.method
public void setUserId(String userId) {
PushwooshInApp.getInstance().setUserId(userId);
Pushwoosh.getInstance().setUserId(userId);
}

@Kroll.method
public void postEvent(String event, HashMap<String, Object> attributes) {
PushwooshInApp.getInstance().postEvent(event, Tags.fromJson(JsonUtils.mapToJson((Map<String, Object>) attributes)));
InAppManager.getInstance().postEvent(event, Tags.fromJson(JsonUtils.mapToJson((Map<String, Object>) attributes)));
}

@Kroll.method
Expand Down

0 comments on commit 56fa73f

Please sign in to comment.