从 ios 应用程序发送推送通知 [英] Send push notification from ios app

查看:31
本文介绍了从 ios 应用程序发送推送通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要创建一个发送通知的 ios 应用程序.(类似于 Pushmebaby (https://github.com/stefanhafeneger/PushMeBaby)).(还要注意,这个 mac 应用程序已经 2 岁了,对我来说崩溃了)

I need to create a ios app who send notification. (similar to Pushmebaby (https://github.com/stefanhafeneger/PushMeBaby)). (also note that this mac app was 2 years old ans crash for me)

我已经看到一些 php 网站的例子来做到这一点,买什么都可以直接从 ios 做到这一点.

I've seen some exemple of php web site to do this, buy nothing to be able to do this directly from ios.

有什么好的例子吗?

谢谢,祝您有美好的一天!

Thanks, and have a nice day!

推荐答案

您是否需要向当前正在运行您的应用的 iOS 设备发送通知?如果是这样,您应该查看 本地通知.

Are you needing to send notifications to the iOS device that is currently running your app? If so, you should look into local notifications.

如果你真的想从你的 iOS 设备向其他 iOS 设备发送推送通知,你基本上有两个选择

If you're actually wanting to send push notifications to other iOS devices from your iOS device, you basically have two options

使用像 ParseUrban Airship 为您发送通知.然后,您可以向他们的 API 发出请求,以向用户的设备发送推送通知.

Use a service like Parse or Urban Airship to send the notifications for you. You can then fire off a request to their API to initiate the push notification to your user's devices.

按照 Apple 的指南设置您的基础架构 以便您可以向 Apple 的服务器发送推送通知.然后,您需要构建一个 API,以便您的 iOS 设备可以与您的推送通知服务器通信,以向 Apple 的服务器发起推送通知请求.

Set up your infrastructure per Apple's guidelines so that you can send push notifications to Apple's servers. Then, you'll need to build an API so that your iOS device can communicate with your push notification server to initiate the push notification request to Apple's servers.

真正的推送通知支持并不容易,所以如果它适合你,我会建议选项 1.

True push notification support is not easy so I would suggest option 1 if it works out for you.

这篇关于从 ios 应用程序发送推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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