Code Monkey home page Code Monkey logo

Comments (8)

argon avatar argon commented on June 3, 2024

I will need to investigate this further, but at first glance it would seem that whatever is getting printed out there is only the data within the 'aps' namespace of the notification. Can you provide some context of the code you are running on iOS so I can help.

from node-apn.

tifroz avatar tifroz commented on June 3, 2024

Thanks for the quick reply.

I created a gist https://gist.github.com/877914
with the objective-c class that handles all push-related things in my app

Background:  am using phonegap to run the app in webview, so the class essentially acts as a glue between native ios stuff and the javascript app. The relevant methods at the bottom are [setNotificationMessage] which stores the notification data in a global variable (notificationMessage), and [notificationReceived], which converts the data into JSON (using the JSON Framework library: http://stig.github.com/json-framework/
) and invokes the app by call a delegate javascript method.

Note that the log statement from line 89 NSLog(@"setNotificationMessage:%@", notification); spits out exactly the snippet below which rules out the JSON conversion as a potential culprit

setNotificationMessage:{
    alert = "You have a new message";
    badge = 3;
    sound = "ping.aiff";
}

from node-apn.

tifroz avatar tifroz commented on June 3, 2024

Hum...I accidentally changed the status to 'closed' and apparently you can't re-open an issue unless you're a contributor on the repository. Can we consider this issue as open for all practical purposes ? :)

from node-apn.

argon avatar argon commented on June 3, 2024

Are you by any chance using the Urban Airship Push notification class?

from node-apn.

tifroz avatar tifroz commented on June 3, 2024

Yes and no - it's derived from the urbanairship plugin for phonegap, but it does not use urbanairship (plugs in directly into APN)

Sent from my iPhone

On Mar 20, 2011, at 2:27 AM, [email protected] wrote:

Are you by any chance using the Urban Airship Push notification class?

Reply to this email directly or view it on GitHub:
#5 (comment)

from node-apn.

argon avatar argon commented on June 3, 2024

Check your AppDelegate class because in the standard samples objectForKey:@"aps" is called on the notification dictionary in at least two places which will strip out the custom payload.

Try changing these lines to return the dictionary directly and see if that works.

from node-apn.

tifroz avatar tifroz commented on June 3, 2024

Bingo, you're absolutely right - I had completely forgotten about the very existence of these AppDelegate's methods. It worked like a charm after I implemented your suggestion.

Apologize for the trouble....can't say how much I appreciate you looking into it: Thank you !

from node-apn.

argon avatar argon commented on June 3, 2024

No problem, glad the library is of use to you.

from node-apn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.