我们为用户开发了一个用于 Sharepoint 访问的 Outlook 插件。要访问 SharePoint,客户需要使用其 Microsoft 帐户登录。
在 IO 上,桌面应用程序和 Web 上的 Outlook 在用户登录后一切正常,他会被重定向到加载项的主屏幕。
在 Android 上,打开的对话框似乎不会自行关闭,并且登录后不会重定向。没有给出任何错误或信息。只有空白的白屏。一旦用户关闭加载项并重新打开它,一切都会按预期进行,因为他已经登录了。
有人遇到类似问题并得到解决吗?
这是应该关闭对话框的函数片段(适用于除 Android 之外的任何设备和操作系统)
const onLoginMessage = async ({message}: { message: string, origin: string }) => {
const {
status,
response,
newLocalStorage
}: LoginResponse = JSON.parse(message);
loginDialog.close();
if (status === 'success') {
// We now have a valid access token.
setMsalInformationToLocalStorage(newLocalStorage);
msalPublicClientApplication.setActiveAccount(response.account);
location.reload();
}
loginComplete(status);
}
};
我发现有人有同样的问题并且在他这边启用https解决了问题。但这对我们来说没有帮助。
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0" xsi:type="MailApp">
<Id>{{ADDIN_ID}}</Id>
<Version>1.6.0</Version>
<ProviderName>Test</ProviderName>
<DefaultLocale>de-DE</DefaultLocale>
<DisplayName DefaultValue="LOCAL-Outlook-2-SharePoint"/>
<Description DefaultValue="Ausgewählte"/>
<IconUrl DefaultValue="https://{{ADDIN_URL}}/assets/icon-64.png"/>
<HighResolutionIconUrl DefaultValue="https://{{ADDIN_URL}}/assets/icon-128.png"/>
<SupportUrl DefaultValue=""/>
<AppDomains>
<AppDomain>https://{{ADDIN_URL}}</AppDomain>
<AppDomain>{{API_URL}}</AppDomain>
</AppDomains>
<Hosts>
<Host Name="Mailbox"/>
</Hosts>
<Requirements>
<Sets>
<Set Name="Mailbox" MinVersion="1.3"/>
</Sets>
</Requirements>
<FormSettings>
<Form xsi:type="ItemRead">
<DesktopSettings>
<SourceLocation DefaultValue="https://{{ADDIN_URL}}/taskpane.html"/>
<RequestedHeight>250</RequestedHeight>
</DesktopSettings>
</Form>
</FormSettings>
<Permissions>ReadWriteMailbox</Permissions>
<Rule xsi:type="RuleCollection" Mode="Or">
<Rule xsi:type="ItemIs" ItemType="Message" FormType="Read"/>
</Rule>
<DisableEntityHighlighting>false</DisableEntityHighlighting>
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
<Requirements>
<bt:Sets DefaultMinVersion="1.3">
<bt:Set Name="Mailbox" />
</bt:Sets>
</Requirements>
<Hosts>
<Host xsi:type="MailHost">
<DesktopFormFactor>
<!-- Message compose form -->
<ExtensionPoint xsi:type="MessageComposeCommandSurface">
<OfficeTab id="TabDefault">
<Group id="msgComposeDemoGroup">
<Label resid="GroupLabel" />
<Control xsi:type="Button" id="msgComposeFunctionButton">
<Label resid="TaskpaneButton.Label" />
<Supertip>
<Title resid="TaskpaneButton.Title" />
<Description resid="TaskpaneButton.Tooltip"/>
</Supertip>
<Icon>
<bt:Image size="16" resid="Icon.16x16" />
<bt:Image size="32" resid="Icon.32x32" />
<bt:Image size="80" resid="Icon.80x80" />
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="TaskpaneRead.Url" />
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>
<!-- Message read form -->
<ExtensionPoint xsi:type="MessageReadCommandSurface">
<OfficeTab id="TabDefault">
<Group id="msgReadDemoGroup">
<Label resid="GroupLabel" />
<Control xsi:type="Button" id="msgReadFunctionButton">
<Label resid="TaskpaneButtonRead.Label" />
<Supertip>
<Title resid="TaskpaneButtonRead.Label" />
<Description resid="TaskpaneButtonRead.Label" />
</Supertip>
<Icon>
<bt:Image size="16" resid="Icon.16x16" />
<bt:Image size="32" resid="Icon.32x32" />
<bt:Image size="80" resid="Icon.80x80" />
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="TaskpaneRead.Url" />
</Action>
</Control>
<Control xsi:type="Menu" id="msgReadMenuButton">
<Label resid="TaskpaneButtonRead.Label" />
<Supertip>
<Title resid="TaskpaneButtonRead.Label" />
<Description resid="TaskpaneButtonRead.Label" />
</Supertip>
<Icon>
<bt:Image size="16" resid="Icon.16x16" />
<bt:Image size="32" resid="Icon.32x32" />
<bt:Image size="80" resid="Icon.80x80" />
</Icon>
<Items>
<Item id="msgReadMenuItem1">
<Label resid="TaskpaneButtonRead.Label" />
<Supertip>
<Title resid="TaskpaneButtonRead.Label" />
<Description resid="TaskpaneButtonRead.Tooltip" />
</Supertip>
<Icon>
<bt:Image size="16" resid="Icon.16x16" />
<bt:Image size="32" resid="Icon.32x32" />
<bt:Image size="80" resid="Icon.80x80" />
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="TaskpaneRead.Url" />
</Action>
</Item>
<Item id="msgReadMenuItem2">
<Label resid="TaskpaneButtonRead.Label" />
<Supertip>
<Title resid="TaskpaneButtonRead.Label" />
<Description resid="TaskpaneButtonRead.Tooltip" />
</Supertip>
<Icon>
<bt:Image size="16" resid="Icon.16x16" />
<bt:Image size="32" resid="Icon.32x32" />
<bt:Image size="80" resid="Icon.80x80" />
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="TaskpaneRead.Url" />
</Action>
</Item>
<Item id="msgReadMenuItem3">
<Label resid="TaskpaneButtonRead.Label" />
<Supertip>
<Title resid="TaskpaneButtonRead.Label" />
<Description resid="TaskpaneButtonRead.Tooltip" />
</Supertip>
<Icon>
<bt:Image size="16" resid="Icon.16x16" />
<bt:Image size="32" resid="Icon.32x32" />
<bt:Image size="80" resid="Icon.80x80" />
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="TaskpaneRead.Url" />
</Action>
</Item>
</Items>
</Control>
<!-- Task pane button -->
<Control xsi:type="Button" id="msgReadOpenPaneButton">
<Label resid="TaskpaneButtonRead.Label" />
<Supertip>
<Title resid="TaskpaneButtonRead.Label" />
<Description resid="TaskpaneButtonRead.Tooltip" />
</Supertip>
<Icon>
<bt:Image size="16" resid="Icon.16x16" />
<bt:Image size="32" resid="Icon.32x32" />
<bt:Image size="80" resid="Icon.80x80" />
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="TaskpaneRead.Url" />
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>
</DesktopFormFactor>
</Host>
</Hosts>
<Resources>
<bt:Images>
<bt:Image id="Icon.16x16" DefaultValue="https://{{ADDIN_URL}}/assets/icon-16.png"/>
<bt:Image id="Icon.32x32" DefaultValue="https://{{ADDIN_URL}}/assets/icon-32.png"/>
<bt:Image id="Icon.80x80" DefaultValue="https://{{ADDIN_URL}}/assets/icon-80.png"/>
</bt:Images>
<bt:Urls>
<bt:Url id="TaskpaneRead.Url" DefaultValue="https://{{ADDIN_URL}}/taskpane.html"/>
<bt:Url id="Taskpane.Url" DefaultValue="https://{{ADDIN_URL}}/taskpane-write.html"/>
</bt:Urls>
<bt:ShortStrings>
<bt:String id="GroupLabel" DefaultValue="LOCAL-Outlook-2-SharePoint"/>
<bt:String id="TaskpaneButton.Label" DefaultValue="An E-Mail anhängen"/>
<bt:String id="TaskpaneButton.Title" DefaultValue="An E-Mail anhängen"/>
<bt:String id="GroupLabelRead" DefaultValue="LOCAL-Outlook-2-SharePoint"/>
<bt:String id="TaskpaneButtonRead.Label" DefaultValue="E-Mail speichern"/>
</bt:ShortStrings>
<bt:LongStrings>
<bt:String id="TaskpaneButton.Label" DefaultValue="An E-Mail anhängen"/>
<bt:String id="TaskpaneButtonRead.Label" DefaultValue="An E-Mail anhängen"/>
<bt:String id="TaskpaneButton.Tooltip"
DefaultValue="Öffnet ein Fenster."/>
<bt:String id="TaskpaneButtonRead.Tooltip"
DefaultValue="Öffnet ein Fenster."/>
</bt:LongStrings>
</Resources>
<!-- VersionOverrides for the v1.1 schema -->
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
<Requirements>
<bt:Sets DefaultMinVersion="1.3">
<bt:Set Name="Mailbox" />
</bt:Sets>
</Requirements>
<Hosts>
<Host xsi:type="MailHost">
<DesktopFormFactor>
<ExtensionPoint xsi:type="MessageReadCommandSurface">
<OfficeTab id="TabDefault">
<Group id="msgReadGroup">
<Label resid="GroupLabelRead"/>
<Control xsi:type="Button" id="msgReadOpenPaneButton">
<Label resid="TaskpaneButtonRead.Label"/>
<Supertip>
<Title resid="TaskpaneButtonRead.Label"/>
<Description resid="TaskpaneButtonRead.Tooltip"/>
</Supertip>
<Icon>
<bt:Image size="16" resid="Icon.16x16"/>
<bt:Image size="32" resid="Icon.32x32"/>
<bt:Image size="80" resid="Icon.80x80"/>
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="TaskpaneRead.Url"/>
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>
<!-- Message Compose -->
<ExtensionPoint xsi:type="MessageComposeCommandSurface">
<OfficeTab id="TabDefault">
<Group id="msgComposeCmdGroup">
<Label resid="GroupLabel"/>
<Control xsi:type="Button" id="msgComposeInsertGist">
<Label resid="TaskpaneButton.Label"/>
<Supertip>
<Title resid="TaskpaneButton.Title"/>
<Description resid="TaskpaneButton.Tooltip"/>
</Supertip>
<Icon>
<bt:Image size="16" resid="Icon.16x16"/>
<bt:Image size="32" resid="Icon.32x32"/>
<bt:Image size="80" resid="Icon.80x80"/>
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="Taskpane.Url"/>
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>
</DesktopFormFactor>
<MobileFormFactor>
<ExtensionPoint xsi:type="MobileMessageReadCommandSurface">
<Group id="mobileMsgRead">
<Label resid="GroupLabel" />
<Control xsi:type="MobileButton" id="mblTaskPane">
<Label resid="TaskpaneButtonRead.Label" />
<Icon xsi:type="bt:MobileIconList">
<bt:Image size="25" scale="1" resid="Icon.32x32" />
<bt:Image size="25" scale="2" resid="Icon.32x32" />
<bt:Image size="25" scale="3" resid="Icon.32x32" />
<bt:Image size="32" scale="1" resid="Icon.32x32" />
<bt:Image size="32" scale="2" resid="Icon.32x32" />
<bt:Image size="32" scale="3" resid="Icon.32x32" />
<bt:Image size="48" scale="1" resid="Icon.32x32" />
<bt:Image size="48" scale="2" resid="Icon.32x32" />
<bt:Image size="48" scale="3" resid="Icon.32x32" />
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="TaskpaneReadUrl" />
</Action>
</Control>
</Group>
</ExtensionPoint>
</MobileFormFactor>
</Host>
</Hosts>
<Resources>
<bt:Images>
<bt:Image id="Icon.16x16" DefaultValue="https://{{ADDIN_URL}}/assets/icon-16.png"/>
<bt:Image id="Icon.32x32" DefaultValue="https://{{ADDIN_URL}}/assets/icon-32.png"/>
<bt:Image id="Icon.80x80" DefaultValue="https://{{ADDIN_URL}}/assets/icon-80.png"/>
</bt:Images>
<bt:Urls>
<bt:Url id="TaskpaneRead.Url" DefaultValue="https://{{ADDIN_URL}}/taskpane.html"/>
<bt:Url id="TaskpaneReadUrl" DefaultValue="https://{{ADDIN_URL}}/taskpane.html"/>
<bt:Url id="Taskpane.Url" DefaultValue="https://{{ADDIN_URL}}/taskpane-write.html"/>
</bt:Urls>
<bt:ShortStrings>
<bt:String id="GroupLabel" DefaultValue="LOCAL-Outlook-2-SharePoint"/>
<bt:String id="TaskpaneButton.Label" DefaultValue="An E-Mail anhängen"/>
<bt:String id="TaskpaneButton.Title" DefaultValue="An E-Mail anhängen"/>
<bt:String id="GroupLabelRead" DefaultValue="LOCAL"/>
<bt:String id="TaskpaneButtonRead.Label" DefaultValue="E-Mail speichern"/>
</bt:ShortStrings>
<bt:LongStrings>
<bt:String id="TaskpaneButton.Label" DefaultValue="An E-Mail anhängen"/>
<bt:String id="TaskpaneButtonRead.Label" DefaultValue="An E-Mail anhängen"/>
<bt:String id="TaskpaneButton.Tooltip"
DefaultValue="Öffnet ein Fenster."/>
<bt:String id="TaskpaneButtonRead.Tooltip"
DefaultValue="Öffnet ein Fenster."/>
</bt:LongStrings>
</Resources>
<WebApplicationInfo>
<Id>{{APP_REGISTRATION_ID}}</Id>
<Resource>api://{{ADDIN_URL}}/{{APP_REGISTRATION_ID}}</Resource>
<Scopes>
<Scope>Files.ReadWrite</Scope>
<Scope>Mail.Read</Scope>
<Scope>Mail.Read.Shared</Scope>
<Scope>offline_access</Scope>
<Scope>openid</Scope>
<Scope>profile</Scope>
<Scope>Sites.ReadWrite.All</Scope>
<Scope>User.Read</Scope>
</Scopes>
</WebApplicationInfo>
</VersionOverrides>
</VersionOverrides>
</OfficeApp>
我有一个可能对我们有效的解决方案。我将参考 Office 示例来弄清楚实际问题是什么。
在包含 Outlook-Addin 示例的 GitHub 中,我们找到了用于用户身份验证的示例。在此文件中,第 87-99 行导致出现问题,因为 Office.context.ui.displayDialogAsync 未正确执行。
我将相应的绑定移到了 processLogoutDialogEvent 函数下,该函数在 displayDialogAsync 中被称为回调,这导致了问题的解决。我们不知道为什么这只是 Android 的问题,而不是 IO 的问题,也不是 Outlook 网页版和本地版本的 Outlook 的问题。