如何在工作灯中创建本地通知 [英] How can i create local Notification in worklight

查看:163
本文介绍了如何在工作灯中创建本地通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Worklight创建一个应用。我需要在特定时间显示通知,如闹钟。它离线时有效,所以我不能使用推送通知。

I'm creating an app using Worklight. I need to show a Notification at specific time like an alarm clock. It'd work when offline so i cannot use Push Notification.

我需要通知如下图所示。谢谢。

I need Notification like image below. Thanks.

推荐答案

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

这篇关于如何在工作灯中创建本地通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