Android (Java): Parse.com 没有订阅不是硬编码字符串的频道?
Android (Java): Parse.com not subscribing to channel that isn't a hard-coded string?
当我在 parse.com 服务上订阅了几个频道时,它工作得很好,就像这样:
ParseInstallation installation = ParseInstallation.getCurrentInstallation();
installation.addAllUnique("channels", Arrays.asList("CHANNEL_1", "CHANNEL_2", "CHANNEL_3", "CHANNEL_4"));
installation.saveInBackground();
但是,当我不对字符串进行硬编码时,它不起作用吗?
ParseInstallation installation = ParseInstallation.getCurrentInstallation();
String spinnerValue= mySpinner.getSelectedItem().toString();
installation.addAllUnique("channels", Arrays.asList(spinnerValue, "CHANNEL_2", "CHANNEL_3", "CHANNEL_4"));
installation.saveInBackground();
有谁知道为什么会这样?使用 Parse.com 时是否必须对所有通道进行硬编码?
您的值 spinnerValue
(“8”)不是有效的频道名称。因此,订阅不起作用。
当我在 parse.com 服务上订阅了几个频道时,它工作得很好,就像这样:
ParseInstallation installation = ParseInstallation.getCurrentInstallation();
installation.addAllUnique("channels", Arrays.asList("CHANNEL_1", "CHANNEL_2", "CHANNEL_3", "CHANNEL_4"));
installation.saveInBackground();
但是,当我不对字符串进行硬编码时,它不起作用吗?
ParseInstallation installation = ParseInstallation.getCurrentInstallation();
String spinnerValue= mySpinner.getSelectedItem().toString();
installation.addAllUnique("channels", Arrays.asList(spinnerValue, "CHANNEL_2", "CHANNEL_3", "CHANNEL_4"));
installation.saveInBackground();
有谁知道为什么会这样?使用 Parse.com 时是否必须对所有通道进行硬编码?
您的值 spinnerValue
(“8”)不是有效的频道名称。因此,订阅不起作用。