Bot-docs: notify not working

Created on 3 Jul 2019  Â·  8Comments  Â·  Source: MicrosoftDocs/bot-docs

The following error occurs whenever this url is hit http://localhost:3978/api/notify
Unable to resolve service for type 'Microsoft.Bot.Connector.Authentication.ICredentialProvider' while attempting to activate 'ProactiveBot.Controllers.NotifyController'.

System.InvalidOperationException: Unable to resolve service for type 'Microsoft.Bot.Connector.Authentication.ICredentialProvider' while attempting to activate 'ProactiveBot.Controllers.NotifyController'.

at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.GetService(IServiceProvider sp, Type type, Type requiredBy, Boolean isDefaultParameterRequired)


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

support customer

Most helpful comment

@markolb81 Yes, you can do that.

Basically, you:

  1. Fetch the Team Roster

  2. Start a Proactive Conversation

You'll likely find this StackOverflow answer helpful.

All 8 comments

bot-docs/botframework-config

I implemented the scenario above for MS Teams Channel specifically where I store serialized conversation references to send a proactive message via "ContinueConversationAsync".
After some time, I realized that after some time, the stored conversation reference does not work any more, the conversation is not being resumed.
Is there a timeout / expiration date for conversation references? Is there a way, to actually start a 1:1 conversation within teams?

Have you tried enabling trust service urls in your project? Take a look at he Send proactive notifications to users documentation and let me know if that resolves your issue.

@markolb81, do you still need assistance?

Hi CoHealer, I wasn't unable to test until now - I added this specific line of code to trust that URL, first test seems to be good - thanks for that!

A related issue: I know that it's on the roadmap to provide a real proactive messaging for the MS Teams Channel, but until then: do you see any workaround to generate conversation references for users that did not contacted the bot themselves? What about using some sort of powershell, that impersonates to every user within the Active Directory and once sends a short activity to the bot to initiate a conversation reference that I can then store? Will this work?

@markolb81 Yes, you can do that.

Basically, you:

  1. Fetch the Team Roster

  2. Start a Proactive Conversation

You'll likely find this StackOverflow answer helpful.

@markolb81 As your original issue was resolved, I'm going to close this. If you run into trouble trying to implement my previous comment, feel free to open a Stack Overflow issue.

Was this page helpful?
0 / 5 - 0 ratings