苹果推送通知注册&设备令牌收到澄清? [英] Apple Push Notification Registration & Device Token Receive clarification?

查看:33
本文介绍了苹果推送通知注册&设备令牌收到澄清?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发具有 Apple Push Notification 集成的 iPhone 应用程序.对此我有些怀疑.

I am working on an iPhone app with Apple Push Notification integration. I have some doubts on this.

  1. 如果用户点击了 APNS 注册提醒中的不允许"按钮,我们的代码是否仍会收到来自 APNS 的设备令牌?

  1. If the user clicked "Dont Allow" button in the APNS registration alert, will our code still receives the Device Token from APNS?

我已经测试过当用户关闭 iPhone 通知中的通知时,应用程序仍然从 APNS 接收设备令牌?正确吗?

I have tested that when the user switched off the notification in iPhone notification, still the app receives the Device Token from APNS? It is correct?

有人可以澄清这些疑问吗?

Can anyone please clarify these doubts?

推荐答案

  1. 根据我对 APNS 的理解,它不取决于用户的操作(正如您提到的,如果当用户单击不允许"按钮时),您的 iOS 是否会接收设备令牌.

  1. In my understanding on APNS, it doesn't depend on the user's action (as you mentioned that if when the user clicks on "Don't Allow" button) for your iOS to receive the Device Token.

如果您包含在您的应用中:

If you included in your app:

- (void)application:didRegisterForRemoteNotificationsWithDeviceToken        

这意味着您基于 iOS 的应用正在发送推送通知注册请求.作为回报,Apple 将 Device Token 发送给 iOS;然后 iOS 将令牌发送到应用程序,然后应用程序将其发送给他们的服务提供商.

This means that your iOS-based app is sending a request for Push Notification registration. In return, Apple sends the Device Token to the iOS; then the iOS sends the token to the app and then the app sends it to their service provider.

请注意,当用户被询问不允许"时,并不意味着您不会收到设备令牌.不允许"是指要对应用程序接收到的针对用户的任何通知采取的操作.说,位置.这是完全不同的事情.这意味着用户不允许应用使用他/她的位置.

Note that when the user is asked "Don't Allow" doesn't mean that you're not going to receive the device token. "Don't Allow" refers to the action to be taken to any notification received by the app that is intended for the user. Say, location. This is a whole different thing. This means that the user doesn't allow the app to use his/her location.

是的.它仍然收到设备令牌,正如我在 #1 中对您的问题的回答中所讨论的那样.这只是您的应用程序的一个设置,这意味着只要有与您的应用程序相关的任何信息的更新,您将不会收到任何可见的通知(徽章、消息或声音).这就像将您的 Facebook 帐户设置为仅在您的朋友向您发送私人消息时接收通知.除此之外,您根本不会收到通知.

Yes. it still receives the Device Token as what I have discussed in my answer to your question in #1. This is only a setting for your app, which means that you won't be receiving any visible notification (badge, message or a sound) whenever there are updates about any information in relevance to your application. It's like setting your Facebook account to only receive notifications when your friends sends you a private message. Other than that, you won't be notified at all.

启用APNS的过程为:

The process of enabling APNS is:

  1. 请求证书颁发机构
  2. 创建应用 ID
  3. 为推送通知配置 AppId
  4. 创建配置文件
  5. 配置设备
  6. 在 Xcode 中启用配置文件
  7. 创建推送通知提供程序.

有关 APNS 的更多了解,请查看 这个出来了.

For more understanding on APNS, check this out.

这篇关于苹果推送通知注册&设备令牌收到澄清?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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