从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.

对我来说,有什么好榜样吗?

Any good exemple for me?

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

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

使用诸如解析 Urban 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.