View Full Version : Ext.device.Push

6 Nov 2012, 6:05 AM
noticed this in the 2.1 rc docs.
what exactly does it do? its hard to understand from the docs. the docs simply say "Provides a way to send push notifications to a device"
can someone please elaborate or give a use case on when to use this?

6 Nov 2012, 1:45 PM
you can find more infos here: http://en.wikipedia.org/wiki/Apple_Push_Notification_Service and here: http://en.wikipedia.org/wiki/Android_Cloud_to_Device_Messaging_Service

6 Nov 2012, 10:15 PM
Does this mean I can send stuff like badges etc to my sencha app even if it is not currently open and running?

19 Nov 2012, 5:38 PM

Yes, that's pretty much it. Just got it working for the first time with my app -- let me know if you need help.

16 Feb 2013, 1:54 PM
did you guys get it to work for IOS and android with Ext.device.Push?
the docs state only ios support...

26 Aug 2013, 11:00 PM

(http://www.sencha.com/forum/member.php?221094-mmigdol)I recently started developing with Sencha Touch 2, at the moment i'm creating an app that needs support for Apple Push Notifications.

So I've created the neccesary certificates at the Apple developer center and used them to package the application with the Sencha Touch SDK tools. All went well and I'm able to run this app on my device.

In the app I added a button to receive the device token. When I tap the button it executes the following code

This is the code i get from sencha docs. Bud i dont have much success yet.. please direct me to solve this issue.. Thanks in advance

Ext.device.Push.register({ type: Ext.device.Push.ALERT | Ext.device.Push.BADGE | Ext.device.Push.SOUND, success: function (token) { console.log('# Push notification registration successful:'); Ext.Msg.alert(' token: ' + token); }, failure: function (error) { console.log('# Push notification registration unsuccessful:'); Ext.Msg.alert(' error: ' + error); }, received: function (notifications) { console.log('# Push notification received:'); Ext.Msg.alert(' ' + JSON.stringify(notifications)); }

4 Sep 2013, 10:46 PM
Ext.device.Push.register({ type: Ext.device.Push.ALERT|Ext.device.Push.BADGE|Ext.device.Push.SOUND, success: function(token) { console.log('# Push notification registration successful:'); console.log(' token: ' + token); }, failure: function(error) { console.log('# Push notification registration unsuccessful:'); console.log(' error: ' + error); }, received: function(notifications) { console.log('# Push notification received:'); console.log(' ' + JSON.stringify(notifications)); }});

I have put this code in my app.js launch function. But Ext.device.Push.register does not give me any of the functions success, failure or received. Is there anyone that got the device token on iOS?

can u plz help to solve this issue ..