loadCustomPropertiesAsync method times out on Outlook for Android - outlook

I have an Outlook add-in that attempts to fetch a custom property that is stored with the mail item using the loadCustomPropertiesAsync [1]:
Office.context.mailbox.item.loadCustomPropertiesAsync(function(asyncResult){
var customProps = asyncResult.value;
console.log(customProps.get("some.prop"));
})
The above snippet of code seems to time out when I access the add-in from Outlook for Android (v3.0.40) app, but works fine on iOS, Firefox and Chrome (Tested on both Windows 10 and Mac ).
Is this a bug?
[1] https://learn.microsoft.com/en-us/office/dev/add-ins/reference/objectmodel/requirement-set-1.3/office.context.mailbox.item

Related

Office.context.mailbox.item.notificationMessages disappear on web app, on reload or messages switching

How to persist notifications on outlook web application
I'm using the following function.
Message persists on the Outlook Desktop application, but on the Outlook web application disappears when switching between email messages or reloading the page.
plus icon also not appear on web, which is the correct icon resolution for the web because 80x80 appears on Desktop app
const addNotificationMessage=(text)=>{
const message = {
type: Office.MailboxEnums.ItemNotificationMessageType.InformationalMessage,
message: text,
persistent: true,
icon: "Icon80",
};
Office.context.mailbox.item.notificationMessages.replaceAsync("action", message);
}
Looks like a bug. I've reproduced this issue in Outlook for the web and Outlook for desktop on Windows. So, I've filed it as an issue. You may track it at https://github.com/OfficeDev/office-js/issues/3155 .
Be aware, the documentation states that in modern Outlook on the web, you can add an InsightMessage notification only in Compose mode.
At present, the custom icon is displayed in Outlook on Windows only and not on other clients (e.g., Mac, web browser).

In outlook web addin, the Event "onAppointmentAttendeesChangedHandler" works on outlook web. But it fails to trigger on outlook desktop

I'm new to web-addin and trying to build an addin for outlook meeting. I need to capture the event when ever there is a change in attendees (participants).
I have subscribed to onAppointmentAttendeesChangedHandler, which works perfectly on outlook web.
But when I try the same on outlook desktop client (windows, office build is 2108), the event is not triggered. Please suggest
below is the JS code.
// subscribing to the Attendee change event.
Office.actions.associate("onAppointmentAttendeesChangedHandler", onAppointmentAttendeesChangedHandler);
//Function to be called when the event is triggered.
function onAppointmentAttendeesChangedHandler(event) {
GetReciepientsCount(_event);
// console.log("Before setting Obj");
}
where as, the below subscription works on both outlook web and windows desktop client.
Office.actions.associate("onAppointmentComposeHandler", onAppointmentComposeHandler);
For the Windows based Outlook application the minimum required build is 16.0.14511.10000. If required, join the Office Insider program and choose the Beta Channel for access to Office beta builds.
You can read more about the requirements for event-based activation in the Configure your Outlook add-in for event-based activation article.

Is Office.context.ui.messageParent broken in Outlook 2016 for Mac?

