protected <T> T send(Class<T> objectType, Parameter... parameters) { requireNonNull(objectType, "'objectType' must not be null"); return facebookClient.publish(MESSAGES_PATH, objectType, parameters); } }
@Override public void setGreeting(Greeting greeting) throws FacebookException { requireNonNull(greeting, "'greeting' must not be null"); facebookClient.publish(THREAD_SETTINGS_PATH, SendResponse.class, Parameter.with(SETTING_TYPE_PARAM_NAME, SettingTypeEnum.greeting), Parameter.with(GREETING_PARAM_NAME, greeting)); }
@Override public void setAccountLinkingUrl(String url) throws FacebookException { requireNonNull(url, "'url' must not be null"); facebookClient.publish(THREAD_SETTINGS_PATH, SendResponse.class, Parameter.with(SETTING_TYPE_PARAM_NAME, SettingTypeEnum.account_linking), Parameter.with(ACCOUNT_LINKING_URL_PARAM_NAME, url)); }
@Override public void setGetStartedButton(CallToAction callToAction) throws FacebookException { requireNonNull(callToAction, "'callToAction' must not be null"); List<CallToAction> callToActions = Arrays.asList(callToAction); facebookClient.publish(THREAD_SETTINGS_PATH, SendResponse.class, Parameter.with(SETTING_TYPE_PARAM_NAME, SettingTypeEnum.call_to_actions), Parameter.with(THREAD_STATE_PARAM_NAME, ThreadStateEnum.new_thread), Parameter.with(CALL_TO_ACTIONS_PARAM_NAME, callToActions)); }
@Override public void removeDomainWhitelisting(List<String> urls) throws FacebookException { requireNonNull(urls, "'urls' must not be null"); facebookClient.publish(THREAD_SETTINGS_PATH, SendResponse.class, Parameter.with(SETTING_TYPE_PARAM_NAME, SettingTypeEnum.domain_whitelisting), Parameter.with(WHITELISTED_DOMAINS_PARAM_NAME, urls), Parameter.with(DOMAIN_ACTION_TYPE_PARAM_NAME, DomainActionTypeEnum.remove)); }
@Override public void addDomainWhitelisting(List<String> urls) throws FacebookException { requireNonNull(urls, "'urls' must not be null"); facebookClient.publish(THREAD_SETTINGS_PATH, SendResponse.class, Parameter.with(SETTING_TYPE_PARAM_NAME, SettingTypeEnum.domain_whitelisting), Parameter.with(WHITELISTED_DOMAINS_PARAM_NAME, urls), Parameter.with(DOMAIN_ACTION_TYPE_PARAM_NAME, DomainActionTypeEnum.add)); }
@Override public void setPersistentMenu(List<CallToAction> callToActions) throws FacebookException { requireNonNull(callToActions, "'callToActions' must not be null"); facebookClient.publish(THREAD_SETTINGS_PATH, SendResponse.class, Parameter.with(SETTING_TYPE_PARAM_NAME, SettingTypeEnum.call_to_actions), Parameter.with(THREAD_STATE_PARAM_NAME, ThreadStateEnum.existing_thread), Parameter.with(CALL_TO_ACTIONS_PARAM_NAME, callToActions)); }
fbClient.publish(pageID + "/feed", FacebookType.class, Parameter.with("message", Integer.toString(counter) + ": Hello, facebook World!")); counter++;