设备到设备的推送通知系统
嗯,我的想法是制作一个安装在两个或更多设备上的应用程序。主要或“头部”设备可以以推送通知的形式向特定设备之一发出呼叫。推送通知可以是预设的或者其他什么。目标是建立一个简单的通知系统。我为其制作此内容的所有用户都拥有一台处于活动状态的 iPad,并且坐在他们面前的桌子上。将其想象为一种医生工具,用于在患者准备好时将护士叫到房间。告诉我这是否足够清楚。
这将如何完成?
Well, my idea is to make an app that is installed on two or more devices. The main or "head" device can send out a call to one of the specific devices in the form of a push notification. The push notification could be preset or whatever. The goal would to be a simple notification system. All of the users who I am making this for have an iPad active and sitting on a desk in front of them. Imagine this as a doctor tool for calling the nurse into the room when the patient is ready. Tell me if this is clear enough.
How would this be done?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我正确理解你的问题,你想开发一个可以将通知推送到其他设备的应用程序。
最好的方法是拥有一个服务器并让设备发送通知以向服务器发送请求。然后服务器会将其存储在数据库中。然后,当其他设备向服务器发送请求以检查是否有新内容时,它们会看到最新的条目并向手机推送通知。
参考 Dave DeLong 的评论,如果人们不想使用分钟/文本/3G/4G,而只想使用 WiFi,那么这个应用程序实际上可能会很好。对于小公司来说也比使用对讲机有好处。 (最后一部分可能有些牵强。)
祝开发顺利!
为了使设备检查来自服务器的新通知,只需让它在设定的时间间隔内访问一个链接(可能每 5-10 秒一次;理想的情况是让用户设置更改检查之间的时间间隔) ):
hxxp://domain.com/checkForNew.php?deviceID=foo&otherSecurity=blah
然后让 PHP 返回一些您可能需要的值。示例输出如下:
在 iPhone 上,您可以使用以下方式获取此内容:(
此代码可以在此处找到:从 UIWebView 读取 HTML 内容 )
最后,将此字符串分离到适当的变量中并推送通知。
If I understand your question correctly, you want to develop an app that can push notifications to other devices.
The best way to would be to have a server and have the device sending the notification to send a request to the server. The server would then store it in a database. Then when the other devices send a request to the server to check for anything new, they would see that newest entry and push a notification to the phone.
In reference to Dave DeLong's comment, this app might actually be good if people don't want to use their minutes/texts/3G/4G, but instead only want to use WiFi. Also would be good for a small corporation instead of having walki-talkis. (That last part may be a stretch.)
Good luck on developing!
In order to make the device check for new notifications from the server simply have it access a link during a set interval (maybe like every 5-10 seconds; an ideal situation would be to have a setting for users to change the time interval between checks):
hxxp://domain.com/checkForNew.php?deviceID=foo&otherSecurity=blah
Then have the PHP return some kinds of values that you may need. An example output would be:
On the iPhone you can get this content using:
(This code can be found here: Reading HTML content from a UIWebView )
Finally, separate this string into appropriate variables and push the notification.