{"action":"created","issue":{"url":"https://api.github.com/repos/ricvalerio/foregroundappchecker/issues/6","repository_url":"https://api.github.com/repos/ricvalerio/foregroundappchecker","labels_url":"https://api.github.com/repos/ricvalerio/foregroundappchecker/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/ricvalerio/foregroundappchecker/issues/6/comments","events_url":"https://api.github.com/repos/ricvalerio/foregroundappchecker/issues/6/events","html_url":"https://github.com/ricvalerio/foregroundappchecker/issues/6","id":231030213,"number":6,"title":"Always null package name","user":{"login":"arenaq","id":5146556,"avatar_url":"https://avatars3.githubusercontent.com/u/5146556?v=3","gravatar_id":"","url":"https://api.github.com/users/arenaq","html_url":"https://github.com/arenaq","followers_url":"https://api.github.com/users/arenaq/followers","following_url":"https://api.github.com/users/arenaq/following{/other_user}","gists_url":"https://api.github.com/users/arenaq/gists{/gist_id}","starred_url":"https://api.github.com/users/arenaq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arenaq/subscriptions","organizations_url":"https://api.github.com/users/arenaq/orgs","repos_url":"https://api.github.com/users/arenaq/repos","events_url":"https://api.github.com/users/arenaq/events{/privacy}","received_events_url":"https://api.github.com/users/arenaq/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-05-24T12:55:12Z","updated_at":"2017-05-25T17:25:51Z","closed_at":null,"body":"I am using this snippet of yours inside of a service, but I always get `null` as a package name. Testing on Google Pixel, Android version 7.1\r\n```\r\nAppChecker appChecker = new AppChecker();\r\nString packageName = appChecker.getForegroundApp(context);\r\n```\r\nMy permissions look like this:\r\n```\r\n<uses-permission android:name=\"android.permission.GET_TASKS\"/>\r\n    <uses-permission android:name=\"android.permission.PACKAGE_USAGE_STATS\" tools:ignore=\"ProtectedPermissions\"/>\r\n```"},"comment":{"url":"https://api.github.com/repos/ricvalerio/foregroundappchecker/issues/comments/304070138","html_url":"https://github.com/ricvalerio/foregroundappchecker/issues/6#issuecomment-304070138","issue_url":"https://api.github.com/repos/ricvalerio/foregroundappchecker/issues/6","id":304070138,"user":{"login":"ricvalerio","id":6675669,"avatar_url":"https://avatars3.githubusercontent.com/u/6675669?v=3","gravatar_id":"","url":"https://api.github.com/users/ricvalerio","html_url":"https://github.com/ricvalerio","followers_url":"https://api.github.com/users/ricvalerio/followers","following_url":"https://api.github.com/users/ricvalerio/following{/other_user}","gists_url":"https://api.github.com/users/ricvalerio/gists{/gist_id}","starred_url":"https://api.github.com/users/ricvalerio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ricvalerio/subscriptions","organizations_url":"https://api.github.com/users/ricvalerio/orgs","repos_url":"https://api.github.com/users/ricvalerio/repos","events_url":"https://api.github.com/users/ricvalerio/events{/privacy}","received_events_url":"https://api.github.com/users/ricvalerio/received_events","type":"User","site_admin":false},"created_at":"2017-05-25T17:25:51Z","updated_at":"2017-05-25T17:25:51Z","body":"That's odd. Let me take a look at it and I will come back to you. It might take a couple of days, sorry, a bit tight this week in time.\r\n\r\nCheers,\r\nRicardo"}}
{"actor":{"display_login":"ricvalerio"}}