{ "id": "125443", "key": "AC-2467", "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": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2014-02-14T06:09:09.000+0000", "created": "2014-01-27T11:27:38.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "mcota", "key": "mcota", "displayName": "Marco Cota", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:41:31.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": [], "description": "I have uploaded my iOS keys from the keychain to the ACS manager (dev and prod). They keys are for a push enabled application. I used the code in the ACS example to receive push notifications. I re-installed the app I am writing with the new provision profile. I don't get an error on startup (which I did before I started using the new profile). I can see the application in the iOS settings as an app that can receive push notifications. I then went to test sending a push notice several times from dev and then once eventually from prod after dev did not work and none of them went through - but I am not getting any errors. I should also mention that the documentation in the Titanium Push Notification Guide is a bit unclear as to the necessity of creating a user and/or registering to a channel as well as the use of tokens. The documentation makes most of those steps seem like optional alternatives to a general push registration. That said, I did create a user but am not logging that user in because the example was unclear and I would prefer not to have every user login if avoidable. \r\n\r\nThe code I have in app.js to register for push notices is as follows (am I missing something):\r\n{code}\r\nTi.Network.registerForPushNotifications({\r\n // Specifies which notifications to receive\r\n types: [\r\n Ti.Network.NOTIFICATION_TYPE_BADGE,\r\n Ti.Network.NOTIFICATION_TYPE_ALERT,\r\n Ti.Network.NOTIFICATION_TYPE_SOUND\r\n ],\r\n success: deviceTokenSuccess,\r\n error: deviceTokenError,\r\n callback: receivePush\r\n});\r\n// Process incoming push notifications\r\nfunction receivePush(e) {\r\n alert('Received push: ' + JSON.stringify(e));\r\n}\r\n// Save the device token for subsequent API calls\r\nfunction deviceTokenSuccess(e) {\r\n deviceToken = e.deviceToken;\r\n}\r\n\r\nfunction deviceTokenError(e) {\r\n alert('Failed to register for push notifications! ' + e.error);\r\n}\r\n{code}\r\n\r\n", "attachment": [], "flagged": false, "summary": "ACS push notification with registered app not receiving", "creator": { "name": "jaymefishman", "key": "jaymefishman", "displayName": "Jayme Fishman", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jaymefishman", "key": "jaymefishman", "displayName": "Jayme Fishman", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "MAC OSX Titanium Studio 3.2", "comment": { "comments": [ { "id": "290219", "author": { "name": "jaymefishman", "key": "jaymefishman", "displayName": "Jayme Fishman", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Just thought I would bump this as it is a blocking issue for me. Please let me know if I am missing something or if this is a bug.\n\nThanks.", "updateAuthor": { "name": "jaymefishman", "key": "jaymefishman", "displayName": "Jayme Fishman", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-01-29T16:08:01.000+0000", "updated": "2014-01-29T16:08:01.000+0000" }, { "id": "290446", "author": { "name": "jaymefishman", "key": "jaymefishman", "displayName": "Jayme Fishman", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Just checking in again. Please let me know if this is an ACS issue.", "updateAuthor": { "name": "jaymefishman", "key": "jaymefishman", "displayName": "Jayme Fishman", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-01-30T18:26:53.000+0000", "updated": "2014-01-30T18:26:53.000+0000" }, { "id": "290756", "author": { "name": "mcota", "key": "mcota", "displayName": "Marco Cota", "active": false, "timeZone": "America/Los_Angeles" }, "body": "The code you are providing is only intended to enable the device and the app to receive Push Notifications, either from ACS or a third party service, in order to use the ACS as you mention you will need to create a user and subscribe to a channel.\n\nRelated wiki: http://docs.appcelerator.com/titanium/3.0/#!/guide/Push_Notifications\nAPI: http://docs.appcelerator.com/titanium/3.0/#!/api/Titanium.Cloud.PushNotifications\n\nThis is the sample code of how to implement and subscribe to the ACS push notification service.\n\n{code}\nvar Cloud = require('ti.cloud');\nvar deviceToken;\n \nvar win = Titanium.UI.createWindow({\n title:'ACS iOS App',\n backgroundColor:'#fff'\n});\n\n \nvar registerPush = Ti.UI.createButton({\n width:260,\n height:30,\n top:30,\n title:\"REGISTER PUSH NOTIFICATION\"\n});\nwin.add(registerPush);\n \nregisterPush.addEventListener('click',registerUser);\n\n//user login on cloud using default credential\nfunction loginUser(){\n Cloud.Users.login({\n login: 'push123x',\n password: 'push123x'\n }, function (e) {\n if (e.success) {\n var user = e.users[0];\n\t\t\talert(\"Loggin successfully\");\n getDeviceToken();\n } else {\n alert(\"Error :\"+e.message);\n }\n });\n}\n\n// getting device token\nfunction getDeviceToken(){\n Titanium.Network.registerForPushNotifications({\n types: [\n Titanium.Network.NOTIFICATION_TYPE_BADGE,\n Titanium.Network.NOTIFICATION_TYPE_ALERT,\n Titanium.Network.NOTIFICATION_TYPE_SOUND\n ],\n success:function(e)\n {\n deviceToken = e.deviceToken;\n alert(\"deviceToken = \"+deviceToken);\n registerForPush();\n },\n error:function(e)\n {\n alert(\"Error: \"+e.message);\n },\n callback:function(e)\n {\n alert(\"push notification received\"+JSON.stringify(e.data));\n }\n });\n}\n\n// register for push notification on cloud server\nfunction registerForPush(){\n Cloud.PushNotifications.subscribe({\n channel: 'demo_alert',\n type:'ios',\n device_token: deviceToken\n }, function (e) {\n if (e.success) {\n alert('Success :'+((e.error && e.message) || JSON.stringify(e)));\n } else {\n alert('Error:' + ((e.error && e.message) || JSON.stringify(e)));\n }\n });\n}\n\nwin.open();\n{code}", "updateAuthor": { "name": "mcota", "key": "mcota", "displayName": "Marco Cota", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-02-01T00:14:00.000+0000", "updated": "2014-02-01T00:14:00.000+0000" }, { "id": "290770", "author": { "name": "jaymefishman", "key": "jaymefishman", "displayName": "Jayme Fishman", "active": true, "timeZone": "America/Los_Angeles" }, "body": "That is very helpful. The piece that is still unclear is how does one programmatically create a user? I can see how to do it from the ACS panel but that would not be practical OR can you share a single \"user\" across multiple devices?", "updateAuthor": { "name": "jaymefishman", "key": "jaymefishman", "displayName": "Jayme Fishman", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-02-01T01:38:26.000+0000", "updated": "2014-02-01T01:38:26.000+0000" }, { "id": "292098", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Please take a look at the following documentation that describes how to create a user programatically.\n\nhttp://docs.appcelerator.com/cloud/latest/#!/api/Users-method-create\n", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-02-09T07:47:30.000+0000", "updated": "2014-02-09T07:47:30.000+0000" }, { "id": "293016", "author": { "name": "jaymefishman", "key": "jaymefishman", "displayName": "Jayme Fishman", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I got this working now - you can close the ticket if you want.", "updateAuthor": { "name": "jaymefishman", "key": "jaymefishman", "displayName": "Jayme Fishman", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-02-14T00:09:37.000+0000", "updated": "2014-02-14T00:09:37.000+0000" }, { "id": "293129", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing this ticket based on reporter's latest comment.", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-02-14T06:09:33.000+0000", "updated": "2014-02-14T06:09:33.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }