{"action":"created","issue":{"url":"https://api.github.com/repos/NathanaelA/nativescript-permissions/issues/15","repository_url":"https://api.github.com/repos/NathanaelA/nativescript-permissions","labels_url":"https://api.github.com/repos/NathanaelA/nativescript-permissions/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/NathanaelA/nativescript-permissions/issues/15/comments","events_url":"https://api.github.com/repos/NathanaelA/nativescript-permissions/issues/15/events","html_url":"https://github.com/NathanaelA/nativescript-permissions/issues/15","id":174064322,"number":15,"title":"Does this work with Angular?","user":{"login":"chief10","id":2761499,"avatar_url":"https://avatars.githubusercontent.com/u/2761499?v=3","gravatar_id":"","url":"https://api.github.com/users/chief10","html_url":"https://github.com/chief10","followers_url":"https://api.github.com/users/chief10/followers","following_url":"https://api.github.com/users/chief10/following{/other_user}","gists_url":"https://api.github.com/users/chief10/gists{/gist_id}","starred_url":"https://api.github.com/users/chief10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chief10/subscriptions","organizations_url":"https://api.github.com/users/chief10/orgs","repos_url":"https://api.github.com/users/chief10/repos","events_url":"https://api.github.com/users/chief10/events{/privacy}","received_events_url":"https://api.github.com/users/chief10/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-30T16:24:49Z","updated_at":"2016-08-30T16:49:01Z","closed_at":null,"body":"I have started a new project using the `tns` for an angular project, and I have copied your example code almost verbatim, but when I go to request the permission, it automatically fails without prompting the user at all. Here goes the code:\r\n\r\nIn `app.component.ts`:\r\n```\r\nimport {Component, OnInit} from \"@angular/core\";\r\nvar permissions = require('nativescript-permissions');\r\n\r\ndeclare var android: any;\r\n\r\n@Component({\r\n    selector: \"my-app\",\r\n    templateUrl: \"app.component.html\",\r\n})\r\nexport class AppComponent implements OnInit {\r\n    ngOnInit() {\r\n    }\r\n\r\n    public counter: number = 16;\r\n\r\n    public get message(): string {\r\n        if (this.counter > 0) {\r\n            return this.counter + \" taps left\";\r\n        } else {\r\n            return \"Hoorraaay! \\nYou are ready to start building!\";\r\n        }\r\n    }\r\n\r\n    public onTap() {\r\n        this.counter--;\r\n        this.handleRequestForPermissions();\r\n    }\r\n\r\n    public handleRequestForPermissions() {\r\n        permissions.requestPermission(android.Manifest.permission.READ_CONTACTS, \"I need these permissions because I'm cool\")\r\n            .then(function () {\r\n                console.log(\"Woo Hoo, I have the power!\");\r\n            })\r\n            .catch(function (e) {\r\n                console.log(\"Uh oh, no permissions - plan B time!\",JSON.stringify(e) );\r\n            });\r\n    }\r\n}\r\n```\r\n\r\nAnd in my android manifest file:\r\n```\r\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n\tpackage=\"__PACKAGE__\"\r\n\tandroid:versionCode=\"1\"\r\n\tandroid:versionName=\"1.0\">\r\n\r\n\t<supports-screens\r\n\t\tandroid:smallScreens=\"true\"\r\n\t\tandroid:normalScreens=\"true\"\r\n\t\tandroid:largeScreens=\"true\"\r\n\t\tandroid:xlargeScreens=\"true\"/>\r\n\r\n\t<uses-sdk\r\n\t\tandroid:minSdkVersion=\"17\"\r\n\t\tandroid:targetSdkVersion=\"23\"/>\r\n\r\n\t<uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/>\r\n\t<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>\r\n\t<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>\r\n\t<uses-permission android:name=\"android.permission.INTERNET\"/>\r\n\r\n\t<application\r\n\t\tandroid:name=\"com.tns.NativeScriptApplication\"\r\n\t\tandroid:allowBackup=\"true\"\r\n\t\tandroid:icon=\"@drawable/icon\"\r\n\t\tandroid:label=\"@string/app_name\"\r\n\t\tandroid:theme=\"@style/AppTheme\">\r\n\r\n\t\t<activity\r\n\t\t\tandroid:name=\"com.tns.NativeScriptActivity\"\r\n\t\t\tandroid:label=\"@string/title_activity_kimera\"\r\n\t\t\tandroid:configChanges=\"keyboardHidden|orientation|screenSize\"\r\n\t\t\tandroid:theme=\"@style/LaunchScreenTheme\">\r\n\r\n\t\t\t<meta-data android:name=\"SET_THEME_ON_LAUNCH\" android:resource=\"@style/AppTheme\" />\r\n\r\n\t\t\t<intent-filter>\r\n\t\t\t\t<action android:name=\"android.intent.action.MAIN\" />\r\n\t\t\t\t<category android:name=\"android.intent.category.LAUNCHER\" />\r\n\t\t\t</intent-filter>\r\n\t\t</activity>\r\n\t\t<activity android:name=\"com.tns.ErrorReportActivity\"/>\r\n\t</application>\r\n</manifest>\r\n```\r\n\r\nThe error message:\r\n```\r\nJS: Uh oh, no permissions - plan B time! {\"android.permission.READ_CONTACTS\":false}\r\n```\r\n\r\nAm I missing something obvious here?"},"comment":{"url":"https://api.github.com/repos/NathanaelA/nativescript-permissions/issues/comments/243503833","html_url":"https://github.com/NathanaelA/nativescript-permissions/issues/15#issuecomment-243503833","issue_url":"https://api.github.com/repos/NathanaelA/nativescript-permissions/issues/15","id":243503833,"user":{"login":"NathanaelA","id":850871,"avatar_url":"https://avatars.githubusercontent.com/u/850871?v=3","gravatar_id":"","url":"https://api.github.com/users/NathanaelA","html_url":"https://github.com/NathanaelA","followers_url":"https://api.github.com/users/NathanaelA/followers","following_url":"https://api.github.com/users/NathanaelA/following{/other_user}","gists_url":"https://api.github.com/users/NathanaelA/gists{/gist_id}","starred_url":"https://api.github.com/users/NathanaelA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NathanaelA/subscriptions","organizations_url":"https://api.github.com/users/NathanaelA/orgs","repos_url":"https://api.github.com/users/NathanaelA/repos","events_url":"https://api.github.com/users/NathanaelA/events{/privacy}","received_events_url":"https://api.github.com/users/NathanaelA/received_events","type":"User","site_admin":false},"created_at":"2016-08-30T16:49:01Z","updated_at":"2016-08-30T16:49:01Z","body":"Hmm, that is weird -- ng2 should not cause any issues with the permissions system.   Is this Android 4.4, 5, 6, or 7?\r\n"}}
{"actor":{"display_login":"NathanaelA"}}