简体   繁体   English

将Google云消息传递集成到iOS应用中

[英]Integrate Google cloud messaging in iOS app

My requirement is to receive push notification From GCM . 我的要求是从GCM接收推送通知。 My API(php) server will send push notification to device based upon the Device Id am sending to my API. 我的API(php)服务器将根据要发送到我的API的设备ID向设备发送推送通知。

I tried in their developer site. 我在他们的开发人员网站上尝试过。 It gives me a sample of sending from device . 它给了我一个从设备发送的样本。 But android there are so many links how to integrate receiving push notofications in android . 但是android有太多的链接如何集成android中的接收推送通知。

So how can i integrate in iOS . 那么我该如何整合到iOS中呢? With google cloud messaging . 使用Google云消息传递。

If you go to the Google Cloud Messaging homepage , it reads: 如果您转到Google Cloud Messaging主页 ,它将显示为:

Google Cloud Messaging for Android (GCM) is a service that allows you to send data from your server to your users' Android-powered device , and also to receive messages from devices on the same connection. Android专用的Google Cloud Messaging(GCM)是一项服务,可让您将服务器中的数据发送到用户的Android设备 ,也可以从同一连接的设备接收消息。

Google Cloud Messaging is for sending push notifications to Android devices, not to iOS devices. Google Cloud Messaging用于将推送通知发送到Android设备,而不是iOS设备。 In other words, you cannot do what you are trying to do. 换句话说,您无法做您想做的事情。

Apple offers a similar service called Apple Push Notification Service (APNS). Apple提供了类似的服务,称为Apple Push Notification Service (APNS)。 You can use APNS to send push notifications to iOS users. 您可以使用APNS向iOS用户发送推送通知。

In other words, you PHP server needs to integrate with GCM and APNS. 换句话说,您的PHP服务器需要与GCM APNS集成。

Now GCM supports push notification for both android and ios. 现在,GCM支持android和ios的推送通知。 Here is the link which can help you to integrate GCM in ios app- 这是可以帮助您将GCM集成到ios应用中的链接,

https://developers.google.com/cloud-messaging/ios/start https://developers.google.com/cloud-messaging/ios/start

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM