strongloop / loopback-component-push

Push notification component for LoopBack.
http://loopback.io/doc/en/lb2/Push-notifications.html
Other
96 stars 95 forks source link

Fix missing title on iOS notifications #167

Closed zbarbuto closed 6 years ago

zbarbuto commented 6 years ago

Description

Expects a 'title' property https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/PayloadKeyReference.html#//apple_ref/doc/uid/TP40008194-CH17-SW5

The loopback push documentation hints to a messageFrom property which would show the 'From' on a push notification.

http://loopback.io/doc/en/lb3/Push-notifications.html#send-push-notifications

This change allows the 'messageFrom' to populate the 'title' field allowing notifications that render as:

<Message From>
<Message>

Which is currently supported by the GCM provider:

https://github.com/strongloop/loopback-component-push/blob/master/lib/providers/gcm.js#L93

Also adds missing check for the 'body' property which should have been tested previously.

Checklist

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

zbarbuto commented 6 years ago

Not stale - still waiting for review

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

zbarbuto commented 6 years ago

Not stale - still waiting for review

dhmlau commented 6 years ago

@raymondfeng , could you please take a look at this PR? Thanks.

zbarbuto commented 6 years ago

Thanks for merging - this one was exclusive to iOS and shouldn't affect Android.