I've got a app that is using titanium SDK 3.2.1 on a Samsung Galaxy running 4.1.2 and I've got everything set up as instructed on the Android Titanium guide. I'm able to register the device without any issues, but when I go to set tags, it crashes every time with no real output. It happens no matter where I move the setTag code (inside a HTTPClient request, right after the registration code, after a multisecond timeout, etc). I didn't see the setTags code anywhere in the Android Titanium examples but its on the guide page so I'm assuming its supposed to be supported.

Here would be an example of my code:

pushnotifications = require('com.arellomobie.push');
    Ti.API.debug("module is => " + pushnotifications);

    pushnotifications.pushNotificationsRegister("xxxxxxxxxxxx", "xxxxxxxxxx", {
        //NOTE: all the functions fire on the background thread, do not use any UI or Alerts here
        success:function(e)
        {
            Ti.API.debug('Pushwoosh JS registration success event: ' + e.registrationId);
            setupPooshwooshTags(null, null, true);
        },
        error:function(e)
        {
            Ti.API.debug("Pushwoosh Error during registration: "+e.error);
        },
        callback:function(e) // called when a push notification is received
        {
            Ti.API.debug('Pushwoosh JS message event: ' + JSON.stringify(e.data));
        }
    });
    pushnotifications.setTags({office:"Boston",type:"HQ"});

I should also note that I never see the debug calls from these return functions. I can see in the log that it registered the device, however and can confirm that it did by signing in to Pushwoosh. Any help would be great!

asked 11 Feb '14, 06:14
FrankThe2nd's gravatar image

FrankThe2nd
12

edited 11 Feb '14, 06:15

Hello,

Could you please try the following code?

var win = Ti.UI.createWindow({ backgroundColor : 'white' }); var label = Ti.UI.createLabel(); win.add(label);

var pushnotifications = require('com.arellomobile.push'); Ti.API.info("module is => " + pushnotifications);

pushnotifications.pushNotificationsRegister("xxxxxxxxxxxx", "xxxxxxxxxx", { success : function(e) { Ti.API.info('JS registration success event: ' + e.registrationId); }, error : function(e) { Ti.API.error("Error during registration: " + e.error); }, callback : function(e)// called when a push notification is received { Ti.API.info('JS message event: ' + JSON.stringify(e.data)); } });

var button = Ti.UI.createButton({

}); button.addEventListener('click', function(e) { pushnotifications.setTags({ office:"Boston",type:"HQ" }, function(status) { Ti.API.info('setTags success'); }, function(status) { Ti.API.info('setTags failed'); }); });

win.add(button); win.open();

If it doesn't help, please create a support ticket via "Contact Us" form on the website (www.pushwoosh.com/contact-us), and we will further investigate this issue.

permanent link
answered 19 Feb '14, 14:01
Dmitry%20%20Dyudeev's gravatar image

Dmitry Dyudeev
3.7k7

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×446
×64
×30
×30

question asked: 11 Feb '14, 06:14

question was seen: 1,420 times

last updated: 19 Feb '14, 14:01