Commit 56692224 authored by Yusuke Iwaki's avatar Yusuke Iwaki

rename PushHelper::PushUpdate to PushHelper::Params

parent 6444696a
...@@ -23,10 +23,9 @@ public class PushHelper extends MethodCallHelper { ...@@ -23,10 +23,9 @@ public class PushHelper extends MethodCallHelper {
public Task<Void> pushUpdate(@NonNull String pushId, @NonNull String token, public Task<Void> pushUpdate(@NonNull String pushId, @NonNull String token,
@Nullable String userId) { @Nullable String userId) {
return call("raix:push-update", TIMEOUT_MS, () -> { return call("raix:push-update", TIMEOUT_MS,
JSONObject param = new PushUpdate(pushId, token, userId).toJson(); () -> new JSONArray().put(new Params(pushId, token, userId).toJson()))
return new JSONArray().put(param); .onSuccessTask(task -> Task.forResult(null));
}).onSuccessTask(task -> Task.forResult(null));
} }
public Task<Void> pushSetUser(String pushId) { public Task<Void> pushSetUser(String pushId) {
...@@ -34,19 +33,19 @@ public class PushHelper extends MethodCallHelper { ...@@ -34,19 +33,19 @@ public class PushHelper extends MethodCallHelper {
.onSuccessTask(task -> Task.forResult(null)); .onSuccessTask(task -> Task.forResult(null));
} }
private static class PushUpdate { private static class Params {
private String pushId; private String pushId;
private String gcmToken; private String gcmToken;
private String userId; private String userId;
PushUpdate(@NonNull String pushId, @NonNull String gcmToken, @Nullable String userId) { public Params(@NonNull String pushId, @NonNull String gcmToken, @Nullable String userId) {
this.pushId = pushId; this.pushId = pushId;
this.gcmToken = gcmToken; this.gcmToken = gcmToken;
this.userId = userId; this.userId = userId;
} }
JSONObject toJson() throws JSONException { public JSONObject toJson() throws JSONException {
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
param.put("id", pushId); param.put("id", pushId);
param.put("appName", "main"); param.put("appName", "main");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment