機械翻訳について

ブラウザ・タブおよびデスクトップ通知内のTabContextで通知を表示

タイトルとサマリーを含む簡単なトースト・メッセージの例を次に示します。

Typescriptの例を次に示します:

const frameworkProvider: IUiEventsFrameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('MyFirstExtensionID'); 
const tabContext: ITabContext = await frameworkProvider.getTabContext('browserTabId');
let notificationContext: INotificationContext = await tabContext.getNotificationContext('notificationId007'); 
const requestObject: IShowNotificationRequest = frameworkProvider.requestHelper.createPublishRequest('ShowNotification') as IShowNotificationRequest  requestObject.setTitle('title');  
requestObject.setSummary('Error message summary'); 
notificationContext.publish(requestObject).then((message) => { 
	const response: INotificationOperationResponse = message as INotificationOperationResponse; 
	//custom code 
});
JavaScriptの例を次に示します:
const frameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('MyFirstExtensionID'); 
const tabContext = await frameworkProvider.getTabContext('browserTabId');
let notificationContext = await tabContext.getNotificationContext('notificationId007'); 
const requestObject = frameworkProvider.requestHelper.createPublishRequest('ShowNotification');  
requestObject.setTitle('title');  
requestObject.setSummary('error message summary '); 
notificationContext.publish(requestObject).then((response) => { 
// custom code 
}).catch((err) => { 
console.log(err); 
});