{"action":"created","issue":{"url":"https://api.github.com/repos/robinpowered/react-native-screen-brightness/issues/21","repository_url":"https://api.github.com/repos/robinpowered/react-native-screen-brightness","labels_url":"https://api.github.com/repos/robinpowered/react-native-screen-brightness/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/robinpowered/react-native-screen-brightness/issues/21/comments","events_url":"https://api.github.com/repos/robinpowered/react-native-screen-brightness/issues/21/events","html_url":"https://github.com/robinpowered/react-native-screen-brightness/pull/21","id":252055546,"number":21,"title":"Bugfix - Return correct permission value for screen brightness","user":{"login":"yinghang","id":4490352,"avatar_url":"https://avatars2.githubusercontent.com/u/4490352?v=4","gravatar_id":"","url":"https://api.github.com/users/yinghang","html_url":"https://github.com/yinghang","followers_url":"https://api.github.com/users/yinghang/followers","following_url":"https://api.github.com/users/yinghang/following{/other_user}","gists_url":"https://api.github.com/users/yinghang/gists{/gist_id}","starred_url":"https://api.github.com/users/yinghang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yinghang/subscriptions","organizations_url":"https://api.github.com/users/yinghang/orgs","repos_url":"https://api.github.com/users/yinghang/repos","events_url":"https://api.github.com/users/yinghang/events{/privacy}","received_events_url":"https://api.github.com/users/yinghang/received_events","type":"User","site_admin":false},"labels":[{"id":296638366,"url":"https://api.github.com/repos/robinpowered/react-native-screen-brightness/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":{"login":"ajwhite","id":656630,"avatar_url":"https://avatars0.githubusercontent.com/u/656630?v=4","gravatar_id":"","url":"https://api.github.com/users/ajwhite","html_url":"https://github.com/ajwhite","followers_url":"https://api.github.com/users/ajwhite/followers","following_url":"https://api.github.com/users/ajwhite/following{/other_user}","gists_url":"https://api.github.com/users/ajwhite/gists{/gist_id}","starred_url":"https://api.github.com/users/ajwhite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajwhite/subscriptions","organizations_url":"https://api.github.com/users/ajwhite/orgs","repos_url":"https://api.github.com/users/ajwhite/repos","events_url":"https://api.github.com/users/ajwhite/events{/privacy}","received_events_url":"https://api.github.com/users/ajwhite/received_events","type":"User","site_admin":false},"assignees":[{"login":"ajwhite","id":656630,"avatar_url":"https://avatars0.githubusercontent.com/u/656630?v=4","gravatar_id":"","url":"https://api.github.com/users/ajwhite","html_url":"https://github.com/ajwhite","followers_url":"https://api.github.com/users/ajwhite/followers","following_url":"https://api.github.com/users/ajwhite/following{/other_user}","gists_url":"https://api.github.com/users/ajwhite/gists{/gist_id}","starred_url":"https://api.github.com/users/ajwhite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajwhite/subscriptions","organizations_url":"https://api.github.com/users/ajwhite/orgs","repos_url":"https://api.github.com/users/ajwhite/repos","events_url":"https://api.github.com/users/ajwhite/events{/privacy}","received_events_url":"https://api.github.com/users/ajwhite/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2017-08-22T18:55:37Z","updated_at":"2017-08-22T20:34:31Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/robinpowered/react-native-screen-brightness/pulls/21","html_url":"https://github.com/robinpowered/react-native-screen-brightness/pull/21","diff_url":"https://github.com/robinpowered/react-native-screen-brightness/pull/21.diff","patch_url":"https://github.com/robinpowered/react-native-screen-brightness/pull/21.patch"},"body":"Fixed to return correct permission value for screen brightness. Turns out `ContextCompat.checkSelfPermission()` was not returning the correct response code, ~~not too sure why and it's worth checking out in the future, but due to time constraints~~, will use `Settings.System.canWrite()` to check if permissions are granted for now.\r\n\r\nEDIT: Turns out `WRITE_SETTINGS` is a special case and the permission can only be queried using the new method. For SDK 22 and below, you get it automatically but that's not the case for newer versions. For info here: [https://stackoverflow.com/questions/32083410/cant-get-write-settings-permission](https://stackoverflow.com/questions/32083410/cant-get-write-settings-permission)"},"comment":{"url":"https://api.github.com/repos/robinpowered/react-native-screen-brightness/issues/comments/324143879","html_url":"https://github.com/robinpowered/react-native-screen-brightness/pull/21#issuecomment-324143879","issue_url":"https://api.github.com/repos/robinpowered/react-native-screen-brightness/issues/21","id":324143879,"user":{"login":"ajwhite","id":656630,"avatar_url":"https://avatars0.githubusercontent.com/u/656630?v=4","gravatar_id":"","url":"https://api.github.com/users/ajwhite","html_url":"https://github.com/ajwhite","followers_url":"https://api.github.com/users/ajwhite/followers","following_url":"https://api.github.com/users/ajwhite/following{/other_user}","gists_url":"https://api.github.com/users/ajwhite/gists{/gist_id}","starred_url":"https://api.github.com/users/ajwhite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajwhite/subscriptions","organizations_url":"https://api.github.com/users/ajwhite/orgs","repos_url":"https://api.github.com/users/ajwhite/repos","events_url":"https://api.github.com/users/ajwhite/events{/privacy}","received_events_url":"https://api.github.com/users/ajwhite/received_events","type":"User","site_admin":false},"created_at":"2017-08-22T20:34:31Z","updated_at":"2017-08-22T20:34:31Z","body":"Good catch, and ty for linking sources 👍 "}}
{"actor":{"display_login":"ajwhite"}}