Is there any different requirements for the Outlook app for Android?
I can retrieve item properties correctly in browser (IE, Chrome) and iOS app, but it doesn't work in the Android app.
The only property working on Android seems to be Office.context.mailbox.item.internetMessageId, the following properties are not retrieved in Android Outlook.
Office.context.mailbox.item.subject
Office.context.mailbox.item.sender.emailAddress
Office.context.mailbox.item.from.emailAddress
Office.context.mailbox.item.body
Seems like I finally got it working on Outlook for Android too. I just wrapped everything in an anonymous function and added 'use strict';.
(function () {
'use strict';
Office.initialize = (reason) => {
//code here
};
})();
Actually the reason I got it fixed is to change the add-in permission from <Permissions>ReadWriteItem</Permissions> to <Permissions>ReadWriteMailbox</Permissions>.
Not sure that's normal, as other platform doesn't require this level of permission.
@mrik23: Thanks for raising this issue. We will investigate.
@exextoc: Can you take a look? Thanks.
Hi Team,
We have fixed one issue related to permissions in Outlook Android few weeks back. I have verified all given APIs working perfectly on latest production build on Outlook Android.
Please check and confirm.
Thanks,
Saurabh Tripathi
@satrip I still have this issue on Outlook Android. Tested on 2 devices, and app seems to be up to date.
Outlook version 2.2.226 (284).
@mrik23 I have same Outlook version and just tested some of above given APIs and it is working fine. I will check with team and revert back.
@satrip would you need some code sample? But the code is fairly simple.
All I know at this point is that if I change the permissions to Mailbox instead of Item, it works on Android. Other platforms, fine in both cases.
@mrik23 Please post code you are using that may be helpful.
Hi Team,
I have got root cause of issue. I will work on it towards fixing it.
-Saurabh Tripathi
@satrip
Example of code:
`(function () {
'use strict';
var $appbody = $('#app-body');
Office.initialize = (reason) => {
var _item = Office.context.mailbox.item;
var emailInfo = '';
emailInfo += '<p><strong>Message ID:</strong> ' + _item.internetMessageId + '</p>';
emailInfo += '<p><strong>Subject:</strong> ' + _item.subject + '</p>';
emailInfo += '<p><strong>Sender:</strong> ' + _item.sender.emailAddress + '</p>';
emailInfo += '<p><strong>From:</strong> ' + _item.from.emailAddress + '</p>';
emailInfo += '<br />';
$appbody.prepend(emailInfo);
$('#sideload-msg').hide();
$appbody.show();
};
})();`
It is pretty basic and base on example from the docs.
@satrip: Can you provide an update? Thanks.
Transferring this issue from the OfficeDev/outlook-dev-docs repository (where documentation problems are tracked) to the OfficeDev/office-js repository (where product issues/bugs like this are tracked).
@satrip or @exextoc any update on the status of this issue and deployment of the corresponding fix?
@kbrandl It is fixed and working in latest production build.
@satrip thank you for the confirmation; I'll close this issue since the fix has been deployed.