将 uiwebview 表单数据传递给 Objective C

发布于 2024-10-06 06:06:17 字数 132 浏览 0 评论 0原文

我正在使用phonegap 加载网络应用程序。该申请有一个表格。我想捕获此表单数据并将其传递给 Objective C,以便我可以创建本地苹果推送通知。

我无法理解如何捕获此表单数据。任何帮助将不胜感激。

谢谢, 彼得

I am using phonegap to load a web application. The application has a form. I would like to capture this form data and pass it to objective c so that I can create a local apple push notification.

I am having trouble understanding howto capture this form data. Any help would be greatly appreciated.

Thanks,
Peter

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

云雾 2024-10-13 06:06:17

我想您会想要创建一个插件来实现此功能。一些插件示例如下:https://github.com/phonegap/phonegap-plugins。请注意,Urban Airship 制作了一个推送通知插件,您可以使用它或至少使用它来获得灵感:http://blog.urbanairship.com/blog/2010/06/09/phonegap-push/

一般来说,您需要做的是创建一个扩展的 Objective-C 类PhoneGapCommand 并有一个执行推送通知工作的方法。然后,在您的 html 页面中,您需要捕获表单的 onsubmit 事件,并在 JavaScript 代码中调用 PhoneGap.exec(MyClass.myMethod", args),其中 args 是表单中名称/值对的简单哈希值。

I think you will want to create a plugin to achieve this functionality. Some examples of plugins are here: https://github.com/phonegap/phonegap-plugins. Note that there has been a push notification plugin made by Urban Airship that you could use or at least use for inspiration: http://blog.urbanairship.com/blog/2010/06/09/phonegap-push/

In general what you need to do is create an objective-c class that extends PhoneGapCommand and has a method that does the push notification work. Then in your html page you need to capture the onsubmit event of the form and call PhoneGap.exec(MyClass.myMethod", args) in you JavaScript code where args is a simple hash of name-value pairs from your form.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文