I am developing Outlook Add-In that will run over all modern browsers, android and iOS.
I am using Managed EWS API to fetch the email and its attachment by passing ewsUrl, itemId and ewsToken in OAuthCredentials class which is my remote service.
I am getting ewsToken by using Office.js getCallbackTokenAsync method from UI and passing all this information to my remote service to use the Managed EWS API to fetch email from exchange server.
For browsers it works fine but when we use Outlook Mobile on Android, ewsUrl returns null which I hard-coded to https://outlook.office365.com/ews/exchange.asmx but now I am getting 401 unauthorized error.
How can I identify if ewsToken or itemId is wrong?
getCallbackTokenAsync()on iOS/Android returns REST-compatible token even when theisRestparameter is not specified (see this discussion) - Alex Klaus