gpt4 book ai didi

android - 向 parse.com 安装表中的 channel 添加值时出错?

转载 作者:太空狗 更新时间:2023-10-29 15:08:10 25 4
gpt4 key购买 nike

我正在尝试为 parse.com 中的安装表中的 channel 添加值,但出现此错误:

java.lang.IllegalArgumentException: invalid channel name

我正在尝试添加以数字值开头的值,但当值以字符串 开头时它会被插入。我该如何解决这个问题?

ParseInstallation install = ParseInstallation.getCurrentInstallation();
PushService.subscribe(getApplicationContext(), value, <currentClass>.class);
install.saveInBackground();

谢谢。

最佳答案

这段代码对我有用

ArrayList<String> channelsToAdd = new ArrayList<String>();
ParseInstallation.getCurrentInstallation().addAllUnique("channels", channelsToAdd);
ParseInstallation.getCurrentInstallation().saveInBackground(
new SaveCallback() {
@Override
public void done(ParseException e) {
if (e == null) {
//success
} else {
//error
}
}
});

关于android - 向 parse.com 安装表中的 channel 添加值时出错?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19721594/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com