我想在我的应用程序(Web Tizen 2.3.2)中提供回复功能。如果我添加一个,我目前可以让键盘弹出<input>
,但是如果我可以实现与三星使用相同的东西会更好。许多三星应用程序都使用它。它必须是 Tizen OS 中的内置功能。
这是我正在谈论的内容的屏幕截图。当我在自己的应用程序中按下回复时,我希望能够显示相同的屏幕,就像手表上的少数三星应用程序或回复通知一样
谢谢
可以使用Tizen Web Notification API在 Samsung Gear 上显示通知。
var appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/create_content",
null, "image/png", null, null);
var notificationDict =
{
/* Notification content */
content: "Notification Content",
/* Path to the notification icon */
iconPath: "images/image1.png",
/* Path to the sound file to be played when the notification is displayed */
soundPath: "",
/* Device vibrates when the notification is displayed */
vibration: true,
/* Application control to be launched when the user selects the notification */
appControl: appControl
};
var notification = new tizen.StatusNotification("SIMPLE", "Simple notification", notificationDict);
tizen.notification.post(notification);
但我无法使用此 API 添加回复按钮。我在Samsung Rich Notification SDK上看到了这个功能。如果您的要求符合,您可以使用。
我找到了根据需要显示键盘的指南。
检查会话:可穿戴应用程序Web 版中的 Input Delegator
检查会话:Wearable Applications Native 版本中的 Input Delegator
尝试这个:
var appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/get_input", null, null, null, null, null);
tizen.application.launchAppControl(appControl, null, function() {
console.log("launch application control succeed");
}, function(e) {
console.log("launch application control failed. reason: " + e.message);}, null);
例如,您也可以只呼叫语音输入。
您需要实现List
UI 控件以显示这些选项。