Error with the Push Notification

You must Login before you can answer or comment on any questions.

Hello everybody,

I am trying to test the push notification using Titanium, I followed this tuto word by word:


var win = Ti.UI.createWindow({
    title:'Android Cloud Push Notification'
var CloudPush = require('ti.cloudpush');
        CloudPush.debug = true;
        CloudPush.enabled = true;
        CloudPush.showTrayNotificationsWhenFocused = true;
        CloudPush.focusAppOnPush = false;
var deviceToken;
var Cloud = require('');
    Cloud.debug = true;
var submit = Ti.UI.createButton({
    title : 'Register For Push Notification',
    height : 120,
    width : 220,
    top : 100,
submit.addEventListener('click', function(e) {
                success: function deviceTokenSuccess(e) {
                    alert('Device Token: ' + e.deviceToken);
                    deviceToken = e.deviceToken
                error: function deviceTokenError(e) {
                    alert('Failed to register for push! ' + e.error);
function loginDefault(e){
    //Create a Default User in Cloud Console, and login
        login: '******',
        password: '******'
    }, function (e) {
        if (e.success) {
            alert("login success");
        } else {
            alert('Error: ' +((e.error && e.message) || JSON.stringify(e)));
function defaultSubscribe(){
                    channel: 'alert',
                    device_token: deviceToken,
                    type: 'android'
                }, function (e){
                    if (e.success) {
                       alert('Subscribed for Push Notification!');
                        alert('Error:' +((e.error && e.message) || JSON.stringify(e)));
CloudPush.addEventListener('callback', function (evt) {
CloudPush.addEventListener('trayClickLaunchedApp', function (evt) {'Tray Click Launched App (app was not running)');
    //alert('Tray Click Launched App (app was not running');
CloudPush.addEventListener('trayClickFocusedApp', function (evt) {'Tray Click Focused App (app was already running)');
    //alert('Tray Click Focused App (app was already running)');
But, when I tried to test the code (in the fifth element ( 5-Android Push Configuration) ) , normally, I must receive 3 alerts... Instead, I receive an error message
Error: Invalid email/username and password
In general, getting a devicetoken is no problem. Then I try to login to the cloud with a user. That gives no success. There is always the following error: Invalid email/username or password. I'm sure the username ande password is correct.

P.S: I am testing this code using an android Device, and using this specifications into my app:

Titanium sdk ver. : 2.1.0.GA Android runtime : V8 ti.cloudpush : 2.0.5 : 2.1.0

What's wrong with this?

Thank you in advance!

2 Answers

Accepted Answer

Plz make sure that u have made the user on development side and not on production side.

I don't if you can help me on this:

I was able to see (1) Android device added on the push notification screen.(same as a screen shot on the blog). Then I tried sending the Notification through the test form provided by appcelerator.

Problem is i never received the notification :(

I tried it twice, but no results !

Wat can be wrong in this ?

— answered 3 years ago by Karray Gargouri
answer permalink
  • Plz see whether the device is added on development side?

    — commented 3 years ago by Muhammad Wahhab Mirza

  • And send the push notification from development side

    — commented 3 years ago by Muhammad Wahhab Mirza

  • My device is added on the development side, and I send the push notification, also, from the development side but there is no notification received ! :(

    Any suggestions ?

    — commented 3 years ago by Karray Gargouri

  • Show 10 more comments

Your Answer

Think you can help? Login to answer this question!