{ "id": "165245", "key": "TIMOB-24291", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "19381", "name": "Hyperloop 2.1.1", "archived": false, "released": true, "releaseDate": "2017-06-02" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-05-03T20:02:21.000+0000", "created": "2017-01-10T18:44:36.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2018-08-06T17:49:35.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "13715", "name": "Hyperloop", "description": "Hyperloop project" }, { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "I'm trying to define a custom hyperloop class to use as a callback delegate for CoreBluetooth on iOS.\r\n\r\nHowever, I'm not able to specify the argument type properly for {{NSDictionary}}\r\n\r\nI'm trying to define my delegate class to match https://developer.apple.com/reference/corebluetooth/cbcentralmanagerdelegate/1518937-centralmanager?language=objc\r\n\r\n\r\n{code:javascript}\r\nvar Delegate = Hyperloop.defineClass('CentralManagerDelegate', 'NSObject',[\"CBCentralManagerDelegate\"]);\r\n\r\nDelegate.addMethod({\r\n selector: \"centralManager:didDiscoverPeripheral:advertisementData:RSSI:\", \r\n arguments: [\"CBCentralManager\",\"CBPeripheral\",\"NSDictionary\",\"NSNumber\"],\r\n callback: function(central, peripheral, advertisementData, rssi) {\r\n if(this.didDiscoverPeripheral) {\r\n this.didDiscoverPeripheral(central, peripheral, advertisementData, rssi);\r\n }\r\n }\r\n});\r\n{code}\r\n\r\nBut the {{NSDictionary}} string in the {{arguments}} array is generating a compile-time error:\r\n\r\n{code}\r\nunknown encoding [CBCentralManager][CBPeripheral][NSDictionary][NSNumber] start at index 32\r\n{code}\r\n\r\nIf I change it to just {{NSDictionary}} it compiles, but then I don't have the correct data type inside my callback / delegate function", "attachment": [], "flagged": false, "summary": "Hyperloop: iOS - Unable to specify Hyperloop argument type for NSDictionary", "creator": { "name": "ksouthworth", "key": "ksouthworth", "displayName": "Kevin Southworth", "active": true, "timeZone": "America/Detroit" }, "subtasks": [], "reporter": { "name": "ksouthworth", "key": "ksouthworth", "displayName": "Kevin Southworth", "active": true, "timeZone": "America/Detroit" }, "environment": "Mac OSX 10.11.6\r\nTitanium SDK 6.0.1.GA\r\nAlloy 1.9.5\r\nHyperloop 2.0.0\r\nAppcelerator Studio 4.8.1.201612050850\r\niOS SDK 10.2\r\nXcode 8.2.1", "closedSprints": [ { "id": 883, "state": "closed", "name": "2017 Sprint 09 SDK", "startDate": "2017-04-23T21:46:54.309Z", "endDate": "2017-05-07T21:46:00.000Z", "completeDate": "2017-05-08T00:25:44.276Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "404387", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hey [~ksouthworth], interesting issue! I agree we should support type specifications (not only in NSDictionary but also in other types like NSArray). Moving to TIMOB to be investigated!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-01-10T19:50:13.000+0000", "updated": "2017-01-10T19:50:13.000+0000" }, { "id": "416481", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~ksouthworth], omitting the generic part for the argument in your method definition shouldn't have an impact on the data you receive because the encoding stays the same. What exactly do you receive inside your callback and what's different than expected? I do not have a BLE device for testing at my disposal so i created a minimal [example Gist|https://gist.github.com/janvennemann/22c756b929dcaee3fefb716700de546e] and i can access the content of the NSDictionary just fine.\r\n\r\nHowever, i totally agree that you should be able to specify the parameter as {{NSDictionary}} without Hyperloop throwing the unknown encoding error.", "updateAuthor": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-03-31T14:24:52.000+0000", "updated": "2017-03-31T14:24:52.000+0000" }, { "id": "419010", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR (master): https://github.com/appcelerator/hyperloop.next/pull/166\r\nPR (2_1_X): https://github.com/appcelerator/hyperloop.next/pull/167\r\n\r\n[~hansknoechel], tested it with Gist from my previous comment. The reporter being unable to properly access the data from the NSDictionary argument was probably related to TIMOB-24383.", "updateAuthor": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-05-03T12:19:12.000+0000", "updated": "2017-05-03T12:21:18.000+0000" }, { "id": "440231", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-06T17:49:35.000+0000", "updated": "2018-08-06T17:49:35.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }