I met a problem when I try to use getTagsAsync to get tags from Pushwoosh server. Here is the data I get.

Pushwoosh request:
| Url: https://cp.pushwoosh.com/json/1.3/getTags
| Payload: {"request":{"v":"3.3.2.611","device_type":3,"application":"xxxx-xxxxx","hwid":"xxxxxxx","userId":"xxxxxx"}}
| Response: {"status_code":200,"status_message":"OK","response":{"result":{"Language":"zh","Application Version":"1.0","Country":"jp","City":"jp, kyoto","First Install":1456876800,"Last Application Open":1456963200,"green_user":1234567,"green_name":"test_name","green_attr":["test_x","test_y"],"channel_test":["four","two","three"]}}}

When I use getTagsAsync to get those tags, I got java.io.IOException. But the system didn't crash and I can still load the right tags.

E/Pushwoosh﹕ Exception ocurred
java.io.IOException: Serialization error: org.json.JSONArray
        at com.pushwoosh.internal.utils.ObjectSerializer.serialize(Unknown Source)
        at com.pushwoosh.internal.utils.NotificationPrefs.setTags(Unknown Source)
        at com.pushwoosh.PushManager$1InnerTagsListener.onRequestFinished(Unknown Source)
        at com.pushwoosh.internal.request.PushRequest.setProcessed(Unknown Source)
        at com.pushwoosh.internal.request.RequestManager$1$1.run(Unknown Source)
        at android.os.Handler.handleCallback(Handler.java:739)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:211)
        at android.app.ActivityThread.main(ActivityThread.java:5373)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815)
 Caused by: java.io.NotSerializableException: org.json.JSONArray
        at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1344)
        at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1651)
        at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1497)
        at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1461)
        at java.util.HashMap.writeObject(HashMap.java:976)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1033)
        at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1384)
        at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1651)
        at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1497)
        at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1461)
        at com.pushwoosh.internal.utils.ObjectSerializer.serialize(Unknown Source)
        at com.pushwoosh.internal.utils.NotificationPrefs.setTags(Unknown Source)

at com.pushwoosh.PushManager$1InnerTagsListener.onRequestFinished(Unknown Source)             at com.pushwoosh.internal.request.PushRequest.setProcessed(Unknown Source)             at com.pushwoosh.internal.request.RequestManager$1$1.run(Unknown Source)             at android.os.Handler.handleCallback(Handler.java:739)             at android.os.Handler.dispatchMessage(Handler.java:95)             at android.os.Looper.loop(Looper.java:211)             at android.app.ActivityThread.main(ActivityThread.java:5373)             at java.lang.reflect.Method.invoke(Native Method)             at java.lang.reflect.Method.invoke(Method.java:372)             at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020)             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815)

 This is My code 
        PushManager.GetTagsListener listener = new PushManager.GetTagsListener() {
        @Override
        public void onTagsReceived(Map<String, Object> map) {
            Log.v(getClass().getName(), "tags loaded");
        }

        @Override
        public void onError(Exception e) {
            Log.v(getClass().getName(), "can not load tags");
        }
    };
    PushManager.getTagsAsync(contextForHelper, listener);

Can some tell me how to solve this exception ?

asked 11 Mar '16, 13:52
wensixing's gravatar image

wensixing
112

edited 11 Mar '16, 13:57

Thanks for reporting this, our engineers are looking into the issue at the moment.

permanent link
answered 15 Mar '16, 11:31
Benedict's gravatar image

Benedict
7127

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:

×447
×37
×23
×4
×2

question asked: 11 Mar '16, 13:52

question was seen: 716 times

last updated: 15 Mar '16, 11:31