{ "id": "169530", "key": "TIMOB-25164", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": "19907", "name": "Ti.iCloud 2.0.0", "archived": false, "released": true } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-08-15T15:22:39.000+0000", "created": "2017-08-12T11:57:06.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "icloud", "system-capabilities" ], "versions": [], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2018-08-02T21:50:17.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "One of my apps uses the Ti.ICloud module, which works great, if you have the SystemCapabilities properly configured. The Xcode project generated by Titanium doesn't have the proper capabilities turned on. So I have to `--build-only`, run some regular expressions to fix the SystemCapabilities, and then `fastlane gym` my project to build and upload it as a part of my CI process. Outside of CI, I'd have to build from Xcode directly, if I want iCloud to work right.\r\n\r\nIf I run my regular expressions, and then do another `appc ti build`, my changes to project.pbxproj are wiped out, so that doesn't work either.\r\n\r\nIs there any way to customize the capabilities in the generated project?\r\n\r\n{code}\r\nSystemCapabilities = {\r\n\tcom.apple.iCloud = {\r\n\t\tenabled = 1;\r\n\t};\r\n\tcom.apple.InAppPurchase = {\r\n\t\tenabled = 1;\r\n\t};\r\n};\r\n{code}", "attachment": [], "flagged": false, "summary": "Ti.iCloud: Inject iCloud SystemCapabilities via module-hook", "creator": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "environment": "Mac, Xcode 8.3.3, Ti SDK 6.1.1.GA", "comment": { "comments": [ { "id": "426584", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hey there! Can't you just use the entitlements-keys ?\r\n{code:xml}\r\n\r\n\r\n\r\n\r\n\tcom.apple.developer.icloud-container-identifiers\r\n\t\r\n\tcom.apple.developer.ubiquity-kvstore-identifier\r\n\t$(TeamIdentifierPrefix)$(CFBundleIdentifier)\r\n\r\n\r\n{code}\r\nIf that does not work, the module should provide a hook to inject the keys. The [Ti.DynamicLib|https://github.com/appcelerator-modules/hook-embedded-frameworks/blob/master/ti.dynamiclib.js] plugin does something similar to enable dynamic libraries in Titanium. You basically just jump from the UUID's of the different PBX-sections until you reach the {{SystemCapabilities}} section and then add the {{com.apple.iCloud}} object and set it to {{true}}. The module should provide that functionality already, so if you bought it, the vendor should add it.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-08-13T14:25:53.000+0000", "updated": "2017-08-13T14:28:11.000+0000" }, { "id": "426585", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "I don't think the functionality existed when Matt wrote the original module, or when I worked on it. I finally thought to ask, years later... I'll add that support to it in the next couple of days and submit a PR.", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2017-08-13T16:13:25.000+0000", "updated": "2017-08-13T16:13:25.000+0000" }, { "id": "426586", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Is the module open source? I can only find a commercial version.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-08-13T17:13:27.000+0000", "updated": "2017-08-13T17:13:27.000+0000" }, { "id": "426593", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "I'm not convinced this is \"not our bug\", given it's the Appcelerator enterprise version of the module that has trouble -- https://github.com/appcelerator-modules/ti.icloud I'm guessing because it's enterprise, very few people have used it. Those that have used it have also figured out the Xcode settings or the Entitlements.plist. But if the general public tried to use it...\r\n\r\nThere's even a guide on how to write it, essentially. It doesn't expose as many methods. Why not open source the module?\r\nhttp://www.lighthouselogic.com/icloud-in-titanium/", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2017-08-14T05:11:04.000+0000", "updated": "2017-08-14T05:11:04.000+0000" }, { "id": "426594", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "The Ti.StoreKit module could exhibit the same behavior. If StoreKit is enabled in the generated project, it's not deliberately enabled by the module.", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2017-08-14T05:11:52.000+0000", "updated": "2017-08-14T05:11:52.000+0000" }, { "id": "426599", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hey Dawson,\r\n\r\nI did not know it was an Appc-curated module. That makes it a whole different thing. For Ti.StoreKit, the capabilities are managed via the Entitlements.plist and the capabilities used in the provisioning profile. *EDIT*: Btw, the linked blog post also suggests to enable it via the entitlements file, which is necessary either way (since Xcode generates the file as well when you enable it).", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-08-14T08:26:58.000+0000", "updated": "2017-08-14T08:30:06.000+0000" }, { "id": "426624", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "I've added a PoC PR of injecting the required \"com.apple.iCloud\" key [here|https://github.com/appcelerator-modules/ti.icloud/pull/2]. It is untested for now and would need a closer look. I basically just went through the pbx file, looked up the required UUID to handle and rewrote the system-capabilities to enable the iCloud key.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-08-14T17:19:39.000+0000", "updated": "2017-08-14T17:19:39.000+0000" }, { "id": "426672", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR works for me, the {{com.apple.iCloud}} key is injected properly. Open-sourced the script [here|https://github.com/hansemannn/titanium-system-capabilities] for everyone else who wants to use it!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-08-15T12:14:57.000+0000", "updated": "2017-08-15T12:14:57.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }