fbsamples / messenger-bot-samples

Messenger Bot Samples
Other
555 stars 441 forks source link

The method callThreadAPI is missing #40

Closed gonmartinez closed 5 years ago

gonmartinez commented 5 years ago

The method callThreadAPI() is missing in api.js at the projects 'gui-webview' and 'account-linking'

Calls to the method that are failing

thread-setup.js

const setDomainWhitelisting = () => {
  api.callThreadAPI(
    {
      setting_type: 'domain_whitelisting',
      whitelisted_domains: [SERVER_URL],
      domain_action_type: 'add',
    }
  );
};

const setPersistentMenu = () => {
  api.callThreadAPI(messages.persistentMenu);
};

Throwing the following error

TypeError: _api2.default.callThreadAPI is not a function at Object.setDomainWhitelisting (C:/Users/gmartinez/Downloads/messenger-bot-samples/gui-webview/messenger-api-helpers/thread-setup.js:30:7) at Object. (C:/Users/gmartinez/Downloads/messenger-bot-samples/gui-webview/app.js:84:13) at Module._compile (internal/modules/cjs/loader.js:689:30) at loader (C:\Users\gmartinez\Downloads\messenger-bot-samples\gui-webview\node_modules\babel-register\lib\node.js:144:5) at Object.require.extensions.(anonymous function) [as .js] (C:\Users\gmartinez\Downloads\messenger-bot-samples\gui-webview\node_modules\babel-register\lib\node.js:154:7) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:22:18) error Command failed with exit code 1.

embee8 commented 5 years ago

Thanks for reporting this, @gonmartinez. I found that the references were only outdated in the gui-webview project and just updated the incorrect function calls.