Android Cloud Push Notification - How to set up a channel?

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

Hi, I am new to Titanium Appcelerator, and have been working on cloud push notification for Android app. So far the app can receive notifications, but I need to set up different channels for different users.

I have in my code:

function defaultSubscribe(){
        Cloud.PushNotifications.subscribe({
            channel: 'test',
            device_token: deviceToken,
            type: 'android'
        }, function (e){
            if (e.success) {
               alert('Subscribed for Push Notification!');
            }else{
                alert('Error:' +((e.error && e.message) || JSON.stringify(e)));
            }
        });
    }
But the channels are all 'N/A' in the ACS app push logs. I've been searching for some answers but no luck yet...

Can anyone give me a brief tutorial how this should be done properly? Many thanks!

— asked 11 months ago by L M
0 Comments

1 Answer

Did you only test push from admin console, if you test from admin console, there is no channel, it sends to all devices that have subscribed. that's why you see n/a

— answered 11 months ago by Wei Kong
answer permalink
1 Comment
  • Hi Wei, thanks for you quick feedback. Greatly appreciate it.

    Yes, I was testing push from admin console, under push notifications tab and chose advanced, and input the following json code:

    {"title":"test", "alert":"test", "channel":"my_channel"}
    Is there a way to send notification to a channel through admin console? if not, how should I do it the right way?

    Thanks again.

    — commented 11 months ago by L M

Your Answer

Think you can help? Login to answer this question!