iphone:Enabling-push-notifications

出自UXGuide.net

跳转到:导航, 搜索

请帮助我们修订和更新本文的译文部分

本文的译文部分可能是由多个贡献者提供或从不同的渠道收集,未经过最终审阅和整理,请您帮助我们一起修订和更新本文的译文部分。

启用推送通知
Enabling Push Notifications

When you register your application with Apple Push Notification Service, you can arrange to alert users when new data arrives, even if your application isn’t running. When a device receives a message for an application that isn’t running, it can notify the user by:

当你为你的应用程序注册苹果推送通知服务时,可以在新的数据到达时提醒用户处理,即使你的应用程序没有运行。当设备在一个应用程序不运行时接收到消息,它可以这样通知用户:

or some combination of these. The user might respond by starting the application to manage the new data or merely acknowledging its arrival. (To learn how to handle push notifications in code, see Apple Push Notification Service Programming Guide.)

或这些元素的组合。用户可能会作出下列反应,启动应用程序来管理新的数据,或者只了解它的到来。(要了解如何用代码处理推送通知,参见苹果推送通知服务编程指南。)

Note: Delivery of push notifications is not guaranteed. Also, users can refuse to receive notifications system-wide. Push notifications are intended to notify users of new data, not to deliver critical data to your application.

注意:发送推送通知是不能有保证的。同时,用户可以拒绝接收全系统的通知。推送通知的目的是通知用户有新数据,并不会向你的应用程序提供重要数据。

The Notifications section in the built-in Settings application hosts push notification settings for every application that registers for the Apple Push Notification Service. For each application, iPhone OS provides settings for users to allow or disallow badging, sounds, and alert messages.

内置的设置应用程序中的通知部分主导着推送通知的设置,这些推送通知提供给每一个注册了苹果推送通知服务的应用。对于每一个应用来说,iPhone操作平台为用户提供了设置允许或不允许标记,声音和警示的消息。

Take some time to think about the types of events for which users would appreciate notification. A notification should give users useful, actionable information they want to receive, even when they’re not using your application.

需要一些时间来考虑什么类型的事件通知是用户希望的。通知应能够给用户提供他们想要接收的那些有用的,可操作的信息,即使他们没有使用你的应用程序。

After you’ve identified the events your users are likely to care about, you should also allow users to decide which events should generate what type of notification, if any. If you don’t allow users to customize the push notification experience in your application, you’re liable to pester users with notifications they’re not interested in.

当你发现了某些用户比较感兴趣的事件后,如果有的话,你也应该允许你的用户决定哪些事件产生什么类型的通知。如果你没有允许用户自定义应用程序中的推送通知的体验,你无异于用他们不感兴趣的通知纠缠他们.

Users can choose which types of notifications they want to receive, so you should support all three types:

用户可以选择他们想要接受哪些类型的通知,所以你应该支持所有三种类型:

徽章。用徽章来告诉用户有新的他们感兴趣的内容,这是侵入性最小的一种方式。徽章是出现在主界面应用图标右上角的一个小椭圆。你不能对徽章的出现做任何控制,它只包含数字,没有字母和标点。
Badging works well when you want to tell users how many items are waiting for their attention. For example, the number in a badge might indicate unread messages, newly assigned tasks, or how many remote players are currently playing a game.
当你想要告诉用户有多少项目在等待他们的注意时,徽章很有效。例如,在一个徽章里数目可能会显示未读消息,新分配的任务,或者有多少远程参与者目前在玩游戏。
声音。你可以提供一个自定义警告声音,也可以使用内置的警告声。如果你创建一个自定义的声音,应确定它是短暂的,独特的,专业化制作的。 (要了解有关声音的技术要求,在苹果推通知服务编程指南中参见“准备自定义警告声音”。)请注意在设备发出通知时,你不能强迫它振动;应该由用户控制是否警告伴随振动。
An easily recognized sound is ideal for situations in which the notification arrival itself provides enough information for users to act. For example, a collaborative task management system might use a unique sound to accompany the completion of a member’s assignment. Merely hearing this sound tells the user that the assignment has been completed.
一个容易识别的声音是十分理想的选择,伴随的是通报自己的到来,从而为用户提供足够的信息便于采取行动。例如,用于协作完成任务的管理系统,可以使用一个独特的声音,伴随成员任务的完成。仅仅听到这个声音,用户就会知道已经完成了任务。
警告。警告是侵入性最强的通知用户有新内容的方式。警告上方显示应用程序的名称,下面显示消息,底部有一个或两个按钮。如果你指定两个按钮,警告左侧显示关闭按钮和右侧显示视图按钮(用户可以通过点击视图按钮,同时关闭该警告并启动应用程序)。如果你指定一个按钮,警告显示一个确定按钮。关闭按钮和确定按钮都可以使警告消失,并且不打开应用程序。
Alerts interrupt the user’s workflow, so they’re best used sparingly to deliver a short, important message about an event. In particular, be sure to avoid including any advertising content in your alert message.
警告会干扰用户的工作流程,因此最好少用他们,除非是用来为你提供有关事件简短的,重要的信息。尤其是,一定要避免警告消息中的包含任何广告内容。
导航
工具箱