I'm working on an Outlook addin using the new Office-JS apis, and in building out the authentication flow, I've found that in the Outlook 2016 for Mac case, the dialog system seems to not work properly.
To be clear, we're using the Office Insider Fast Track build as it has much improved support for the Office-JS API.
I've been through several iterations of this particular piece (most of which worked fine both in the Windows client and the web client on Mac and Win), and have had no luck. The scenario is:
List item
Open up the task pane in outlook.
Hit the sign in button
A new window opens, pointed at our authentication portal
User signs in.
On auth completion, the window redirects to a page in the office add-in scope, and calls back to the parent frame with the auth token, where it can be further processed.
Steps 1 through 5 work fine on all platforms. Step 6 refuses to work on Outlook for Mac. Initially, this flow was built using the native js window.open and window.postMessage apis. As mentioned above, this worked everywhere but Outlook Mac, where, the API seemed to ignore the window options and just open the url in a new tab in whatever browser was open and never setting the child window reference (result of window.open being null).
Failing this, I followed the advice found here on SO to use the Office functionality, displayDialogAsync and messageParent. After some initial hurdles, this too was setup and working on every platform save Outlook Mac.
As there is no dev tools or JS console support in Mac Outlook, I followed the advice found here Howto: Outlook 2016 for Mac - Debugging/View Console Logs in Outlook Add-in and setup Vorlon to attempt to get some context, adding numerous logging points to try and get some context. Unfortunately, while Vorlon does pick up my auth landing page as a client, and sees the Office interfaces, none of my console outputs are presented, making it seem as though the JS isn't running at all.
At this point I'm not sure what to try next. Has anyone run into this issue, or gotten this to work on the Outlook 2016 for Mac client?
Clarifying context:
All auth pages are listed in the AppDomains section of the Manifest.
While initial versions pointed directly at our auth service (this worked on not Mac), the current version first opens up an in scope pre-auth page that redirects to the auth service.
The Office-JS api's block alerts, preventing their use in displaying useful information.
Authentication through all versions of this app have worked on both Outlook 2016 on Windows and OWA on both Win and Mac.
Thank you.
This issue in Outlook Mac has been fixed a few months ago. If anyone still encounters this issue with a recent Outlook Mac build, please reply with the build number.
The Office.context.ui is undefined in v16.17 (180909) build of Outlook for Mac 2016 using the following OfficeJS dist:
https://appsforoffice.microsoft.com/lib/1/hosted/office.js

Windows 10 Mobile - cannot hide status bar (StatusBar doesn't exist in context)

I am trying to hide status bar in my Windows 10 Universal App. In WP 8.1, I was using StatusBar.GetForCurrentView().HideAsync();to hide the status bar, however this won't work in my current project (Monogame, Win10 UAP) - I get "StatusBar not found in the current context" error (yes, I am using Windows.UI.ViewManagement).
Am I doing something wrong, or was this option to remove StatusBar removed? How should I do it in W10M?
Thanks in advance.
The trick is that you have to add a reference to the Microsoft Mobile Extension SDK first.
Then the code is the following:
StatusBar statusBar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView();
await statusBar.HideAsync();
The reference can be added by right clicking the universal project. Select "Add reference". In the Reference Manager dialog select "Windows Universal" on the left. Choose "Extensions" and check the "Microsoft Mobile Extension SDK...".
As this is a universal App it will run on every device, but the API will be available only on mobile Devices (aka Phones) with Windows 10. Therefore feature-detect if this API is available at runtime before you actually call the API. Otherwise it will throw a TypeLoadException at runtime.
Use the Windows.Foundation.Metadata.ApiInformation Namespace to find out if the API is available. (E.g. Method IsTypePresent() .
I recommend working with typeof instead of Strings here, e.g. like this:
var isStatusBarPresent = ApiInformation.IsTypePresent(typeof(StatusBar).ToString());
Learn more about adaptive code here: https://channel9.msdn.com/Series/A-Developers-Guide-to-Windows-10/08

PhoneGap Build - navigator.notification.alert not working in WP7 emulator

I build this simple code with PGB, but it does not working in WP7 emulator - no alert message.
For android emulator its ok.
What's wrong?
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
navigator.notification.alert("Device Ready!");
}
Source code https://github.com/dprotopopov/pgb-wp7-alert
This seems to be a bug with the latest PhoneGap build for WP7. I have this up and running in Visual Studio and although the navigator object is accessible in the code there is no notification property available. You can test the same yourself by iterating through the properties of the navigator object in your app;
for(var key in navigator){
document.write(key + "<br>");
}
The list I get is as follows, note that notification is not one of them :(
appCodeName
appMinorVersion
browserLanguage
cookieEnabled
cpuClass
mimeTypes
plugins
systemLanguage
userLanguage
msDoNotTrack
geolocation
appName
appVersion
platform
userAgent
onLine
javaEnabled
taintEnabled

Resources