Skip to content

Commit da4aa9b

Browse files
Merge pull request #1805 from OfficeDev/v-mfurquan/Graph-activity-feed-manifest-icons-Fixes
Graph Activity Feed- Build App Package Icons Fixes For TTK
2 parents e71cada + 89a6b02 commit da4aa9b

31 files changed

+571
-34
lines changed

samples/graph-activity-feed/csharp/ActivityFeedNotification/Controllers/HomeController.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,14 @@ public async Task<ActionResult> SendNotificationToUser(TaskDetails taskDetails)
9393
if (taskDetails.taskInfoAction == "customTopic")
9494
{
9595
ChatMessageHelper chatMessage = new ChatMessageHelper(_configuration);
96-
var getChannelMessage = await chatMessage.CreateChatMessageForChannel(taskDetails, taskDetails.access_token);
96+
//var getChannelMessage = await chatMessage.CreateChatMessageForChannel(taskDetails, taskDetails.access_token);
9797
var requestBody = new Microsoft.Graph.Beta.Users.Item.Teamwork.SendActivityNotification.SendActivityNotificationPostRequestBody
9898
{
9999
Topic = new TeamworkActivityTopic
100100
{
101101
Source = TeamworkActivityTopicSource.Text,
102102
Value = "Deployment Approvals Channel",
103-
WebUrl = getChannelMessage.WebUrl
103+
WebUrl = "https://teams.microsoft.com/l/entity/" + _configuration["AzureAd:MicrosoftAppId"]
104104
},
105105
ActivityType = "taskCreated",
106106
PreviewText = new ItemBody
@@ -111,15 +111,15 @@ public async Task<ActionResult> SendNotificationToUser(TaskDetails taskDetails)
111111
{
112112
new Microsoft.Graph.Beta.Models.KeyValuePair
113113
{
114-
Name = "taskId",
115-
Value = "12322",
114+
Name = "taskName",
115+
Value = taskDetails.taskName ?? "New Task",
116116
},
117117
},
118118
IconId = "taskCreatedId"
119119
};
120120
try
121121
{
122-
await graphClient.Users["{userId}"].Teamwork
122+
await graphClient.Users[_configuration["AzureAd:UserId"]].Teamwork
123123
.SendActivityNotification.PostAsync(requestBody);
124124
}
125125
catch (Exception ex)
@@ -148,14 +148,14 @@ await graphClient.Users["{userId}"].Teamwork
148148
new KeyValuePair
149149
{
150150
Name = "taskName",
151-
Value = "12322",
151+
Value = taskDetails.taskName ?? "New Task",
152152
},
153153
},
154154
IconId = "taskCreatedId"
155155
};
156156
try
157157
{
158-
await graphClient.Users["{userId}"].Teamwork
158+
await graphClient.Users[_configuration["AzureAd:UserId"]].Teamwork
159159
.SendActivityNotification.PostAsync(requestBody);
160160
}
161161
catch (Exception ex)
@@ -194,7 +194,7 @@ public async Task<ActionResult> SendNotificationToGroupChat(TaskDetails taskDeta
194194
Recipient = new AadUserNotificationRecipient
195195
{
196196
OdataType = "microsoft.graph.aadUserNotificationRecipient",
197-
UserId = "{userId}",
197+
UserId = _configuration["AzureAd:UserId"],
198198
},
199199
TemplateParameters = new List<KeyValuePair>
200200
{
@@ -233,7 +233,7 @@ await graphClient.Chats[taskDetails.chatId]
233233
Recipient = new AadUserNotificationRecipient
234234
{
235235
OdataType = "microsoft.graph.aadUserNotificationRecipient",
236-
UserId = "{userid}",
236+
UserId = _configuration["AzureAd:UserId"],
237237
},
238238
TemplateParameters = new List<KeyValuePair>
239239
{
@@ -378,7 +378,7 @@ await graphClientApp.Teams[taskDetails.teamId]
378378
Recipient = new AadUserNotificationRecipient
379379
{
380380
OdataType = "microsoft.graph.aadUserNotificationRecipient",
381-
UserId = "{userId}",
381+
UserId = _configuration["AzureAd:UserId"],
382382
},
383383
TemplateParameters = new List<KeyValuePair>
384384
{

samples/graph-activity-feed/csharp/ActivityFeedNotification/appsettings.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"AzureAd": {
33
"Instance": "https://login.microsoftonline.com/",
4-
"TenantId": "common",
4+
"TenantId": "{TENANT_ID}",
55
"MicrosoftAppId": "",
66
"MicrosoftAppPassword": "",
77
"ApplicationIdURI": "api://{Base_URL}/{MicrosoftAppId}",
88
"AuthUrl": "/oauth2/v2.0/token",
9-
"ValidIssuers": "https://login.microsoftonline.com/TENANT_ID/v2.0,https://sts.windows.net/TENANT_ID/"
9+
"ValidIssuers": "https://login.microsoftonline.com/TENANT_ID/v2.0,https://sts.windows.net/TENANT_ID/",
10+
"UserId": ""
1011
},
1112
"Logging": {
1213
"LogLevel": {
44.9 KB
Loading
108 KB
Loading
90.1 KB
Loading
108 KB
Loading
76.9 KB
Loading
102 KB
Loading
102 KB
Loading
Binary file not shown.

0 commit comments

Comments
 (0)