Closed avenantsoftware closed 9 years ago
the iconData string is base64 encoded string. You need to convert the image into base64 encoded string and send it witht he showToast API.
You can use the following code to convert UIImage to base 64.
but how does it work?
the image url is converted to a base64 string?
and the tv loads to image from the url
or the whole image is converted to a base64 string?
and the binary of the image is send to the tv in base64 format?
for example here you can convert images to base64:
http://www.askapache.com/online-tools/base64-image-converter/
what is send to the TV to display a message with icon is:
trough websocket is: {"type":"request","id":1,"uri":"ssap://system.notifications/createToast","payload":{"message":"Hello", "iconData": "what goes here" , "iconExtension": "png"}}
and how does the iconData string look like?
what is the correct parameter for iconExtension as I asked before? is it "png", ".png" is it case sensitive? or does it need to be something else?
The reason I'm asking is I use node to send the messages, and found in this sdk that you can also send an image with a message
nevermind found out how it works
@spambus it is not the image url but the image converted to base64 string and is set to "iconData". I have already provided the method to convert a UIImage to base 64 string.
For sample please check https://github.com/ConnectSDK/Connect-SDK-iOS-API-Sampler (https://github.com/ConnectSDK/Connect-SDK-iOS-API-Sampler/blob/master/ConnectSDKSampler/Content/AppsViewController.m)
@spambus thats great
Thanx
how can you send a toast message including an icon image?
this part:
the iconData string, can this be from an external URL source?
or do the images need to be located on the TV's internal storage?
and the iconExtension string is for setting the image extension like: "png" or ".png" or "PNG"?
what is the correct way?
and what image extensions are supported? png? jpg? gif?
I tried a lot of options but non work...