Giter Site home page Giter Site logo

SyntaxError expected } about pushplugin HOT 9 OPEN

phonegap-build avatar phonegap-build commented on September 13, 2024
SyntaxError expected }

from pushplugin.

Comments (9)

jdhiro avatar jdhiro commented on September 13, 2024

@epeleg Thanks for tracking this down, I'm experiencing the same issue. Do you happen to have a fix? =)

from pushplugin.

jdhiro avatar jdhiro commented on September 13, 2024

Hm, I took a quick look and I'm thinking it would make sense to let NSJSONSerialization do the heavy JSON lifting instead of the custom parseDictionary method.

from pushplugin.

jdhiro avatar jdhiro commented on September 13, 2024

I have a fix for this, putting together a pull request...

from pushplugin.

jdhiro avatar jdhiro commented on September 13, 2024

I've included a fix for this in my Cordova 3.0 pull request.

d3246c9

from pushplugin.

epeleg avatar epeleg commented on September 13, 2024

please see my comment on the pull request - using NSJSONSerialization - although is solves the escaping issue changes the returned result compared to the previous parseDictionary. so would cause apps to break as they will not find the expected data at "root level" of the object.

from pushplugin.

jdhiro avatar jdhiro commented on September 13, 2024

I'd be curious to know how much that affects people. My teams data is flat to start with (under the"APS" key). Flattening data like that could result in key conflicts anyways. However, if this is a problem for some people it shouldn't be to hard to flatten the NSDictionary before converting the JSON.

That said, I haven't seen anyone maintaining the repo, so I'm not confident right now that this will get pulled.

from pushplugin.

epeleg avatar epeleg commented on September 13, 2024

I am not sure, but i believe it would be a good Idea to maintain backwards compatibility.
maybe you (and anyone else reading this) can also comment here:
http://community.phonegap.com/nitobi/topics/syntaxerror_expected_token_where_getting_a_push_message_on_ios_using_com_adobe_plugins_pushplugin

from pushplugin.

jdhiro avatar jdhiro commented on September 13, 2024

I'd like to hear from one of the maintainers before I go do any work to flatten responses. Maybe @bobeast or someone can chime in?

I don't think it's worth it for the following reasons:

  • Flattening seems arbitrary and unnecessary, adds complication.
  • I'd be surprised if this broke many projects. I think most notification messages are flat anyways.
  • If a team created nested data, they probably want nested data.
  • My fork is for Cordova 3.0, and Cordova 3.0 has bigger breaking changes already.
  • JavaScript changes would be easy/minimal, and the changes can be documented in the readme.
  • I'm planning at least one other bigger breaking change in my fork.

from pushplugin.

rjmunro avatar rjmunro commented on September 13, 2024

Does the fact that #39 and #43 are closed mean this issue can be closed?

Flattening sounds like a silly thing to do to me. PushPlugin shouldn't be mangling data like that.

from pushplugin.

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.