We are use pushwoosh and Unity without much issue but now we want to use targeted pushes using the Remote API.

According to the API docs the createMessage needs a device id if we want to target specific devices. Is this the same as the token we get when registering the device or something different? We tried with the push token but no message was received. If this is something else how do we get it using the unity SDK.

Note: this is being tested right now with android but we will need this to apply to iOS as well.

asked 22 Jan '14, 19:36
MWadstein's gravatar image


edited 22 Jan '14, 19:37

Yes, this is the device token returned by registerDevice. In my experience calls to createMessage using the "devices" field are not entirely reliable. PushWoosh has advised me to use the Tags feature (i.e. the "conditions" field) instead but I have not found that entirely reliable either.

permanent link
answered 22 Jan '14, 20:53
jhnsctt's gravatar image


The Unity does not use the registerDevice call, it is just part of the InitPushwoosh where I create the connectio to the PushWooshProxy for the android plugin or i do regiterforremotenotifiations on the iOS portion.

It does not return anything but if i do a GetPushwooshToken I get back the token which is a looooooong string returned from the plugin.

Is this the correct entry for DeviceID in the createMessage Remote API call or should i be using something else?

I would really love if Pushwoosh could comment on what deviceid is supposed to be in the createMessage in more detail so i can verify that I am sending the right info but the servers are just not working right.

It is hard to debug an issue if I cann't make sure I am even doing it right. It is possible to use the Unity Plugin to register my players and also send them directed pushes using the remote API right?

permanent link
answered 22 Jan '14, 21:26
MWadstein's gravatar image


In the "devices" section of the createMessage method you should specify either push tokens or HWIDs. So, you are correct, you are using the right entry.

However, I'd like to stress out that we recommend using Tags instead: as John has already mentioned, push tokens are not a reliable way to target your users, since they tend to expire from time to time.

permanent link
answered 23 Jan '14, 09:48
Dmitry%20%20Dyudeev's gravatar image

Dmitry Dyudeev

So now this is the issue we are having. I tried using createMessage but the messages never seem to show up despite the 200 result ok reponses and the control panel showing no issues.

I am now trying to do it by tags as suggested above but that is not working as well. I created a new tag with the name of ID and am trying to set that tag in my app after i register for push notifications. The registration "seems" to go fine, I get a good result back from pushwoosh (response 200) and a token. When I call SetTags I get back a 210 (device not found) response. This is if I do it using the Remote API or in Unity itself using the SetTags method.

The code I use is pretty much the example cs just with a call to SetTags in it.

I do:

  1. InitPushWoosh() in the Start()
  2. In the onRegisteredForPushNotifications() i call setStringTag("ID", "100001240172758");

and below is the result

Snippets from the Logcat.

V/GCMRegistrar( 3577): Saving regId on app version 1
I/GCMIntentService( 3577): Device registered: regId = APA91bG-g5OjMP_mAsiN5SA1nIJWkPJXWKJtnOE-vJxHMxZbKHRuUa332SXQ-C_9hsCDe76NxAFSmhUJQIgsIgjpd2oyx2kNfWd6YcbrWKOwTTMQuyuI-_okWvyEcs6TXsAvmNlTwi00VQ76txNsKrtF1dSVp_yWdyaXlxgxeYXL0a_Tmi8kGFA
W/DeviceRegistrar( 3577): Try To Registered for pushes
W/PushWoosh: NetworkUtils( 3577): PushWooshResult: {"status_code":200,"status_message":"OK","response":null}
W/PushWoosh DeviceFeature2_5( 3577): Send AppOpen success

W/PushWoosh: NetworkUtils( 3577): PushWooshResult: {"status_code":200,"status_message":"OK","response":null}
V/GCMRegistrar( 3577): Setting registered on server status as: true
I/System.out( 3577): Using broadcast registration: true
W/PushEventsTransmitter( 3577): No android.permission.BROADCAST_STICKY. Reverting to simple broadcast
W/DeviceRegistrar( 3577): Registered for pushes: APA91bG-g5OjMP_mAsiN5SA1nIJWkPJXWKJtnOE-vJxHMxZbKHRuUa332SXQ-C_9hsCDe76NxAFSmhUJQIgsIgjpd2oyx2kNfWd6YcbrWKOwTTMQuyuI-_okWvyEcs6TXsAvmNlTwi00VQ76txNsKrtF1dSVp_yWdyaXlxgxeYXL0a_Tmi8kGFA

W/PushWoosh DeviceFeature2_5( 3577): Try To sent Tags
W/PushWoosh: NetworkUtils( 3577): PushWooshResult: {"status_code":210,"status_message":"Device not found","response":null}
E/PushWoosh DeviceFeature2_5( 3577): ERROR: sent Tags null. Response = com.arellomobile.android.push.utils.NetworkUtils$NetworkResult@4264c850
E/PushWoosh DeviceFeature2_5( 3577): java.lang.Exception
E/PushWoosh DeviceFeature2_5( 3577):    at com.arellomobile.android.push.DeviceFeature2_5.sendTags(DeviceFeature2_5.java:250)
E/PushWoosh DeviceFeature2_5( 3577):    at com.arellomobile.android.push.PushManager.sendTagsFromBG(PushManager.java:194)
E/PushWoosh DeviceFeature2_5( 3577):    at com.arellomobile.android.push.tags.SendPushTagsAbstractAsyncTask.doInBackground(SendPushTagsAbstractAsyncTask.java:45)
E/PushWoosh DeviceFeature2_5( 3577):    at com.arellomobile.android.push.tags.SendPushTagsAbstractAsyncTask.doInBackground(SendPushTagsAbstractAsyncTask.java:1)
E/PushWoosh DeviceFeature2_5( 3577):    at android.os.AsyncTask$2.call(AsyncTask.java:288)
E/PushWoosh DeviceFeature2_5( 3577):    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
E/PushWoosh DeviceFeature2_5( 3577):    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
E/PushWoosh DeviceFeature2_5( 3577):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
E/PushWoosh DeviceFeature2_5( 3577):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
E/PushWoosh DeviceFeature2_5( 3577):    at java.lang.Thread.run(Thread.java:841)
permanent link
answered 23 Jan '14, 18:35
MWadstein's gravatar image


edited 23 Jan '14, 18:40

Do you still experience this behavior? Recently we have had some delays during "registerDevice" processing that's why you received "device not found" error. This should be resolved now. Let me know if everything is ok?

permanent link
answered 27 Jan '14, 17:55
shader's gravatar image


Your answer
toggle preview

Follow this question

By Email:

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



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:


question asked: 22 Jan '14, 19:36

question was seen: 2,828 times

last updated: 27 Jan '14, 17:55