Skip to content

Commit

Permalink
Merge pull request #613 from damir-sirola/patch-1
Browse files Browse the repository at this point in the history
Add support for notification alert title on iOS
  • Loading branch information
zo0r authored Mar 7, 2018
2 parents 81744d6 + 896cf18 commit 7f0344b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ PushNotification.localNotification({
userInfo: // (optional) default: null (object containing additional notification data)

/* iOS and Android properties */
title: "My Notification Title", // (optional, for iOS this is only used in apple watch, the title will be the app name on other iOS devices)
title: "My Notification Title", // (optional)
message: "My Notification Message", // (required)
playSound: false, // (optional) default: true
soundName: 'default', // (optional) Sound to play when the notification is shown. Value of 'default' plays the default sound. It can be set to a custom sound such as 'android.resource://com.xyz/raw/my_sound'. It will look for the 'my_sound' audio file in 'res/raw' directory and play it. default: 'default' (default sound is played)
Expand Down
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ Notifications.unregister = function() {
/**
* Local Notifications
* @param {Object} details
* @param {String} details.title - The title displayed in the notification alert.
* @param {String} details.message - The message displayed in the notification alert.
* @param {String} details.title - ANDROID ONLY: The title displayed in the notification alert.
* @param {String} details.ticker - ANDROID ONLY: The ticker displayed in the status bar.
* @param {Object} details.userInfo - iOS ONLY: The userInfo used in the notification alert.
*/
Expand Down Expand Up @@ -163,6 +163,7 @@ Notifications.localNotificationSchedule = function(details: Object) {

const iosDetails = {
fireDate: details.date.toISOString(),
alertTitle: details.title,
alertBody: details.message,
soundName: soundName,
userInfo: details.userInfo,
Expand Down

0 comments on commit 7f0344b

Please sign in to comment.