Flow
Flow

Reputation: 143

Send chat message

I have this code:

var msg = new ChatMessage();
msg.Body = "Test";
msg.Recipients.Add("number");

var cms = await ChatMessageManager.RequestStoreAsync();
await cms.SendMessageAsync(msg);

and I have a problem with the await part of code above. I get exception:

Access is denied.

In capabilities within appxmanifest I have selected:

Chat Message Access

(I tried select all, but It didn't work). I cannot find any sample and requirements that must be met.

Thanks for your help.

Upvotes: 4

Views: 703

Answers (1)

Romasz
Romasz

Reputation: 29792

If you take a look at MSDN you will see that:

This API is not available to all Windows/Windows Phone apps. Unless your developer account is specially provisioned by Microsoft, calls to these APIs will fail at runtime.

Upvotes: 4

Related Questions