{"action":"created","comment":{"url":"https://api.github.com/repos/aidoraide/ASAP-Sports/pulls/comments/236518160","pull_request_review_id":178608286,"id":236518160,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNjUxODE2MA==","diff_hunk":"@@ -3,9 +3,55 @@ import { StyleSheet, Text, View, Button, Image, ScrollView, AsyncStorage, FlatLi\n import AwesomeButton from 'react-native-really-awesome-button';\n import { APP_BASE_URL, COLORS, ASAPStyles } from '../const';\n import GameCard from '../assets/components/GameCard';\n+import { Permissions, Notifications } from 'expo';\n \n // NOTIDEAL: Mixing different types in the list is ugly AF.\n \n+const PUSH_ENDPOINT = 'http://d8becf45.ngrok.io/users/push-token';\n+\n+\n+async function registerForPushNotificationsAsync() {\n+  const { status: existingStatus } = await Permissions.getAsync(\n+    Permissions.NOTIFICATIONS\n+  );\n+  const authUser = JSON.parse(await AsyncStorage.getItem('authUser'));\n+  let finalStatus = existingStatus;\n+\n+  // only ask if permissions have not already been determined, because\n+  // iOS won't necessarily prompt the user a second time.\n+  if (existingStatus !== 'granted') {\n+    // Android remote notification permissions are granted during the app\n+    // install, so this will only ask on iOS\n+    const { status } = await Permissions.askAsync(Permissions.NOTIFICATIONS);\n+    finalStatus = status;\n+  }\n+\n+  // Stop here if the user did not grant permissions\n+  if (finalStatus !== 'granted') {\n+    return;\n+  }\n+\n+  // Get the token that uniquely identifies this device\n+  let token = await Notifications.getExpoPushTokenAsync();\n+\n+  console.log(token);\n+\n+  // POST the token to your backend server from where you can retrieve it to send push notifications.\n+  return fetch(PUSH_ENDPOINT, {\n+    method: 'POST',\n+    headers: {\n+      Accept: 'application/json',\n+      'Content-Type': 'application/json',\n+      'Authorization': authUser.asap_access_token,\n+    },\n+    body: JSON.stringify({","path":"ASAP-Sports/screens/Homescreen.js","position":45,"original_position":45,"commit_id":"e07d5d9513b806621a756e3aa147f8cc8dc7233d","original_commit_id":"e07d5d9513b806621a756e3aa147f8cc8dc7233d","user":{"login":"harpaulgill","id":19321372,"node_id":"MDQ6VXNlcjE5MzIxMzcy","avatar_url":"https://avatars0.githubusercontent.com/u/19321372?v=4","gravatar_id":"","url":"https://api.github.com/users/harpaulgill","html_url":"https://github.com/harpaulgill","followers_url":"https://api.github.com/users/harpaulgill/followers","following_url":"https://api.github.com/users/harpaulgill/following{/other_user}","gists_url":"https://api.github.com/users/harpaulgill/gists{/gist_id}","starred_url":"https://api.github.com/users/harpaulgill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harpaulgill/subscriptions","organizations_url":"https://api.github.com/users/harpaulgill/orgs","repos_url":"https://api.github.com/users/harpaulgill/repos","events_url":"https://api.github.com/users/harpaulgill/events{/privacy}","received_events_url":"https://api.github.com/users/harpaulgill/received_events","type":"User","site_admin":false},"body":"yea i was just copying their example pretty unnecessary tho imo","created_at":"2018-11-27T04:41:26Z","updated_at":"2018-11-27T04:41:26Z","html_url":"https://github.com/aidoraide/ASAP-Sports/pull/30#discussion_r236518160","pull_request_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/pulls/30","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/aidoraide/ASAP-Sports/pulls/comments/236518160"},"html":{"href":"https://github.com/aidoraide/ASAP-Sports/pull/30#discussion_r236518160"},"pull_request":{"href":"https://api.github.com/repos/aidoraide/ASAP-Sports/pulls/30"}},"in_reply_to_id":236516386},"pull_request":{"url":"https://api.github.com/repos/aidoraide/ASAP-Sports/pulls/30","id":233349591,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzMzQ5NTkx","html_url":"https://github.com/aidoraide/ASAP-Sports/pull/30","diff_url":"https://github.com/aidoraide/ASAP-Sports/pull/30.diff","patch_url":"https://github.com/aidoraide/ASAP-Sports/pull/30.patch","issue_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/issues/30","number":30,"state":"open","locked":false,"title":"Push notifications","user":{"login":"aidoraide","id":19987838,"node_id":"MDQ6VXNlcjE5OTg3ODM4","avatar_url":"https://avatars1.githubusercontent.com/u/19987838?v=4","gravatar_id":"","url":"https://api.github.com/users/aidoraide","html_url":"https://github.com/aidoraide","followers_url":"https://api.github.com/users/aidoraide/followers","following_url":"https://api.github.com/users/aidoraide/following{/other_user}","gists_url":"https://api.github.com/users/aidoraide/gists{/gist_id}","starred_url":"https://api.github.com/users/aidoraide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aidoraide/subscriptions","organizations_url":"https://api.github.com/users/aidoraide/orgs","repos_url":"https://api.github.com/users/aidoraide/repos","events_url":"https://api.github.com/users/aidoraide/events{/privacy}","received_events_url":"https://api.github.com/users/aidoraide/received_events","type":"User","site_admin":false},"body":"Just so I can see the diff here. Not ready for merge yet","created_at":"2018-11-25T01:16:01Z","updated_at":"2018-11-27T04:41:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8f865874f3194e0cf80841870387b682a43af95a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/pulls/30/commits","review_comments_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/pulls/30/comments","review_comment_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/issues/30/comments","statuses_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/statuses/e07d5d9513b806621a756e3aa147f8cc8dc7233d","head":{"label":"aidoraide:push_notifications","ref":"push_notifications","sha":"e07d5d9513b806621a756e3aa147f8cc8dc7233d","user":{"login":"aidoraide","id":19987838,"node_id":"MDQ6VXNlcjE5OTg3ODM4","avatar_url":"https://avatars1.githubusercontent.com/u/19987838?v=4","gravatar_id":"","url":"https://api.github.com/users/aidoraide","html_url":"https://github.com/aidoraide","followers_url":"https://api.github.com/users/aidoraide/followers","following_url":"https://api.github.com/users/aidoraide/following{/other_user}","gists_url":"https://api.github.com/users/aidoraide/gists{/gist_id}","starred_url":"https://api.github.com/users/aidoraide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aidoraide/subscriptions","organizations_url":"https://api.github.com/users/aidoraide/orgs","repos_url":"https://api.github.com/users/aidoraide/repos","events_url":"https://api.github.com/users/aidoraide/events{/privacy}","received_events_url":"https://api.github.com/users/aidoraide/received_events","type":"User","site_admin":false},"repo":{"id":149534224,"node_id":"MDEwOlJlcG9zaXRvcnkxNDk1MzQyMjQ=","name":"ASAP-Sports","full_name":"aidoraide/ASAP-Sports","private":false,"owner":{"login":"aidoraide","id":19987838,"node_id":"MDQ6VXNlcjE5OTg3ODM4","avatar_url":"https://avatars1.githubusercontent.com/u/19987838?v=4","gravatar_id":"","url":"https://api.github.com/users/aidoraide","html_url":"https://github.com/aidoraide","followers_url":"https://api.github.com/users/aidoraide/followers","following_url":"https://api.github.com/users/aidoraide/following{/other_user}","gists_url":"https://api.github.com/users/aidoraide/gists{/gist_id}","starred_url":"https://api.github.com/users/aidoraide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aidoraide/subscriptions","organizations_url":"https://api.github.com/users/aidoraide/orgs","repos_url":"https://api.github.com/users/aidoraide/repos","events_url":"https://api.github.com/users/aidoraide/events{/privacy}","received_events_url":"https://api.github.com/users/aidoraide/received_events","type":"User","site_admin":false},"html_url":"https://github.com/aidoraide/ASAP-Sports","description":"Mobile application that allows you to find and join other athletes in your area in casual/competitive sports.","fork":false,"url":"https://api.github.com/repos/aidoraide/ASAP-Sports","forks_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/forks","keys_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/teams","hooks_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/hooks","issue_events_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/issues/events{/number}","events_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/events","assignees_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/assignees{/user}","branches_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/branches{/branch}","tags_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/tags","blobs_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/git/refs{/sha}","trees_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/statuses/{sha}","languages_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/languages","stargazers_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/stargazers","contributors_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/contributors","subscribers_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/subscribers","subscription_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/subscription","commits_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/commits{/sha}","git_commits_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/git/commits{/sha}","comments_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/comments{/number}","issue_comment_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/issues/comments{/number}","contents_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/contents/{+path}","compare_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/merges","archive_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/downloads","issues_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/issues{/number}","pulls_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/pulls{/number}","milestones_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/milestones{/number}","notifications_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/labels{/name}","releases_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/releases{/id}","deployments_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/deployments","created_at":"2018-09-20T01:35:00Z","updated_at":"2018-11-26T03:21:51Z","pushed_at":"2018-11-27T02:22:32Z","git_url":"git://github.com/aidoraide/ASAP-Sports.git","ssh_url":"git@github.com:aidoraide/ASAP-Sports.git","clone_url":"https://github.com/aidoraide/ASAP-Sports.git","svn_url":"https://github.com/aidoraide/ASAP-Sports","homepage":null,"size":2744,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"aidoraide:master","ref":"master","sha":"4f2217cd1fecf324f609a2c65653ccbb1ce6e245","user":{"login":"aidoraide","id":19987838,"node_id":"MDQ6VXNlcjE5OTg3ODM4","avatar_url":"https://avatars1.githubusercontent.com/u/19987838?v=4","gravatar_id":"","url":"https://api.github.com/users/aidoraide","html_url":"https://github.com/aidoraide","followers_url":"https://api.github.com/users/aidoraide/followers","following_url":"https://api.github.com/users/aidoraide/following{/other_user}","gists_url":"https://api.github.com/users/aidoraide/gists{/gist_id}","starred_url":"https://api.github.com/users/aidoraide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aidoraide/subscriptions","organizations_url":"https://api.github.com/users/aidoraide/orgs","repos_url":"https://api.github.com/users/aidoraide/repos","events_url":"https://api.github.com/users/aidoraide/events{/privacy}","received_events_url":"https://api.github.com/users/aidoraide/received_events","type":"User","site_admin":false},"repo":{"id":149534224,"node_id":"MDEwOlJlcG9zaXRvcnkxNDk1MzQyMjQ=","name":"ASAP-Sports","full_name":"aidoraide/ASAP-Sports","private":false,"owner":{"login":"aidoraide","id":19987838,"node_id":"MDQ6VXNlcjE5OTg3ODM4","avatar_url":"https://avatars1.githubusercontent.com/u/19987838?v=4","gravatar_id":"","url":"https://api.github.com/users/aidoraide","html_url":"https://github.com/aidoraide","followers_url":"https://api.github.com/users/aidoraide/followers","following_url":"https://api.github.com/users/aidoraide/following{/other_user}","gists_url":"https://api.github.com/users/aidoraide/gists{/gist_id}","starred_url":"https://api.github.com/users/aidoraide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aidoraide/subscriptions","organizations_url":"https://api.github.com/users/aidoraide/orgs","repos_url":"https://api.github.com/users/aidoraide/repos","events_url":"https://api.github.com/users/aidoraide/events{/privacy}","received_events_url":"https://api.github.com/users/aidoraide/received_events","type":"User","site_admin":false},"html_url":"https://github.com/aidoraide/ASAP-Sports","description":"Mobile application that allows you to find and join other athletes in your area in casual/competitive sports.","fork":false,"url":"https://api.github.com/repos/aidoraide/ASAP-Sports","forks_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/forks","keys_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/teams","hooks_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/hooks","issue_events_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/issues/events{/number}","events_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/events","assignees_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/assignees{/user}","branches_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/branches{/branch}","tags_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/tags","blobs_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/git/refs{/sha}","trees_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/statuses/{sha}","languages_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/languages","stargazers_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/stargazers","contributors_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/contributors","subscribers_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/subscribers","subscription_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/subscription","commits_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/commits{/sha}","git_commits_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/git/commits{/sha}","comments_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/comments{/number}","issue_comment_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/issues/comments{/number}","contents_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/contents/{+path}","compare_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/merges","archive_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/downloads","issues_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/issues{/number}","pulls_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/pulls{/number}","milestones_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/milestones{/number}","notifications_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/labels{/name}","releases_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/releases{/id}","deployments_url":"https://api.github.com/repos/aidoraide/ASAP-Sports/deployments","created_at":"2018-09-20T01:35:00Z","updated_at":"2018-11-26T03:21:51Z","pushed_at":"2018-11-27T02:22:32Z","git_url":"git://github.com/aidoraide/ASAP-Sports.git","ssh_url":"git@github.com:aidoraide/ASAP-Sports.git","clone_url":"https://github.com/aidoraide/ASAP-Sports.git","svn_url":"https://github.com/aidoraide/ASAP-Sports","homepage":null,"size":2744,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aidoraide/ASAP-Sports/pulls/30"},"html":{"href":"https://github.com/aidoraide/ASAP-Sports/pull/30"},"issue":{"href":"https://api.github.com/repos/aidoraide/ASAP-Sports/issues/30"},"comments":{"href":"https://api.github.com/repos/aidoraide/ASAP-Sports/issues/30/comments"},"review_comments":{"href":"https://api.github.com/repos/aidoraide/ASAP-Sports/pulls/30/comments"},"review_comment":{"href":"https://api.github.com/repos/aidoraide/ASAP-Sports/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aidoraide/ASAP-Sports/pulls/30/commits"},"statuses":{"href":"https://api.github.com/repos/aidoraide/ASAP-Sports/statuses/e07d5d9513b806621a756e3aa147f8cc8dc7233d"}},"author_association":"OWNER"}}
{"actor":{"display_login":"harpaulgill"}}