rdelrosario / xamarin-plugins

Cross platform Xamarin & Windows plugins for PCLs
MIT License
179 stars 161 forks source link

What is the point of attempting to parse the message as JSON? #45

Open kentcb opened 8 years ago

kentcb commented 8 years ago

All this does is create spurious exceptions. Why not just pass the message through and let the application deal with it?

rdelrosario commented 8 years ago

The reason is to unify the data in a same format, so that notifications could be received from the Core PCL project when working with multiple platforms.

rdelrosario commented 8 years ago

Will you suggest a better approach when having a cross platform application solution?

Duranom commented 8 years ago

The json is actually fine as one cannot be certain what the content is at the moment or will be in the future, the dictionary in the past was fine as long as the notification was simple but taking full advantage of notication was a bit hard.

If one has issues than they should create a few platform specific handlers that work based on criteria and transform the required information to a model/struct that can be used in a shared environment or pass the information to the platform, of course don't forget one or two more global unhandled handlers to show a message or so for future actions/handlings.