appfeel / node-pushnotifications

Push notifications for GCM, APNS, MPNS, AMZ (automatic detection from device token)
MIT License
534 stars 126 forks source link

Wrong message on iOS Push Notification #8

Closed igordeoliveirasa closed 7 years ago

igordeoliveirasa commented 7 years ago

You are passing title instead of message, when iOS Token is detected. This way, whenever I send a notification like: {title:"My App's name", message:"Information message"}, the device receives a notification alert like:

title: My App's name message: My App's name

phoxoey commented 7 years ago

I'm getting the same behavior.

phoxoey commented 7 years ago

After looking at the code I was able to fix the issue. On line: 123 in push-notifications.js change "messageAPN.alert = data.title;" to "messageAPN.alert = {title: data.title, body: data.message};". I also commented out line:124 and 125.

appfeel commented 7 years ago

Fixed in https://github.com/appfeel/node-pushnotifications/commit/5090a96dee49d7bfb9dddb91d5c8bef1d1adb25b