@Test public void saveInBackground_error_none_deviceToken() throws Exception { NCMBException error = null; NCMBInstallation installation = new NCMBInstallation(); try { installation.save(); } catch (NCMBException e) { error = e; } Assert.assertNotNull(error); Assert.assertEquals("java.lang.IllegalArgumentException: registrationId is must not be null.", error.getMessage()); }
public void save() throws NCMBException { NCMBInstallationService installationService = (NCMBInstallationService) NCMB.factory(NCMB.ServiceType.INSTALLATION); JSONObject responseData; if (getObjectId() == null) { responseData = installationService.createInstallation(getLocalDeviceToken(), mFields); } else { JSONObject updateJson = null; try { updateJson = createUpdateJsonData(); } catch (JSONException e) { throw new IllegalArgumentException(e.getMessage()); } responseData = installationService.updateInstallation(getObjectId(), updateJson); } setLocalData(responseData); mUpdateKeys.clear(); }
NCMBInstallation extends NCMBObject { public void save() throws NCMBException { NCMBInstallationService installationService = (NCMBInstallationService) NCMB.factory(NCMB.ServiceType.INSTALLATION); JSONObject responseData; if (getObjectId() == null) { responseData = installationService.createInstallation(getLocalDeviceToken(), mFields); } else { JSONObject updateJson = null; try { updateJson = createUpdateJsonData(); } catch (JSONException e) { throw new IllegalArgumentException(e.getMessage()); } responseData = installationService.updateInstallation(getObjectId(), updateJson); } setLocalData(responseData); mUpdateKeys.clear(); } }
NCMBInstallation extends NCMBObject { public void save() throws NCMBException { NCMBInstallationService installationService = (NCMBInstallationService) NCMB.factory(NCMB.ServiceType.INSTALLATION); JSONObject responseData; if (getObjectId() == null) { responseData = installationService.createInstallation(getLocalDeviceToken(), mFields); } else { JSONObject updateJson = null; try { updateJson = createUpdateJsonData(); } catch (JSONException e) { throw new IllegalArgumentException(e.getMessage()); } responseData = installationService.updateInstallation(getObjectId(), updateJson); } setLocalData(responseData); mUpdateKeys.clear(); } NCMBInstallation();   NCMBInstallation(JSONObject params); }
NCMBInstallation extends NCMBObject { public void save() throws NCMBException { NCMBInstallationService installationService = (NCMBInstallationService) NCMB.factory(NCMB.ServiceType.INSTALLATION); JSONObject responseData; if (getObjectId() == null) { responseData = installationService.createInstallation(getLocalDeviceToken(), mFields); } else { JSONObject updateJson = null; try { updateJson = createUpdateJsonData(); } catch (JSONException e) { throw new IllegalArgumentException(e.getMessage()); } responseData = installationService.updateInstallation(getObjectId(), updateJson); } setLocalData(responseData); mUpdateKeys.clear(); } NCMBInstallation();   NCMBInstallation(JSONObject params); String getApplicationName(); String getAppVersion(); int getBadge(); JSONArray getChannels(); String getDeviceType(); String getDeviceToken(); void getDeviceTokenInBackground(final TokenCallback callback); String getSDKVersion(); String getTimeZone(); Object getValue(String name); void setApplicationName(String value); void setBadge(int value); void setChannels(JSONArray value); void setDeviceToken(String value); static NCMBInstallation getCurrentInstallation(); static NCMBQuery<NCMBInstallation> getQuery(); static void subscribe(String channel, Class<? extends Activity> activity); static void subscribe(String channelName, Class<? extends Activity> activity, int icon); static void unsubscribe(String channelName); static Set<String> getSubscriptions(); void save(); void saveInBackground(); void saveInBackground(final DoneCallback callback); @Override void fetch(); @Override void fetchInBackground(final FetchCallback callback); void delete(); void deleteInBackground(); void deleteInBackground(final DoneCallback callback); }
NCMBInstallation extends NCMBObject { public void save() throws NCMBException { NCMBInstallationService installationService = (NCMBInstallationService) NCMB.factory(NCMB.ServiceType.INSTALLATION); JSONObject responseData; if (getObjectId() == null) { responseData = installationService.createInstallation(getLocalDeviceToken(), mFields); } else { JSONObject updateJson = null; try { updateJson = createUpdateJsonData(); } catch (JSONException e) { throw new IllegalArgumentException(e.getMessage()); } responseData = installationService.updateInstallation(getObjectId(), updateJson); } setLocalData(responseData); mUpdateKeys.clear(); } NCMBInstallation();   NCMBInstallation(JSONObject params); String getApplicationName(); String getAppVersion(); int getBadge(); JSONArray getChannels(); String getDeviceType(); String getDeviceToken(); void getDeviceTokenInBackground(final TokenCallback callback); String getSDKVersion(); String getTimeZone(); Object getValue(String name); void setApplicationName(String value); void setBadge(int value); void setChannels(JSONArray value); void setDeviceToken(String value); static NCMBInstallation getCurrentInstallation(); static NCMBQuery<NCMBInstallation> getQuery(); static void subscribe(String channel, Class<? extends Activity> activity); static void subscribe(String channelName, Class<? extends Activity> activity, int icon); static void unsubscribe(String channelName); static Set<String> getSubscriptions(); void save(); void saveInBackground(); void saveInBackground(final DoneCallback callback); @Override void fetch(); @Override void fetchInBackground(final FetchCallback callback); void delete(); void deleteInBackground(); void deleteInBackground(final DoneCallback callback);  }