Dec 06 2020 10:29 PM
Hi,
I'd like to know how the following methods are triggered:
onInstallationUpdate, onInstallationUpdateAdd, onInstallationUpdateRemove
We updated our botbuilder-core package to 4.11.0. In our DialogBot class that extends ActivityHandler, we have added the following
this.onInstallationUpdateRemove(this._onInstallationUpdateRemove.bind(this))
this.onInstallationUpdateAdd(this._onInstallationUpdateAdd.bind(this))
this.onInstallationUpdate(this._onInstallationUpdate.bind(this))
All the event handlers do today is just to log that the event was triggered. For example
console.log("__onInstallationUpdateRemove triggered");
I am assuming these events are triggered when a user installs or removes the app from his Teams instance. However, when I tried to install or uninstall my bot from my Teams, nothing happens. There are no "triggered" log statements.
Does anyone know how these events get triggered? What is their purpose?
Thank You
Dec 31 2020 02:36 PM
Jan 03 2021 04:39 PM
@Christopher Hoard Unfortunately, no...
Apr 19 2023 06:06 AM - edited Apr 20 2023 04:07 AM
Your code does something else that it should.. the binding there is not allowed.
You would do either
this.onInstallationUpdate(this.botHandler1);
this.onInstallationUpdateAdd(this.botHandler1);
this.onInstallationUpdateRemove(this.botHandler1);
private botHandler1 = async (context: TurnContext, next: () => Promise<void>): Promise<any> => {
console.log('what happened? ', context.activity.name);
await next();
};
Or either override activity methods like:protected onInstallationUpdateAddActivity(context: TurnContext): Promise<void> { console.log('on installation add activity ', context.activity); return super.onInstallationUpdateAddActivity(context); }
override onInstallationUpdateAddActivity(context: TurnContext): Promise<void> {
console.log('on installation add activity ', context.activity);
return super.onInstallationUpdateAddActivity(context);
}
Hope this will solve your issue 2 years after you've dealt with it 🙂