我需要一种方式让用户订阅某些频道。我在解析.com
的安装示例中使用了示例来创建通道。
PushService.subscribe(context"Giants",MainActivity.class);
现在创建了频道,我需要一种方法让用户选择是否要订阅该频道。
有人可以帮忙吗?
答案 0 :(得分:3)
我找到了解决方案。对于任何感兴趣的人来说,这是一个能够正确完成工作的代码片段:
public void onClick(View v) {
String loc = localitate.getSelectedItem().toString();
String str = strada.getText().toString();
sendFeedback (loc,str);
private void sendFeedback(String loc, String str) {
// TODO Auto-generated method stub
ParseInstallation installation = ParseInstallation.getCurrentInstallation();
installation.addAllUnique("channels", Arrays.asList(loc+str));
installation.saveInBackground();