【发布时间】:2020-01-23 16:29:47
【问题描述】:
我目前正在开发 Xamarin.Android 中的应用程序,其中一项功能是,单击按钮后,用户将被带到 Microsoft Outlook 应用程序中的特定日历事件。到目前为止,我一直在使用 Microsoft Graph API 来获取事件项,并且我成功地将 Outlook 应用程序打开到日历或打开 Outlook 并显示错误消息“无法打开事件”但我没有得到无论是要发生的行为,还是要打开的特定事件项。我打开 Outlook 应用程序的方式是使用 Outlook uri 方案调用设备的默认浏览器。两者都在下面提供
browserLaunch("ms-outlook://events/open?account={my.account@email.com}&restid={id}");
private async void browserLaunch( string uri ) {
await Browser.OpenAsync(uri, BrowserLaunchMode.SystemPreferred);
}
我对 Graphs API 的确切调用如下
https://graph.microsoft.com/v1.0/me/calendarview?startdatetime=2020-01-23T15:54:40.377Z&enddatetime=2020-01-30T15:54:40.377Z
返回具有以下方案的偶数项列表:
"@odata.etag": "string",
"id": "string",
"createdDateTime": "20##-##-##T##:##:##.######Z",
"lastModifiedDateTime": "20##-##-##T#3:##:##.#######Z",
"changeKey": "string",
"categories": [],
"originalStartTimeZone": "Central Standard Time",
"originalEndTimeZone": "Central Standard Time",
"iCalUId": "string",
"reminderMinutesBeforeStart": int,
"isReminderOn": true/false,
"hasAttachments": true/false,
"subject": "string",
"bodyPreview": "string",
"importance": "string",
"sensitivity": "string",
"isAllDay": true/false,
"isCancelled": true/false,
"isOrganizer": true/true,
"responseRequested": true/false,
"seriesMasterId": null,
"showAs": "string",
"type": "string",
"webLink": "https://outlook.office365.com/owa/?itemid={id}&exvsurl={int}&path=/calendar/item",
"onlineMeetingUrl": null,
"recurrence": null,
"responseStatus": {
"response": "none",
"time": "0001-01-01T00:00:00Z"
},
"body": {
"contentType": "html",
"content": "string"
},
"start": {
"dateTime": "20##-##-##T##:##:##.#######",
"timeZone": "UTC"
},
"end": {
"dateTime": "20##-##-##T##:##:##.#######",
"timeZone": "UTC"
},
"location": {
"displayName": "string",
"locationType": "string",
"uniqueId": "string",
"uniqueIdType": "stirng"
},
"locations": [
{
"displayName": "string",
"locationType": "string",
"uniqueId": "hexstrin-hexs-hexs-hexs-hexstringhex",
"uniqueIdType": "string"
}
],
"attendees": [
{
"type": "string",
"status": {
"response": "string",
"time": "0001-01-01T00:00:00Z"
},
"emailAddress": {
"name": "string",
"address": "my.account@email.com"
}
}
],
"organizer": {
"emailAddress": {
"name": "string",
"address": "my.account@email.com"
}
}
我还尝试了图形 API 为 restid 参数提供的不同 ID。到目前为止,我已经使用了在 webLink 字段的 url 中找到的 itemid 参数、json 对象的 id、changeKey 和 iCalUId,但最后两个除了打开 Outlook 之外并没有给我任何帮助。
我也刚刚传入了 webLink,但它只是打开了一个轻量级浏览器(并且卡在了一个白页上),我不想要它,因为我特别需要它来访问 Outlook 应用程序。有什么想法吗?
【问题讨论】:
-
嘿!我不太明白您遇到了什么问题以及您要做什么。你能解释一下第一段吗? “我目前……在下面提供”?
-
所以功能是这样的:应用程序调用 microsoft graph api 来获取用户的事件,然后在列表视图中显示每个事件。然后,每个列表项对应于用户 Outlook 日历上的一个事件。我要做的是为每个列表视图项目提供一个按钮,按下该按钮后,您将转到列表视图项目所代表的 Outlook 日历事件的详细信息活动。我已获得将 Outlook 应用程序打开到日历或打开时出现错误的按钮,但我无法获得打开 Outlook 日历事件详细信息的按钮
-
好的,谢谢。你想在outlook应用中打开详细信息,还是你自己的应用?您使用什么文档来获取该 AppLink?你也试过这些stackoverflow.com/questions/57618826/…
-
我想在 Outlook 中打开详细信息页面,是的,我已经尝试了大约一百种不同的 "ms-outlook://events/open?restid=%s&account=test @om.com”在我的应用程序中没有运气。但是,使用该方案,我确实收到一条消息说“无法打开事件”,所以我尝试了一堆不同的事件 ID。我没有尝试过不可变 id,因为图形 api 没有在我的 api 调用中为我提供任何信息
-
“无法打开事件”似乎是最正确的。您是否确保公开,也许您没有正确的访问权限?另外,当您收到该消息时,您的架构是什么?
标签: c# android xamarin xamarin.android microsoft-graph-api