Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

How to interpret results returned by ACS Push Notifications in Android

$
0
0

After I successfully implemented push notifications for one of my ios projects yesterday, imoved on to android. After some initial troubles (it's very different from ios), I am finally able to push messages to the android app. Not only the implementation is different from ios, the format of the returned object is also completely different. In iOS, i am able to format the message properly (i.e. removing the annoying alert text) by using JSON.stringify(e.data.alert) . That of course doesn't work for android. Specifically, the following is the format returned without using JSON.stringify:

{bubbles = false,
     payload = {
        "android": {"icon": "alert",
                "alert": "This is a test message body",
                "title": "This is the test Title"
                }
            },
     source=ti.cloudpush.CloudpushModule@42df9f00,
     type = callback,
    cancelBubble = false}
Would be most grateful if anyone can advice how to get to the alert part, i.e. trimming all before and including alert. And whether JSON.stringify is needed. So far, I could e.payload to avoid bulk of the text in front, but ultimately i'd like to just get the alert part out to alert user.

Many thanks in advance.


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>