Cannot use getAccessTokenAsync on Mobile

298 Views Asked by At

I created an Office.js add-in that works fine on OWA and Outlook desktop app. But, on the Outlook app for iOS and Android, I receive this error:

TypeError: Cannot read proerties of undefined (reading 'getAccessTokenAsync')

Can I not use the function Office.context.auth.getAccessTokenAsync if I plan on using the add-in on mobile? If it is allowed, then what can I do to get around this error? I've also tried using Promise.resolve(OfficeRuntime.auth.getAccessToken()), but got this error -

ReferenceError: OfficeRuntime is not defined
1

There are 1 best solutions below

1
AudioBubble On BEST ANSWER

getAccessTokenAsync is a part of IdentityAPI 1.3 and is not available for Outlook Mobile yet. You can see the list of supported API sets on Outlook for different platforms here.