Reputation: 27
I submitted my add-in for publishing but Microsoft found a compatibility issue with WebView1 / Legacy edge not exiting gracefully. Currently testing on a version of Outlook that uses this the add-in won't open at all and is stuck with an "Add-in is loading" message.
The add-in uses a dialog box. On startup I read the userAgent to check for the browser
if (navigator.userAgent.indexOf("Trident") === -1 || navigator.userAgent.indexOf("Edge/") === -1) {
openDialog(e, `${getUrl()}?mode=attach`, "attach");
} else {
openDialog(e, `${getUrl()}?mode=unsupported`, "unsupported");
}
I think the issue is something to do with my requirement set (and the DialogApi) not being supported in these older versions of Outlook
<Requirements>
<Sets>
<Set Name="Mailbox" MinVersion="1.9" />
</Sets>
</Requirements>
My confusion here is how do I provide a graceful exit on versions of Outlook where my add-in cannot even start due to the incompatibility? I believe my browser detection code does work just it is never reached due to the above incompatibility.
Is there a way to determine this beforehand? And then use a taskpane (Is this compatible with older versions?) to show the graceful exit message?
Any help or suggestions are greatly appreciated! If you need any more info from me I am happy to edit this with more. Thanks!
Upvotes: 1
Views: 107
Reputation: 49445
You need to check the supported versions of host applications. See Dialog API requirement sets for more information. Also you may find the Outlook JavaScript API requirement sets helpful.
Requirement set support varies by Office application, the version of the Office application, and the platform on which it is running. For example, DialogApi 1.2
is not supported on one-time purchase versions of Office before Office 2021, but DialogApi 1.1
is supported on all one-time purchase versions back to Office 2013. You want your add-in to be installable on every combination of platform and Office version that supports the APIs that it uses, so you should always specify in the manifest the minimum version of each requirement set that your add-in requires.
You can test at runtime to discover whether the user's Office supports a requirement set with the isSetSupported
method. Pass the requirement set's name and the minimum version as parameters. If the requirement set is supported, isSetSupported
returns true
. The following code shows an example.
if (Office.context.requirements.isSetSupported('DialogApi', '1.2'))
{
// Code that uses API members from the DialogApi 1.2 requirement set.
} else {
// Provide diminished experience here. E.g., run alternate code when the user's host application is one-time purchase (which does not support DialogApi 1.2).
}
See Specify Office applications and API requirements for more information.
Upvotes: 1