且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我如何在工作灯中创建本地通知

更新时间:2023-01-14 23:20:14

iOS 的 本地通知 功能在 Worklight 中没有内置支持.

iOS's Local Notifications feature does not have built-in support in Worklight.

添加本地通知支持的一种方法是扩展您的应用程序 使用 Cordova 插件,这将允许您运行本机代码.
这意味着您将通过遵循 Apple 的 API 在本地实现它:在应用程序中安排通知,然后通过操作系统在本地接收通知,这将允许您打开应用程序并执行可选的回调等..

One way to add Local Notifications support is by extending your application using a Cordova plug-in, which will allow you to run Native code.
This means that you will natively implement it by following Apple's APIs: to schedule the notification in the app and to then receive a notification locally via the OS, that will in turn allow you to open the app and execute an optional callback, etc...

您可以编写一个 自定义 Cordova 插件自己的,
或者 在网络上查找现有插件.

  • 将现有 Cordova 插件添加到 Worklight 时(取决于您的 Worklight 版本和 Cordova 版本),此时执行此操作的说明略有不同.

  • When adding an existing Cordova plug-in to Worklight (depending on your version of Worklight and version of Cordova), the instructions to do so are a bit different at this time.

此视频演示了如何添加现有 Cordova 插件的一个实例:将 Cordova 插件集成到 Worklight 应用程序中

This video demonstrates one instance of how to do add an existing Cordova plug-in: Integrating Cordova plugins into Worklight applications