Enabling Custom Sound with Push Notifications using Corona SDK

0 votes

Hi,

Do you support sound with push notifications for Corona SDK? I was looking at the "Send Custom Push Message To User In Key Value Or JSON Format" command under Corona which I think might work but it says "Coming soon". Is there a way we can attach our custom sounds with push notifications for Corona?

Thanks,

Scott

 

 

asked Nov 5, 2016 in Corona by gsglawson (10 points)

1 Answer

0 votes

Hi Scott,

 

At the time of sending the message, you can send JSON string in place of message and parse it accordingly on the client side. Please have a look at this link for the code snippet of sendPushMessageToUser and let me know if you need any help from my side.  

 

Regards,

Himanshu Sharma

answered Nov 7, 2016 by hs00105 (2,005 points)
Hi Himanshu,

Could you please elaborate how a json string could be parsed before actually showing the notification to a user. I got the notification working on iOS just by sending a json table containing alert and sound parameters, from app42 console.
Here's the table that I sent on iOS- {"alert":"message","sound":"notification.mp3"}
On iOS, I receive a notification with the sound I specify in the table and the text "message" written on it, just as expected.
When I do the same for Android a blank notification pops up but with no text and default sound. It seems the alert, badge and sound parameters work only on iOS as far as push notifications are concerned while for local notifications corona handles these information accordingly and everything works perfectly on both platforms. If you could elaborate the parsing step that you mentioned above in a little more detail as to where this parsing must be done it would be of great help!

Thanks,

Karun
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...