{"action":"closed","number":76,"pull_request":{"url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/pulls/76","id":233283796,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzMjgzNzk2","html_url":"https://github.com/Automattic/Automattic-Tracks-iOS/pull/76","diff_url":"https://github.com/Automattic/Automattic-Tracks-iOS/pull/76.diff","patch_url":"https://github.com/Automattic/Automattic-Tracks-iOS/pull/76.patch","issue_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/issues/76","number":76,"state":"closed","locked":false,"title":"Add support for apple watch detection","user":{"login":"jkmassel","id":1123407,"node_id":"MDQ6VXNlcjExMjM0MDc=","avatar_url":"https://avatars3.githubusercontent.com/u/1123407?v=4","gravatar_id":"","url":"https://api.github.com/users/jkmassel","html_url":"https://github.com/jkmassel","followers_url":"https://api.github.com/users/jkmassel/followers","following_url":"https://api.github.com/users/jkmassel/following{/other_user}","gists_url":"https://api.github.com/users/jkmassel/gists{/gist_id}","starred_url":"https://api.github.com/users/jkmassel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkmassel/subscriptions","organizations_url":"https://api.github.com/users/jkmassel/orgs","repos_url":"https://api.github.com/users/jkmassel/repos","events_url":"https://api.github.com/users/jkmassel/events{/privacy}","received_events_url":"https://api.github.com/users/jkmassel/received_events","type":"User","site_admin":false},"body":"Adds initial support for Apple Watch detection for Tracks events (which resolves https://github.com/Automattic/Automattic-Tracks-iOS/issues/63)\r\n\r\nOne gotcha – there's an initial delay while creating a watch connectivity session – because the process is asynchronous, it can be tricky to pull out the right information at any given moment.\r\n\r\nOne solution is to maintain a record of whether we've _ever_ had a watch connection on this device. Another bonus – having this record makes it so that we don't have to constantly spool up a watch connectivity session – it seems doing this actually does make contact with the watch (to determine whether an associated app is installed on the watch), which is bad for both device's batteries.\r\n\r\nIt'd be possible to have the result cached for a shorter period of time (rather than the \"forever\" timeframe it is right now) easily enough.\r\n\r\nConsider this a starting point?\r\n\r\n**To Test**\r\nThere's no way to test this in the simulator – this particular API seems to only work on-device. Additionally, it's not possible to run unit tests on-device, so I've whipped up a quick testing target in https://github.com/Automattic/Automattic-Tracks-iOS/tree/add/on-device-testing-target that you can run on-device. All it does is display `DeviceInformation` keys that can't be Unit Tested.","created_at":"2018-11-23T21:59:32Z","updated_at":"2019-01-03T19:51:53Z","closed_at":"2019-01-03T19:51:53Z","merged_at":"2019-01-03T19:51:53Z","merge_commit_sha":"8296e08196fe1f63c0a11101230ee051497d5d36","assignee":{"login":"jkmassel","id":1123407,"node_id":"MDQ6VXNlcjExMjM0MDc=","avatar_url":"https://avatars3.githubusercontent.com/u/1123407?v=4","gravatar_id":"","url":"https://api.github.com/users/jkmassel","html_url":"https://github.com/jkmassel","followers_url":"https://api.github.com/users/jkmassel/followers","following_url":"https://api.github.com/users/jkmassel/following{/other_user}","gists_url":"https://api.github.com/users/jkmassel/gists{/gist_id}","starred_url":"https://api.github.com/users/jkmassel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkmassel/subscriptions","organizations_url":"https://api.github.com/users/jkmassel/orgs","repos_url":"https://api.github.com/users/jkmassel/repos","events_url":"https://api.github.com/users/jkmassel/events{/privacy}","received_events_url":"https://api.github.com/users/jkmassel/received_events","type":"User","site_admin":false},"assignees":[{"login":"jkmassel","id":1123407,"node_id":"MDQ6VXNlcjExMjM0MDc=","avatar_url":"https://avatars3.githubusercontent.com/u/1123407?v=4","gravatar_id":"","url":"https://api.github.com/users/jkmassel","html_url":"https://github.com/jkmassel","followers_url":"https://api.github.com/users/jkmassel/followers","following_url":"https://api.github.com/users/jkmassel/following{/other_user}","gists_url":"https://api.github.com/users/jkmassel/gists{/gist_id}","starred_url":"https://api.github.com/users/jkmassel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkmassel/subscriptions","organizations_url":"https://api.github.com/users/jkmassel/orgs","repos_url":"https://api.github.com/users/jkmassel/repos","events_url":"https://api.github.com/users/jkmassel/events{/privacy}","received_events_url":"https://api.github.com/users/jkmassel/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":185289099,"node_id":"MDU6TGFiZWwxODUyODkwOTk=","url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"milestone":null,"commits_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/pulls/76/commits","review_comments_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/pulls/76/comments","review_comment_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/issues/76/comments","statuses_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/statuses/54436c6121e27636598f5b2a81a0a0f17bbbdfcc","head":{"label":"Automattic:add/support-for-apple-watch-detection","ref":"add/support-for-apple-watch-detection","sha":"54436c6121e27636598f5b2a81a0a0f17bbbdfcc","user":{"login":"Automattic","id":887802,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg4NzgwMg==","avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":31957353,"node_id":"MDEwOlJlcG9zaXRvcnkzMTk1NzM1Mw==","name":"Automattic-Tracks-iOS","full_name":"Automattic/Automattic-Tracks-iOS","private":false,"owner":{"login":"Automattic","id":887802,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg4NzgwMg==","avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Automattic/Automattic-Tracks-iOS","description":"Client library for tracking user events for later analysis","fork":false,"url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS","forks_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/forks","keys_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/teams","hooks_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/hooks","issue_events_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/events","assignees_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/tags","blobs_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/languages","stargazers_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/stargazers","contributors_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/contributors","subscribers_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/subscribers","subscription_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/subscription","commits_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/merges","archive_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/downloads","issues_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/deployments","created_at":"2015-03-10T12:55:33Z","updated_at":"2019-01-03T18:29:28Z","pushed_at":"2019-01-03T19:51:53Z","git_url":"git://github.com/Automattic/Automattic-Tracks-iOS.git","ssh_url":"git@github.com:Automattic/Automattic-Tracks-iOS.git","clone_url":"https://github.com/Automattic/Automattic-Tracks-iOS.git","svn_url":"https://github.com/Automattic/Automattic-Tracks-iOS","homepage":"","size":348,"stargazers_count":12,"watchers_count":12,"language":"Objective-C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":7,"open_issues":5,"watchers":12,"default_branch":"develop"}},"base":{"label":"Automattic:develop","ref":"develop","sha":"e7c87af13b6ca3c0a4594df64a1b4d8b32bb5da3","user":{"login":"Automattic","id":887802,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg4NzgwMg==","avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":31957353,"node_id":"MDEwOlJlcG9zaXRvcnkzMTk1NzM1Mw==","name":"Automattic-Tracks-iOS","full_name":"Automattic/Automattic-Tracks-iOS","private":false,"owner":{"login":"Automattic","id":887802,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg4NzgwMg==","avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Automattic/Automattic-Tracks-iOS","description":"Client library for tracking user events for later analysis","fork":false,"url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS","forks_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/forks","keys_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/teams","hooks_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/hooks","issue_events_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/events","assignees_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/tags","blobs_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/languages","stargazers_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/stargazers","contributors_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/contributors","subscribers_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/subscribers","subscription_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/subscription","commits_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/merges","archive_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/downloads","issues_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/deployments","created_at":"2015-03-10T12:55:33Z","updated_at":"2019-01-03T18:29:28Z","pushed_at":"2019-01-03T19:51:53Z","git_url":"git://github.com/Automattic/Automattic-Tracks-iOS.git","ssh_url":"git@github.com:Automattic/Automattic-Tracks-iOS.git","clone_url":"https://github.com/Automattic/Automattic-Tracks-iOS.git","svn_url":"https://github.com/Automattic/Automattic-Tracks-iOS","homepage":"","size":348,"stargazers_count":12,"watchers_count":12,"language":"Objective-C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":7,"open_issues":5,"watchers":12,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/pulls/76"},"html":{"href":"https://github.com/Automattic/Automattic-Tracks-iOS/pull/76"},"issue":{"href":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/issues/76"},"comments":{"href":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/issues/76/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/pulls/76/comments"},"review_comment":{"href":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/pulls/76/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/Automattic-Tracks-iOS/statuses/54436c6121e27636598f5b2a81a0a0f17bbbdfcc"}},"author_association":"CONTRIBUTOR","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"jkmassel","id":1123407,"node_id":"MDQ6VXNlcjExMjM0MDc=","avatar_url":"https://avatars3.githubusercontent.com/u/1123407?v=4","gravatar_id":"","url":"https://api.github.com/users/jkmassel","html_url":"https://github.com/jkmassel","followers_url":"https://api.github.com/users/jkmassel/followers","following_url":"https://api.github.com/users/jkmassel/following{/other_user}","gists_url":"https://api.github.com/users/jkmassel/gists{/gist_id}","starred_url":"https://api.github.com/users/jkmassel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkmassel/subscriptions","organizations_url":"https://api.github.com/users/jkmassel/orgs","repos_url":"https://api.github.com/users/jkmassel/repos","events_url":"https://api.github.com/users/jkmassel/events{/privacy}","received_events_url":"https://api.github.com/users/jkmassel/received_events","type":"User","site_admin":false},"comments":4,"review_comments":0,"maintainer_can_modify":false,"commits":5,"additions":93,"deletions":1,"changed_files":6}}
{"actor":{"display_login":"jkmassel"}}