-
Notifications
You must be signed in to change notification settings - Fork 229
Number in a payload delivered as NSString #86
Comments
Command line input is all interpreted as a string. Unfortunately, there is no way to coerce other types from the CLI. To send numbers as integers or floating points, you must send a JSON payload from the scripting interface. |
Ok, then there's a mistake in this article. Sample code under the "Sending Remote Notifications" section assumes that there will be an NSNumber. |
Alright, you should raise that with the @objcio folks. |
@intrigua How did you manage to send a JSON payload with push notifications? I am trying to send standard json as a payload from command line, but getting an exception parsing a JSON. @mattt Any help would be much appreciate. |
@jayesh15111988 why not just convert the JSON payload to NSNumber or Int on the client and not worry about whether the JSON payload represents the number as a string or integer? |
@jdraths My question was not about data type of JSON payload integer vs string. I was just curious to find out how to send JSON data as push payload through Houston. |
@jayesh15111988 use -P to send a json payload per this code.
|
When I send a notification like this
payload's
credits:
value is delivered as instance of NSString but not a NSNumberThe text was updated successfully, but these errors were encountered: