Hi
I have Everything working fine sending notifications with dynamic data,
but I seem not get it right sending a Picture, or sending the weblink of a Picture I want to be displayed in the
pushsafer notifications?
What am I getting wrong here?
I use http.post and it works all fine, but I don't get the Picture in my iPhone?
CODE
====
Message += String(F("&p=data:image/jpeg;base64,"));
Message += rbase64.encode(F("weblink of my Picture.jpeg"));
Weblink is made of http: followed by //iot.mydomain.se/filename with .jpeg in the end
(Hope you get it since I am not allowed rtio send the correct weblink
Above is part of the message sent, but my iPhone only shows a very small 2mm x 2mm rectangle
What am I doing wrong here?
Appreciate all the help !
Best regards
Thorbjörn
How to send a Picture using Arduino and ESP8266
- admin
- Site Admin
- Posts: 944
- Joined: 1. Dec 2014, 12:41
- Location: Germany
Re: How to send a Picture using Arduino and ESP8266
Hello,
you have to load the image and base64 encode them.
You can use this library: https://github.com/adamvr/arduino-base64
The encodes image string you have to pass throught the pushsafer parameter p
Hope this helps
Kevin
you have to load the image and base64 encode them.
You can use this library: https://github.com/adamvr/arduino-base64
The encodes image string you have to pass throught the pushsafer parameter p
Hope this helps
Kevin
Pushsafer DE: Dir gefällt Service und Support! Dann freuen wir uns auf deine Bewertung!
Pushsafer EN: You like Service and Support! Then we look forward to your review!
Pushsafer.com Website - iOS - Android - Windows 10
Pushsafer EN: You like Service and Support! Then we look forward to your review!
Pushsafer.com Website - iOS - Android - Windows 10
Re: How to send a Picture using Arduino and ESP8266
Hi again
so you mean the jpeg Picture file itself needs to be part of message sent to Pushsafer in base64 format?
I thought only the web link reference needed to be included in base64 format
and that Pushsafer APP retrieved the jpeg from the www location submitted.
or am I missing something here?
Thanks for your prompt reply
Thorbjörn
so you mean the jpeg Picture file itself needs to be part of message sent to Pushsafer in base64 format?
I thought only the web link reference needed to be included in base64 format
and that Pushsafer APP retrieved the jpeg from the www location submitted.
or am I missing something here?
Thanks for your prompt reply
Thorbjörn
- admin
- Site Admin
- Posts: 944
- Joined: 1. Dec 2014, 12:41
- Location: Germany
Re: How to send a Picture using Arduino and ESP8266
Correct, you have to load the image, encode the binary with base64, the string you get, you have to pass throught the parameter p to pushsafer. Weblinks are not possible. See the API description here: https://www.pushsafer.com/en/pushapitobbeg wrote:Hi again
so you mean the jpeg Picture file itself needs to be part of message sent to Pushsafer in base64 format?
I thought only the web link reference needed to be included in base64 format
and that Pushsafer APP retrieved the jpeg from the www location submitted.
or am I missing something here?
Thanks for your prompt reply
Thorbjörn
Regards
Kevin
Pushsafer DE: Dir gefällt Service und Support! Dann freuen wir uns auf deine Bewertung!
Pushsafer EN: You like Service and Support! Then we look forward to your review!
Pushsafer.com Website - iOS - Android - Windows 10
Pushsafer EN: You like Service and Support! Then we look forward to your review!
Pushsafer.com Website - iOS - Android - Windows 10
Who is online
Users browsing this forum: Bogdanyjg and 198 guests