{"action":"created","issue":{"url":"https://api.github.com/repos/aai/applocate/issues/2","labels_url":"https://api.github.com/repos/aai/applocate/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/aai/applocate/issues/2/comments","events_url":"https://api.github.com/repos/aai/applocate/issues/2/events","html_url":"https://github.com/aai/applocate/issues/2","id":56744410,"number":2,"title":"1) AppLocate Restrictions Don't Work 2) The Docs in the README show incorrect parameter for device identifier","user":{"login":"DanKnox","id":967413,"avatar_url":"https://avatars.githubusercontent.com/u/967413?v=3","gravatar_id":"","url":"https://api.github.com/users/DanKnox","html_url":"https://github.com/DanKnox","followers_url":"https://api.github.com/users/DanKnox/followers","following_url":"https://api.github.com/users/DanKnox/following{/other_user}","gists_url":"https://api.github.com/users/DanKnox/gists{/gist_id}","starred_url":"https://api.github.com/users/DanKnox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanKnox/subscriptions","organizations_url":"https://api.github.com/users/DanKnox/orgs","repos_url":"https://api.github.com/users/DanKnox/repos","events_url":"https://api.github.com/users/DanKnox/events{/privacy}","received_events_url":"https://api.github.com/users/DanKnox/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-05T23:06:28Z","updated_at":"2015-03-05T06:35:35Z","closed_at":null,"body":"The README shows the device identifier as being the `UUID` parameter when the actual parameter name is `UDID`:\r\n\r\n```ruby\r\n# expected options -> { uuid: \"ABCD-DCCDDC-12394812389-CDC\", restrictions: {\"allowSafari\" => false} }\r\nApplocate::API.restrict(options)\r\n```\r\n\r\n**SHOULD BE**\r\n\r\n```ruby\r\n# expected options -> { udid: \"ABCD-DCCDDC-12394812389-CDC\", restrictions: {\"allowSafari\" => false} }\r\nApplocate::API.restrict(options)\r\n```\r\n\r\n**ALSO...**\r\nThe example above does not work. It never hides Safari. Does a full provisioning profile need to be sent or should fragments like that in fact work?\r\n\r\n**SOME LOVELY IRB OUTPUT**\r\n\r\n```ruby\r\nirb(main):003:0> Applocate::API.register_device\r\n=> {\"id\"=>74, \"uuid\"=>nil, \"enrollment_url\"=>\"https://www.applocate.com/enroll?token=cbc5ba42-b82e-4758-b394-167f19861723\"}\r\n\r\n# Visited the URL on the Device\r\n\r\nirb(main):004:0> Applocate::API.list_devices\r\n=> [{\"id\"=>9, \"uuid\"=>\"6f9315a4d2a43cd6ce10c1adeb624e816b6b06ff\", \"enrollment_url\"=>nil}, \r\n      {\"id\"=>32, \"uuid\"=>\"4c465fd5eaccb8c233bb15ebf5c28ca69f1448e5\", \"enrollment_url\"=>nil}, \r\n      {\"id\"=>33, \"uuid\"=>\"acd900dade7c82890b0d96acc712a00acd136d85\", \"enrollment_url\"=>nil},\r\n      {\"id\"=>74, \"uuid\"=>\"959bde1f13f8f194dbc52e8ba290d573030c6ba0\", \"enrollment_url\"=>nil}]\r\n\r\n# The device now shows as registered in the list\r\n# So we send a command using UUID...\r\n\r\nirb(main):006:0> Applocate::API.restrict({uuid: \"959bde1f13f8f194dbc52e8ba290d573030c6ba0\", restrictions: {\"allowSafari\" => false}})\r\n=> {\"\"=>{\"id\"=>2034, \"device_id\"=>62, \"alert\"=>nil, \"token\"=>nil, \"badge\"=>nil, \"sound\"=>nil, \"options\"=>nil, \"mdm\"=>nil, \"sent_at\"=>nil, \"created_at\"=>\"2015-02-05T21:24:22.652Z\", \"updated_at\"=>\"2015-02-05T21:24:22.652Z\"}}\r\n\r\n# There is no device identifier in the output above as the key for the nested hash... also mdm and options are nil.\r\n\r\n# Send a command using UDID:\r\nirb(main):003:0* Applocate::API.restrict({udid: \"959bde1f13f8f194dbc52e8ba290d573030c6ba0\", restrictions: {\"allowSafari\" => false}})\r\n=> {\"959bde1f13f8f194dbc52e8ba290d573030c6ba0\"=>{\"id\"=>2041, \"device_id\"=>74, \"alert\"=>nil, \"token\"=>\"94c67d6f2587a7d7a704eb239433dc432293ee6e3b5f997d21c6cfcf8ca45083\", \"badge\"=>nil, \"sound\"=>nil, \"options\"=>nil, \"mdm\"=>\"C1F8C251-4093-4D31-98B5-85A979149C59\", \"sent_at\"=>nil, \"created_at\"=>\"2015-02-05T23:02:07.553Z\", \"updated_at\"=>\"2015-02-05T23:02:07.553Z\"}}\r\n\r\n# Now we get output but Safari is never restricted on the device.\r\n```\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/aai/applocate/issues/comments/77314527","html_url":"https://github.com/aai/applocate/issues/2#issuecomment-77314527","issue_url":"https://api.github.com/repos/aai/applocate/issues/2","id":77314527,"user":{"login":"idyll","id":4642,"avatar_url":"https://avatars.githubusercontent.com/u/4642?v=3","gravatar_id":"","url":"https://api.github.com/users/idyll","html_url":"https://github.com/idyll","followers_url":"https://api.github.com/users/idyll/followers","following_url":"https://api.github.com/users/idyll/following{/other_user}","gists_url":"https://api.github.com/users/idyll/gists{/gist_id}","starred_url":"https://api.github.com/users/idyll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idyll/subscriptions","organizations_url":"https://api.github.com/users/idyll/orgs","repos_url":"https://api.github.com/users/idyll/repos","events_url":"https://api.github.com/users/idyll/events{/privacy}","received_events_url":"https://api.github.com/users/idyll/received_events","type":"User","site_admin":false},"created_at":"2015-03-05T06:35:35Z","updated_at":"2015-03-05T06:35:35Z","body":"The docs have been updated to refer to the udid. The API will still return it as uuid but will ALSO now return the udid so that we can standardize on using udid.\r\n\r\nI assume restrictions are working for you now, but if now let me know and I will get you a sample that will work."}}