2013-11-01 22 views
3

我想價值parse.com添加到安裝表通道,但我收到此錯誤:將值添加到parse.com中的通道時出錯在android中安裝表?

java.lang.IllegalArgumentException: invalid channel name

我試圖添加與數值開始的價值,但它可以插入時的值以字符串開頭。我該如何解決這個問題?

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

謝謝。

回答

0

此代碼對我的作品

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 
        } 
       } 
      }); 
相關問題