{"action":"created","comment":{"url":"https://api.github.com/repos/xitu/gold-miner/pulls/comments/85159951","pull_request_review_id":5884266,"id":85159951,"diff_hunk":"@@ -35,42 +38,39 @@ Next, in order to register your app for notifications, you will need to add the\n         }\n     }\n \n-Initially with this code, we get a reference to the current `UNUserNotificationCenter` object. Next, we configure our `UNAuthorizationOptions` with the notification capabilities we want our app to have. Please note that you can have any combination of options here, for example, just `alert` or both `badge` and `sound`. \n-\n-Using both of these objects, we then request authorisation for our app to display notifications by calling the `requestAuthorization(options:completionHandler:)` method on our `UNUserNotificationCenter` instance. The completion handler block of code has two parameters passed into it:\n+通过这个代码，我们得到了当前 `UNUserNotificationCenter` 的对象的引用。下一步，我们根据我们应用需要的通知能力来配置 `UNAuthorizationOptions` 。值得注意的是，这里可以使用并列的选项，比如只有`alert` ，或者同时有 `badge` 和 `sound` 。\n \n-*   A `Bool` value signifying whether or not authorisation was granted by the user.\n-*   An optional `Error` object which will contain information if, for some reason, the system was unable to request notification authorisation for your app.\n+通过使用这些对象，我们接下来通过调用 `UNUserNotificationCenter` 实例中的 `requestAuthorization(options:completionHandler:)` 方法向我们的 app 申请展示通知的认证。这个 handler 的 block 会回传两个参数\n \n-You will see that in the above code, if authorisation is granted by the user, we then register for remote notifications. If you want to implement push notifications, this line of code is required. You will also have to do a bit of extra setup for your project, as detailed in this tutorial:\n+*   一个代表是否得到的用户授权的 `Bool` 值。\n+*   一个包含了信息的 `Error` 的 optional 对象，某些情况下，系统不能为你的应用请求通知的认证。","path":"TODO/an-introduction-to-the-usernotifications-framework.md","position":57,"original_position":59,"commit_id":"116ddb8e9b5c2e7231e47e39b5000eb3d7c063c2","original_commit_id":"116ddb8e9b5c2e7231e47e39b5000eb3d7c063c2","user":{"login":"zhouzihanntu","id":14007659,"avatar_url":"https://avatars.githubusercontent.com/u/14007659?v=3","gravatar_id":"","url":"https://api.github.com/users/zhouzihanntu","html_url":"https://github.com/zhouzihanntu","followers_url":"https://api.github.com/users/zhouzihanntu/followers","following_url":"https://api.github.com/users/zhouzihanntu/following{/other_user}","gists_url":"https://api.github.com/users/zhouzihanntu/gists{/gist_id}","starred_url":"https://api.github.com/users/zhouzihanntu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhouzihanntu/subscriptions","organizations_url":"https://api.github.com/users/zhouzihanntu/orgs","repos_url":"https://api.github.com/users/zhouzihanntu/repos","events_url":"https://api.github.com/users/zhouzihanntu/events{/privacy}","received_events_url":"https://api.github.com/users/zhouzihanntu/received_events","type":"User","site_admin":false},"body":"> 一个包含了信息的 `Error` 的 optional 对象，某些情况下，系统不能为你的应用请求通知的认证。\r\n\r\n在某些情况下，系统不能为你的应用请求通知的认证时，会返回一个包含错误信息的 `Error` 对象。","created_at":"2016-10-26T16:07:54Z","updated_at":"2016-10-26T16:08:57Z","html_url":"https://github.com/xitu/gold-miner/pull/835#discussion_r85159951","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/85159951"},"html":{"href":"https://github.com/xitu/gold-miner/pull/835#discussion_r85159951"},"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-26T16:08:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c1adfe009804cd3f45a776b9ea2f026172ea04bf","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/116ddb8e9b5c2e7231e47e39b5000eb3d7c063c2","head":{"label":"Danny1451:translate","ref":"translate","sha":"116ddb8e9b5c2e7231e47e39b5000eb3d7c063c2","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-25T01:38:57Z","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":15797,"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-26T14:07:44Z","pushed_at":"2016-10-26T13:57:18Z","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":16866,"stargazers_count":4493,"watchers_count":4493,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":807,"mirror_url":null,"open_issues_count":22,"forks":807,"open_issues":22,"watchers":4493,"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/116ddb8e9b5c2e7231e47e39b5000eb3d7c063c2"}}}}
{"actor":{"display_login":"zhouzihanntu"}}