{ "id": "171053", "key": "AC-5579", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "11", "description": "Is not a bug in our product", "name": "Not Our Bug" }, "resolutiondate": "2018-02-07T15:05:08.000+0000", "created": "2018-02-07T13:39:18.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2018-02-07T15:05:48.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "15000", "name": "Hyperloop" } ], "description": "While trying to get permissions from HealthKit, the HKHealthStore instance is not allowing me to call the requestAuthorizationToShareTypes function. Code below\r\n\r\n{code:java}\r\nvar HKHealthStore = require('HealthKit/HKHealthStore');\r\n\r\nvar HKObjectType = require('HealthKit/HKObjectType');\r\n\r\nvar HKCategoryTypeIdentifierSleepAnalysis = require(\"HealthKit\").HKCategoryTypeIdentifierSleepAnalysis;\r\n\r\nvar NSSet = require('Foundation/NSSet');\r\n\r\nexports.start = function() {\r\n if (HKHealthStore.isHealthDataAvailable()) {\r\n var healthStore = HKHealthStore.alloc().init();\r\n\r\n var shareTypes = NSSet.set();\r\n\r\n var readTypes = NSSet.setWithObject(HKObjectType.categoryTypeForIdentifier(HKCategoryTypeIdentifierSleepAnalysis));\r\n\r\n healthStore.requestAuthorizationToShareTypes(shareTypes, readTypes, function(success, error) {\r\n\r\n });\r\n }\r\n}\r\n\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "HKHealthStore requestAuthorizationToShareTypes is not a function", "creator": { "name": "yankovalera@gmail.com", "key": "yankovalera@gmail.com", "displayName": "Yanko Valera", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "yankovalera@gmail.com", "key": "yankovalera@gmail.com", "displayName": "Yanko Valera", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "SDK7.0.1, Hyperloop 3.0.2", "comment": { "comments": [ { "id": "434167", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hey there! Sorry, but this is not valid. Regarding the [docs|https://developer.apple.com/documentation/healthkit/hkhealthstore/1614152-requestauthorizationtosharetypes], the correct call is \r\n{code:js}\r\nvar healthStore = new HKHealthStore(); // Same as alloc().init();\r\nhealthStore.requestAuthorizationToShareTypesReadTypesCompletion(shareTypes, readTypes, function(success, error)) {\r\n // Handle result\r\n});\r\n{code}\r\nBasically, you just need to ensure that all arguments are concatenated and it will match it.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-02-07T15:05:08.000+0000", "updated": "2018-02-07T15:05:48.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }