{"action":"created","comment":{"url":"https://api.github.com/repos/xitu/gold-miner/pulls/comments/85334791","pull_request_review_id":6055328,"id":85334791,"diff_hunk":"@@ -114,23 +114,23 @@ Lastly, we now just need to create the `UNNotificationRequest` object and schedu\n         }\n     }\n \n-Initially with this code, we create the request object by passing an identifier, content object and trigger into the initialiser. We then call the `add(_:completionHandler:)` method on the current `UNUserNotificationCenter` object and use the completion handler to perform logic based on whether or not the notification was scheduled properly. \n+有了这些代码，我们通过传递一个标示，内容对象和触发器给构造函数来创建了请求对象。接下来我们调用当前的 `UNUserNotificationCenter` 对象中的 `add(_:completionHandler:)` 方法，然后使用完成的 handler 来实现是否成功计划发送通知之后的逻辑。\n \n-## 3. Receiving Notifications\n+## 3. 接收通知\n \n-When using the UserNotifications framework, processing incoming notifications is handled by an object which you designate conforming to the `UNUserNotificationCenterDelegate` protocol. This object can be anything you want and doesn't have to be the app delegate as in previous iOS versions. One important thing to note, though, is that you must set your delegate before your app has been fully launched. For an iOS app, this means that you must assign your delegate inside either the `application(_:willFinishLaunchingWithOptions:)` or `application(_:didFinishLaunchingWithOptions:)` method of your app delegate. Setting the delegate for user notifications is done very easily with the following code:\n+当使用 UserNotifications framework的时候，处理收到消息的是一个实现了 `UNUserNotificationCenterDelegate`协议的对象。这个对象可以是你想要的任何对象，并不是像之前的 iOS 版本，一定要是应用的代理。另一个需要注意的是，你必须在你的应用完全启动之后才能设置代理。对一个 iOS 应用来说，这个意味着你必须在你的应用的代理中除了 `application(_:willFinishLaunchingWithOptions:)` 和 `application(_:didFinishLaunchingWithOptions:)` 这两个方法中来给代理赋值。通过下面的代码可以非常容易的实现给用户通知设置代理：","path":"TODO/an-introduction-to-the-usernotifications-framework.md","position":151,"original_position":151,"commit_id":"4517dc2e10da67a1ec54657db26d24a18cbbb5ef","original_commit_id":"4517dc2e10da67a1ec54657db26d24a18cbbb5ef","user":{"login":"sqrthree","id":8622362,"avatar_url":"https://avatars.githubusercontent.com/u/8622362?v=3","gravatar_id":"","url":"https://api.github.com/users/sqrthree","html_url":"https://github.com/sqrthree","followers_url":"https://api.github.com/users/sqrthree/followers","following_url":"https://api.github.com/users/sqrthree/following{/other_user}","gists_url":"https://api.github.com/users/sqrthree/gists{/gist_id}","starred_url":"https://api.github.com/users/sqrthree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sqrthree/subscriptions","organizations_url":"https://api.github.com/users/sqrthree/orgs","repos_url":"https://api.github.com/users/sqrthree/repos","events_url":"https://api.github.com/users/sqrthree/events{/privacy}","received_events_url":"https://api.github.com/users/sqrthree/received_events","type":"User","site_admin":false},"body":"『framework』后面的空格？","created_at":"2016-10-27T13:22:36Z","updated_at":"2016-10-27T13:24:45Z","html_url":"https://github.com/xitu/gold-miner/pull/835#discussion_r85334791","pull_request_url":"https://api.github.com/repos/xitu/gold-miner/pulls/835","_links":{"self":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/comments/85334791"},"html":{"href":"https://github.com/xitu/gold-miner/pull/835#discussion_r85334791"},"pull_request":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/835"}}},"pull_request":{"url":"https://api.github.com/repos/xitu/gold-miner/pulls/835","id":90724435,"html_url":"https://github.com/xitu/gold-miner/pull/835","diff_url":"https://github.com/xitu/gold-miner/pull/835.diff","patch_url":"https://github.com/xitu/gold-miner/pull/835.patch","issue_url":"https://api.github.com/repos/xitu/gold-miner/issues/835","number":835,"state":"open","locked":false,"title":"UserNotifications Framwork 入门介绍","user":{"login":"Danny1451","id":3889817,"avatar_url":"https://avatars.githubusercontent.com/u/3889817?v=3","gravatar_id":"","url":"https://api.github.com/users/Danny1451","html_url":"https://github.com/Danny1451","followers_url":"https://api.github.com/users/Danny1451/followers","following_url":"https://api.github.com/users/Danny1451/following{/other_user}","gists_url":"https://api.github.com/users/Danny1451/gists{/gist_id}","starred_url":"https://api.github.com/users/Danny1451/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Danny1451/subscriptions","organizations_url":"https://api.github.com/users/Danny1451/orgs","repos_url":"https://api.github.com/users/Danny1451/repos","events_url":"https://api.github.com/users/Danny1451/events{/privacy}","received_events_url":"https://api.github.com/users/Danny1451/received_events","type":"User","site_admin":false},"body":"翻译完成","created_at":"2016-10-25T01:41:28Z","updated_at":"2016-10-27T13:24:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"523f7db3cc810a63f183d30d4b8d213f31ac6cd7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/xitu/gold-miner/pulls/835/commits","review_comments_url":"https://api.github.com/repos/xitu/gold-miner/pulls/835/comments","review_comment_url":"https://api.github.com/repos/xitu/gold-miner/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xitu/gold-miner/issues/835/comments","statuses_url":"https://api.github.com/repos/xitu/gold-miner/statuses/4517dc2e10da67a1ec54657db26d24a18cbbb5ef","head":{"label":"Danny1451:translate","ref":"translate","sha":"4517dc2e10da67a1ec54657db26d24a18cbbb5ef","user":{"login":"Danny1451","id":3889817,"avatar_url":"https://avatars.githubusercontent.com/u/3889817?v=3","gravatar_id":"","url":"https://api.github.com/users/Danny1451","html_url":"https://github.com/Danny1451","followers_url":"https://api.github.com/users/Danny1451/followers","following_url":"https://api.github.com/users/Danny1451/following{/other_user}","gists_url":"https://api.github.com/users/Danny1451/gists{/gist_id}","starred_url":"https://api.github.com/users/Danny1451/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Danny1451/subscriptions","organizations_url":"https://api.github.com/users/Danny1451/orgs","repos_url":"https://api.github.com/users/Danny1451/repos","events_url":"https://api.github.com/users/Danny1451/events{/privacy}","received_events_url":"https://api.github.com/users/Danny1451/received_events","type":"User","site_admin":false},"repo":{"id":70561643,"name":"gold-miner","full_name":"Danny1451/gold-miner","owner":{"login":"Danny1451","id":3889817,"avatar_url":"https://avatars.githubusercontent.com/u/3889817?v=3","gravatar_id":"","url":"https://api.github.com/users/Danny1451","html_url":"https://github.com/Danny1451","followers_url":"https://api.github.com/users/Danny1451/followers","following_url":"https://api.github.com/users/Danny1451/following{/other_user}","gists_url":"https://api.github.com/users/Danny1451/gists{/gist_id}","starred_url":"https://api.github.com/users/Danny1451/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Danny1451/subscriptions","organizations_url":"https://api.github.com/users/Danny1451/orgs","repos_url":"https://api.github.com/users/Danny1451/repos","events_url":"https://api.github.com/users/Danny1451/events{/privacy}","received_events_url":"https://api.github.com/users/Danny1451/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Danny1451/gold-miner","description":"掘金翻译计划，翻译掘金上优质的英文文章","fork":true,"url":"https://api.github.com/repos/Danny1451/gold-miner","forks_url":"https://api.github.com/repos/Danny1451/gold-miner/forks","keys_url":"https://api.github.com/repos/Danny1451/gold-miner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Danny1451/gold-miner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Danny1451/gold-miner/teams","hooks_url":"https://api.github.com/repos/Danny1451/gold-miner/hooks","issue_events_url":"https://api.github.com/repos/Danny1451/gold-miner/issues/events{/number}","events_url":"https://api.github.com/repos/Danny1451/gold-miner/events","assignees_url":"https://api.github.com/repos/Danny1451/gold-miner/assignees{/user}","branches_url":"https://api.github.com/repos/Danny1451/gold-miner/branches{/branch}","tags_url":"https://api.github.com/repos/Danny1451/gold-miner/tags","blobs_url":"https://api.github.com/repos/Danny1451/gold-miner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Danny1451/gold-miner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Danny1451/gold-miner/git/refs{/sha}","trees_url":"https://api.github.com/repos/Danny1451/gold-miner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Danny1451/gold-miner/statuses/{sha}","languages_url":"https://api.github.com/repos/Danny1451/gold-miner/languages","stargazers_url":"https://api.github.com/repos/Danny1451/gold-miner/stargazers","contributors_url":"https://api.github.com/repos/Danny1451/gold-miner/contributors","subscribers_url":"https://api.github.com/repos/Danny1451/gold-miner/subscribers","subscription_url":"https://api.github.com/repos/Danny1451/gold-miner/subscription","commits_url":"https://api.github.com/repos/Danny1451/gold-miner/commits{/sha}","git_commits_url":"https://api.github.com/repos/Danny1451/gold-miner/git/commits{/sha}","comments_url":"https://api.github.com/repos/Danny1451/gold-miner/comments{/number}","issue_comment_url":"https://api.github.com/repos/Danny1451/gold-miner/issues/comments{/number}","contents_url":"https://api.github.com/repos/Danny1451/gold-miner/contents/{+path}","compare_url":"https://api.github.com/repos/Danny1451/gold-miner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Danny1451/gold-miner/merges","archive_url":"https://api.github.com/repos/Danny1451/gold-miner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Danny1451/gold-miner/downloads","issues_url":"https://api.github.com/repos/Danny1451/gold-miner/issues{/number}","pulls_url":"https://api.github.com/repos/Danny1451/gold-miner/pulls{/number}","milestones_url":"https://api.github.com/repos/Danny1451/gold-miner/milestones{/number}","notifications_url":"https://api.github.com/repos/Danny1451/gold-miner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Danny1451/gold-miner/labels{/name}","releases_url":"https://api.github.com/repos/Danny1451/gold-miner/releases{/id}","deployments_url":"https://api.github.com/repos/Danny1451/gold-miner/deployments","created_at":"2016-10-11T06:08:12Z","updated_at":"2016-10-11T06:04:17Z","pushed_at":"2016-10-27T08:33:31Z","git_url":"git://github.com/Danny1451/gold-miner.git","ssh_url":"git@github.com:Danny1451/gold-miner.git","clone_url":"https://github.com/Danny1451/gold-miner.git","svn_url":"https://github.com/Danny1451/gold-miner","homepage":"http://gold.xitu.io","size":15815,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"xitu:master","ref":"master","sha":"e78481af76842ce87f114d343faeadd1f43e0cff","user":{"login":"xitu","id":10482599,"avatar_url":"https://avatars.githubusercontent.com/u/10482599?v=3","gravatar_id":"","url":"https://api.github.com/users/xitu","html_url":"https://github.com/xitu","followers_url":"https://api.github.com/users/xitu/followers","following_url":"https://api.github.com/users/xitu/following{/other_user}","gists_url":"https://api.github.com/users/xitu/gists{/gist_id}","starred_url":"https://api.github.com/users/xitu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xitu/subscriptions","organizations_url":"https://api.github.com/users/xitu/orgs","repos_url":"https://api.github.com/users/xitu/repos","events_url":"https://api.github.com/users/xitu/events{/privacy}","received_events_url":"https://api.github.com/users/xitu/received_events","type":"Organization","site_admin":false},"repo":{"id":45512989,"name":"gold-miner","full_name":"xitu/gold-miner","owner":{"login":"xitu","id":10482599,"avatar_url":"https://avatars.githubusercontent.com/u/10482599?v=3","gravatar_id":"","url":"https://api.github.com/users/xitu","html_url":"https://github.com/xitu","followers_url":"https://api.github.com/users/xitu/followers","following_url":"https://api.github.com/users/xitu/following{/other_user}","gists_url":"https://api.github.com/users/xitu/gists{/gist_id}","starred_url":"https://api.github.com/users/xitu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xitu/subscriptions","organizations_url":"https://api.github.com/users/xitu/orgs","repos_url":"https://api.github.com/users/xitu/repos","events_url":"https://api.github.com/users/xitu/events{/privacy}","received_events_url":"https://api.github.com/users/xitu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/xitu/gold-miner","description":"掘金翻译计划，翻译掘金上优质的英文文章","fork":false,"url":"https://api.github.com/repos/xitu/gold-miner","forks_url":"https://api.github.com/repos/xitu/gold-miner/forks","keys_url":"https://api.github.com/repos/xitu/gold-miner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xitu/gold-miner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xitu/gold-miner/teams","hooks_url":"https://api.github.com/repos/xitu/gold-miner/hooks","issue_events_url":"https://api.github.com/repos/xitu/gold-miner/issues/events{/number}","events_url":"https://api.github.com/repos/xitu/gold-miner/events","assignees_url":"https://api.github.com/repos/xitu/gold-miner/assignees{/user}","branches_url":"https://api.github.com/repos/xitu/gold-miner/branches{/branch}","tags_url":"https://api.github.com/repos/xitu/gold-miner/tags","blobs_url":"https://api.github.com/repos/xitu/gold-miner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xitu/gold-miner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xitu/gold-miner/git/refs{/sha}","trees_url":"https://api.github.com/repos/xitu/gold-miner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xitu/gold-miner/statuses/{sha}","languages_url":"https://api.github.com/repos/xitu/gold-miner/languages","stargazers_url":"https://api.github.com/repos/xitu/gold-miner/stargazers","contributors_url":"https://api.github.com/repos/xitu/gold-miner/contributors","subscribers_url":"https://api.github.com/repos/xitu/gold-miner/subscribers","subscription_url":"https://api.github.com/repos/xitu/gold-miner/subscription","commits_url":"https://api.github.com/repos/xitu/gold-miner/commits{/sha}","git_commits_url":"https://api.github.com/repos/xitu/gold-miner/git/commits{/sha}","comments_url":"https://api.github.com/repos/xitu/gold-miner/comments{/number}","issue_comment_url":"https://api.github.com/repos/xitu/gold-miner/issues/comments{/number}","contents_url":"https://api.github.com/repos/xitu/gold-miner/contents/{+path}","compare_url":"https://api.github.com/repos/xitu/gold-miner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xitu/gold-miner/merges","archive_url":"https://api.github.com/repos/xitu/gold-miner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xitu/gold-miner/downloads","issues_url":"https://api.github.com/repos/xitu/gold-miner/issues{/number}","pulls_url":"https://api.github.com/repos/xitu/gold-miner/pulls{/number}","milestones_url":"https://api.github.com/repos/xitu/gold-miner/milestones{/number}","notifications_url":"https://api.github.com/repos/xitu/gold-miner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xitu/gold-miner/labels{/name}","releases_url":"https://api.github.com/repos/xitu/gold-miner/releases{/id}","deployments_url":"https://api.github.com/repos/xitu/gold-miner/deployments","created_at":"2015-11-04T03:29:13Z","updated_at":"2016-10-27T06:45:12Z","pushed_at":"2016-10-27T08:33:33Z","git_url":"git://github.com/xitu/gold-miner.git","ssh_url":"git@github.com:xitu/gold-miner.git","clone_url":"https://github.com/xitu/gold-miner.git","svn_url":"https://github.com/xitu/gold-miner","homepage":"http://gold.xitu.io","size":16822,"stargazers_count":4508,"watchers_count":4508,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":812,"mirror_url":null,"open_issues_count":23,"forks":812,"open_issues":23,"watchers":4508,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/835"},"html":{"href":"https://github.com/xitu/gold-miner/pull/835"},"issue":{"href":"https://api.github.com/repos/xitu/gold-miner/issues/835"},"comments":{"href":"https://api.github.com/repos/xitu/gold-miner/issues/835/comments"},"review_comments":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/835/comments"},"review_comment":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/835/commits"},"statuses":{"href":"https://api.github.com/repos/xitu/gold-miner/statuses/4517dc2e10da67a1ec54657db26d24a18cbbb5ef"}}}}
{"actor":{"display_login":"sqrthree"}}