app module
Namespace to interact with app initialization and lifecycle.
Interfaces
AppHostInfo |
Represents information about the application's host. |
AppInfo |
Represents application information. |
ChannelInfo |
Represents Channel information. |
ChatInfo |
Represents Chat information. |
Context |
Represents structure of the received context message. |
IExpectedFailureRequest |
Represents the failure request sent during an erroneous app initialization. |
IFailedRequest |
Represents the failed request sent during a failed app initialization. |
MeetingInfo |
Represents Meeting information. |
PageInfo |
Represents Page information. |
SharePointSiteInfo |
Represents information about a SharePoint site |
TeamInfo |
Represents Team information. |
TenantInfo |
Represents Tenant information. |
UserInfo |
Represents User information. |
Type Aliases
themeHandler |
This function is passed to registerOnThemeHandler. It is called every time the user changes their theme. |
Enums
ExpectedFailureReason |
Describes expected errors that occurred during an otherwise successful app initialization |
FailedReason |
Describes errors that caused app initialization to fail |
Functions
get |
Retrieves the current context the frame is running in. |
get |
Gets the Frame Context that the App is running in. See FrameContexts for the list of possible values. |
initialize(string[]) | Initializes the library. |
is |
Checks whether the Teams client SDK has been initialized. |
notify |
Notifies the frame that app has loaded and to hide the loading indicator if one is shown. |
notify |
Notifies the frame that app initialized with some expected errors. |
notify |
Notifies the frame that app initialization has failed and to show an error page in its place. |
notify |
Notifies the frame that app initialization is successful and is ready for user interaction. |
open |
open link API. |
register |
Registers a handler for theme changes. |
Function Details
getContext()
Retrieves the current context the frame is running in.
function getContext(): Promise<app.Context>
Returns
Promise<Context>
Promise that will resolve with the Context object.
getFrameContext()
Gets the Frame Context that the App is running in. See FrameContexts for the list of possible values.
function getFrameContext(): FrameContexts
Returns
the Frame Context.
initialize(string[])
Initializes the library.
function initialize(validMessageOrigins?: string[]): Promise<void>
Parameters
- validMessageOrigins
-
string[]
Optionally specify a list of cross frame message origins. They must have https: protocol otherwise they will be ignored. Example: https://www.example.com
Returns
Promise<void>
Promise that will be fulfilled when initialization has completed, or rejected if the initialization fails or times out
Remarks
Initialize must have completed successfully (as determined by the resolved Promise) before any other library calls are made
isInitialized()
Checks whether the Teams client SDK has been initialized.
function isInitialized(): boolean
Returns
boolean
whether the Teams client SDK has been initialized.
notifyAppLoaded()
Notifies the frame that app has loaded and to hide the loading indicator if one is shown.
function notifyAppLoaded()
notifyExpectedFailure(IExpectedFailureRequest)
Notifies the frame that app initialized with some expected errors.
function notifyExpectedFailure(expectedFailureRequest: IExpectedFailureRequest)
Parameters
- expectedFailureRequest
- IExpectedFailureRequest
The expected failure request containing the reason and an optional message
notifyFailure(IFailedRequest)
Notifies the frame that app initialization has failed and to show an error page in its place.
function notifyFailure(appInitializationFailedRequest: IFailedRequest)
Parameters
- appInitializationFailedRequest
- IFailedRequest
The failure request containing the reason for why the app failed during initialization as well as an optional message.
notifySuccess()
Notifies the frame that app initialization is successful and is ready for user interaction.
function notifySuccess()
openLink(string)
open link API.
function openLink(deepLink: string): Promise<void>
Parameters
- deepLink
-
string
deep link.
Returns
Promise<void>
Promise that will be fulfilled when the operation has completed
registerOnThemeChangeHandler(themeHandler)
Registers a handler for theme changes.
function registerOnThemeChangeHandler(handler: themeHandler)
Parameters
- handler
- themeHandler
The handler to invoke when the user changes their theme.
Remarks
Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
Feedback
Submit and view feedback for