来自在线 API:
An HTTP PUT to /api/device_tokens/ registers a device token on our end. This lets us know that the device token is active, and should happen every time the application is opened to ensure that the list of device tokens remains up-to-date.
首先我该如何获取设备 token ?
最佳答案
我相信你需要看看here : 实现 application:didRegisterForRemoteNotificationsWithDeviceToken
方法来接收设备 token 。
编辑: Urban Airship 指南位于 http://urbanairship.com/docs/apns_test_client.html .
编辑:发送 APNS 消息的唯一方法是使用设备 token :您必须将设备 token 传回作为通知起始点的任何非 Apple 服务器。事务中有 3 个逻辑实体:设备、APNS 服务器(Apple 的后端)和原始服务器(在本例中为 Urban Airship 的服务器)。设备和 Apple 的后端已经拥有 token (或可以生成 token )。 Urban Airship 服务器仅在您从设备向其发送 token 时才会获取该 token 。然后它可以使用该 token 与 APNS 后端通信并识别设备。您要做的是使用 application:didRegisterForRemoteNotificationsWithDeviceToken
回调,然后(通过 HTTP,或您选择的任何其他有线协议(protocol))将该 token 发送到原始服务器(Urban Airship 文档向您展示了如何做与他们的图书馆)。他们的服务器现在可以使用该 token 与 APNS 后端通信。
关于ios - 我从哪里获得 Urban Airship 注册 iOS 所需的设备 token ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7586669/