Add support for add-in commands in Outlook on mobile devices
Using add-in commands in Outlook on mobile devices allows your users to access the same functionality (with some limitations) that they already have in Outlook on the web, on Windows, and on Mac. Adding support for Outlook mobile requires updating the add-in manifest and possibly changing your code for mobile scenarios.
Update the manifest
Add-ins using the Unified manifest for Microsoft 365 (preview) aren't currently supported on mobile devices.
The following example shows a single task pane button in a <MobileFormFactor> element.
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1"> ... <MobileFormFactor> <FunctionFile resid="residUILessFunctionFileUrl" /> <ExtensionPoint xsi:type="MobileMessageReadCommandSurface"> <Group id="mobileMsgRead"> <Label resid="groupLabel" /> <Control xsi:type="MobileButton" id="TaskPaneBtn"> <Label resid="residTaskPaneButtonName" /> <Icon xsi:type="bt:MobileIconList"> <bt:Image size="25" scale="1" resid="tp0icon" /> <bt:Image size="25" scale="2" resid="tp0icon" /> <bt:Image size="25" scale="3" resid="tp0icon" /> <bt:Image size="32" scale="1" resid="tp0icon" /> <bt:Image size="32" scale="2" resid="tp0icon" /> <bt:Image size="32" scale="3" resid="tp0icon" /> <bt:Image size="48" scale="1" resid="tp0icon" /> <bt:Image size="48" scale="2" resid="tp0icon" /> <bt:Image size="48" scale="3" resid="tp0icon" /> </Icon> <Action xsi:type="ShowTaskpane"> <SourceLocation resid="residTaskpaneUrl" /> </Action> </Control> </Group> </ExtensionPoint> </MobileFormFactor> ... </VersionOverrides>
This is very similar to the elements that appear in a DesktopFormFactor element, with some notable differences.
- The OfficeTab element isn't used.
- The ExtensionPoint element must have only one child element. If your add-in implements the MobileOnlineMeetingCommandSurface or MobileLogEventAppointmentAttendee extension point, you must include a Control child element. If your add-in implements the MobileMessageReadCommandSurface extension point, you must include a Group child element that contains multiple <Control> elements.
- There is no
Menutype equivalent for the <Control> element.
- The Supertip element isn't used.
- The required icon sizes are different. Mobile add-ins minimally must support 25x25, 32x32 and 48x48 pixel icons. For more information, see Additional requirements for mobile form factors.
Designing an add-in for mobile introduces some additional considerations.
Use REST instead of Exchange Web Services
The Office.context.mailbox.makeEwsRequestAsync method isn't supported in Outlook mobile. Add-ins should prefer to get information from the Office.js API when possible. If add-ins require information not exposed by the Office.js API, then they should use the Outlook REST APIs to access the user's mailbox.
Mailbox requirement set 1.5 introduced a new version of Office.context.mailbox.getCallbackTokenAsync that can request an access token compatible with the REST APIs, and a new Office.context.mailbox.restUrl property that can be used to find the REST API endpoint for the user.
By default users can use the "pinch zoom" gesture to zoom in on task panes. If this doesn't make sense for your scenario, be sure to disable pinch zoom in your HTML.
Close task panes
In Outlook mobile, task panes take up the entire screen and by default require the user to close them to return to the message. Consider using the Office.context.ui.closeContainer method to close the task pane when your scenario is complete.
Compose mode and appointments
Currently, add-ins in Outlook mobile only support activation when reading messages. Add-ins aren't activated when composing messages or when viewing or composing appointments. However, there are some exceptions.
- Online meeting provider integrated add-ins activate in Appointment Organizer mode. For more information about this exception (including available APIs), see Create an Outlook mobile add-in for an online-meeting provider.
- Add-ins that log appointment notes and other details to customer relationship management (CRM) or note-taking services activate in Appointment Attendee mode. For more information about this exception (including available APIs), see Log appointment notes to an external application in Outlook mobile add-ins.
- Event-based add-ins activate when the
OnNewMessageComposeevent occurs. For more information about this exception (including additional supported APIs), see Implement event-based activation in Outlook mobile add-ins.