{"action":"created","comment":{"url":"https://api.github.com/repos/xitu/gold-miner/pulls/comments/87985043","pull_request_review_id":8570877,"id":87985043,"diff_hunk":"@@ -18,27 +19,46 @@\n \n \n I had initially planned to make a comprehensive multi-part video series on setting up remote push notifications but, unfortunately, I underestimated the time it would take for me to recover from getting my wisdom teeth removed.\n+我开始的时候打算做一系列全方位的关于如何设置远程推送视频，但是，不幸的是。我低估了自己从拔智齿到恢复所需要的时间。\n+\n \n But that’s no excuse. Here’s a tutorial on how to set up push notifications in React Native (both iOS and Android) with [OneSignal](https://onesignal.com/), a service that provides free push notification delivery for multiple platforms. This is a pretty long tutorial but it’s worth it. Even if you don’t use OneSignal, much of this will apply to you (general configuration). Let’s get to it.\n+但是，这并不是什么借口。这是一系列的关于如何在ReactNative上通过使用[OneSignal](https://onesignal.com/)设置推送的教程。[OneSignal](https://onesignal.com/)一个提供跨平台的推送交付服务的服务商。这是一篇非常长的但是值得阅读的教程。即使你不使用OneSinagal。大部分的内容也是适用于你的(基础的配置)。让我们开始吧。\n \n #### Create React Native App\n-\n+#### 创建 React Native App\n First thing you’ll need is a React Native app. Maybe that’s your existing app or maybe it’s a new one. We’ll start with a new one. From the command line:\n+首先你需要一个React Native app 也须是已经存在的工程也许是一个新的项目。我们这里将使用一个新的项目。从下面的命令开始：\n+\n+\n+    react-native init OneSignalExample\n+\n \n     react-native init OneSignalExample\n \n+ \t\n+\n _Something to note going forward:_ push notifications only work on a real device, they won’t work on a simulator. I use an unlocked [refurbished Nexus 5](https://www.amazon.com/gp/product/B017RMREL6/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=B017RMREL6&linkCode=as2&tag=handlebarlabs-20&linkId=4b8388a4f02af44c275fab434156cf7e) and an [iPhone 6](https://www.amazon.com/gp/product/B00YD547Q6/ref=as_li_tl?ie=UTF8&tag=handlebarlabs-20&camp=1789&creative=9325&linkCode=as2&creativeASIN=B00YD547Q6&linkId=5b16710a735bff80c55cc47dbdb4e38b) for testing.\n \n+再继续走下去之前需要提到的是：推送只能在真机上使用，在模拟器上是无法工作的。我使用了一台未解锁的[refurbished Nexus 5](https://www.amazon.com/gp/product/B017RMREL6/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=B017RMREL6&linkCode=as2&tag=handlebarlabs-20&linkId=4b8388a4f02af44c275fab434156cf7e)还有一部[iPhone 6](https://www.amazon.com/gp/product/B00YD547Q6/ref=as_li_tl?ie=UTF8&tag=handlebarlabs-20&camp=1789&creative=9325&linkCode=as2&creativeASIN=B00YD547Q6&linkId=5b16710a735bff80c55cc47dbdb4e38b)用来测试\n+\n+\n You can access instructions for running on your device at the following links.\n+在下面的两个链接中 你可以获取到在你的设备上运行的指令。\n+\n \n *   [Instructions for iOS](https://facebook.github.io/react-native/docs/running-on-device-ios.html#accessing-the-development-server-from-device)\n+*   [关于iOS的介绍](https://facebook.github.io/react-native/docs/running-on-device-ios.html#accessing-the-development-server-from-device)\n *   [Instructions for Android](https://facebook.github.io/react-native/docs/running-on-device-android.html)\n+*   [关于安卓的介绍](https://facebook.github.io/react-native/docs/running-on-device-android.html)\n \n #### Create OneSignal Account & Create App\n \n-Next you’ll want to head over to [OneSignal](https://onesignal.com/) and sign up for an account. At that point you’ll be prompted to set up your app.\n+#### 创建OneSignal帐号&创建App\n \n+Next you’ll want to head over to [OneSignal](https://onesignal.com/) and sign up for an account. At that point you’ll be prompted to set up your app.\n \n+下面你肯定想前往[OneSignal](https://onesignal.com/)注册一个账号，在这个阶段你将按照提示设置你的app。","path":"TODO/react-native-push-notifications-with-onesignal.md","position":53,"original_position":53,"commit_id":"fc357c6c452f5c4f06910debaf6b1f03d0646cd1","original_commit_id":"fc357c6c452f5c4f06910debaf6b1f03d0646cd1","user":{"login":"Romeo0906","id":22153498,"avatar_url":"https://avatars.githubusercontent.com/u/22153498?v=3","gravatar_id":"","url":"https://api.github.com/users/Romeo0906","html_url":"https://github.com/Romeo0906","followers_url":"https://api.github.com/users/Romeo0906/followers","following_url":"https://api.github.com/users/Romeo0906/following{/other_user}","gists_url":"https://api.github.com/users/Romeo0906/gists{/gist_id}","starred_url":"https://api.github.com/users/Romeo0906/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Romeo0906/subscriptions","organizations_url":"https://api.github.com/users/Romeo0906/orgs","repos_url":"https://api.github.com/users/Romeo0906/repos","events_url":"https://api.github.com/users/Romeo0906/events{/privacy}","received_events_url":"https://api.github.com/users/Romeo0906/received_events","type":"User","site_admin":false},"body":"下面你肯定想前往->接下来你要前往","created_at":"2016-11-15T10:13:00Z","updated_at":"2016-11-15T10:13:00Z","html_url":"https://github.com/xitu/gold-miner/pull/952#discussion_r87985043","pull_request_url":"https://api.github.com/repos/xitu/gold-miner/pulls/952","_links":{"self":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/comments/87985043"},"html":{"href":"https://github.com/xitu/gold-miner/pull/952#discussion_r87985043"},"pull_request":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/952"}}},"pull_request":{"url":"https://api.github.com/repos/xitu/gold-miner/pulls/952","id":93693738,"html_url":"https://github.com/xitu/gold-miner/pull/952","diff_url":"https://github.com/xitu/gold-miner/pull/952.diff","patch_url":"https://github.com/xitu/gold-miner/pull/952.patch","issue_url":"https://api.github.com/repos/xitu/gold-miner/issues/952","number":952,"state":"open","locked":false,"title":"详解 React Native 使用 OneSignal 推送通知","user":{"login":"xiaoheiai4719","id":5488138,"avatar_url":"https://avatars.githubusercontent.com/u/5488138?v=3","gravatar_id":"","url":"https://api.github.com/users/xiaoheiai4719","html_url":"https://github.com/xiaoheiai4719","followers_url":"https://api.github.com/users/xiaoheiai4719/followers","following_url":"https://api.github.com/users/xiaoheiai4719/following{/other_user}","gists_url":"https://api.github.com/users/xiaoheiai4719/gists{/gist_id}","starred_url":"https://api.github.com/users/xiaoheiai4719/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiaoheiai4719/subscriptions","organizations_url":"https://api.github.com/users/xiaoheiai4719/orgs","repos_url":"https://api.github.com/users/xiaoheiai4719/repos","events_url":"https://api.github.com/users/xiaoheiai4719/events{/privacy}","received_events_url":"https://api.github.com/users/xiaoheiai4719/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-11-15T03:13:43Z","updated_at":"2016-11-15T10:50:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ee457f1424b38c857a8568c1de29af28c8bd81c5","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/xitu/gold-miner/pulls/952/commits","review_comments_url":"https://api.github.com/repos/xitu/gold-miner/pulls/952/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/952/comments","statuses_url":"https://api.github.com/repos/xitu/gold-miner/statuses/fc357c6c452f5c4f06910debaf6b1f03d0646cd1","head":{"label":"xiaoheiai4719:master","ref":"master","sha":"fc357c6c452f5c4f06910debaf6b1f03d0646cd1","user":{"login":"xiaoheiai4719","id":5488138,"avatar_url":"https://avatars.githubusercontent.com/u/5488138?v=3","gravatar_id":"","url":"https://api.github.com/users/xiaoheiai4719","html_url":"https://github.com/xiaoheiai4719","followers_url":"https://api.github.com/users/xiaoheiai4719/followers","following_url":"https://api.github.com/users/xiaoheiai4719/following{/other_user}","gists_url":"https://api.github.com/users/xiaoheiai4719/gists{/gist_id}","starred_url":"https://api.github.com/users/xiaoheiai4719/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiaoheiai4719/subscriptions","organizations_url":"https://api.github.com/users/xiaoheiai4719/orgs","repos_url":"https://api.github.com/users/xiaoheiai4719/repos","events_url":"https://api.github.com/users/xiaoheiai4719/events{/privacy}","received_events_url":"https://api.github.com/users/xiaoheiai4719/received_events","type":"User","site_admin":false},"repo":{"id":73341257,"name":"gold-miner","full_name":"xiaoheiai4719/gold-miner","owner":{"login":"xiaoheiai4719","id":5488138,"avatar_url":"https://avatars.githubusercontent.com/u/5488138?v=3","gravatar_id":"","url":"https://api.github.com/users/xiaoheiai4719","html_url":"https://github.com/xiaoheiai4719","followers_url":"https://api.github.com/users/xiaoheiai4719/followers","following_url":"https://api.github.com/users/xiaoheiai4719/following{/other_user}","gists_url":"https://api.github.com/users/xiaoheiai4719/gists{/gist_id}","starred_url":"https://api.github.com/users/xiaoheiai4719/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiaoheiai4719/subscriptions","organizations_url":"https://api.github.com/users/xiaoheiai4719/orgs","repos_url":"https://api.github.com/users/xiaoheiai4719/repos","events_url":"https://api.github.com/users/xiaoheiai4719/events{/privacy}","received_events_url":"https://api.github.com/users/xiaoheiai4719/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/xiaoheiai4719/gold-miner","description":"掘金翻译计划，翻译掘金上优质的英文文章","fork":true,"url":"https://api.github.com/repos/xiaoheiai4719/gold-miner","forks_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/forks","keys_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/teams","hooks_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/hooks","issue_events_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/issues/events{/number}","events_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/events","assignees_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/assignees{/user}","branches_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/branches{/branch}","tags_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/tags","blobs_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/git/refs{/sha}","trees_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/statuses/{sha}","languages_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/languages","stargazers_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/stargazers","contributors_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/contributors","subscribers_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/subscribers","subscription_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/subscription","commits_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/commits{/sha}","git_commits_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/git/commits{/sha}","comments_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/comments{/number}","issue_comment_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/issues/comments{/number}","contents_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/contents/{+path}","compare_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/merges","archive_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/downloads","issues_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/issues{/number}","pulls_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/pulls{/number}","milestones_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/milestones{/number}","notifications_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/labels{/name}","releases_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/releases{/id}","deployments_url":"https://api.github.com/repos/xiaoheiai4719/gold-miner/deployments","created_at":"2016-11-10T02:48:31Z","updated_at":"2016-11-10T02:45:36Z","pushed_at":"2016-11-15T03:07:14Z","git_url":"git://github.com/xiaoheiai4719/gold-miner.git","ssh_url":"git@github.com:xiaoheiai4719/gold-miner.git","clone_url":"https://github.com/xiaoheiai4719/gold-miner.git","svn_url":"https://github.com/xiaoheiai4719/gold-miner","homepage":"http://gold.xitu.io","size":16803,"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":"483ec8729bad0a180e4b2b3e0a06640caa192c90","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-11-15T10:17:47Z","pushed_at":"2016-11-15T09:56:17Z","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":17680,"stargazers_count":4982,"watchers_count":4982,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":924,"mirror_url":null,"open_issues_count":31,"forks":924,"open_issues":31,"watchers":4982,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/952"},"html":{"href":"https://github.com/xitu/gold-miner/pull/952"},"issue":{"href":"https://api.github.com/repos/xitu/gold-miner/issues/952"},"comments":{"href":"https://api.github.com/repos/xitu/gold-miner/issues/952/comments"},"review_comments":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/952/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/952/commits"},"statuses":{"href":"https://api.github.com/repos/xitu/gold-miner/statuses/fc357c6c452f5c4f06910debaf6b1f03d0646cd1"}}}}
{"actor":{"display_login":"Romeo0906"}}