-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RCTPushNotificationManager does not set alertTitle in UILocalNotification #14699
Labels
Good first issue
Interested in collaborating? Take a stab at fixing one of these issues.
Resolution: Locked
This issue was locked by the bot.
Comments
Can you send a PR? |
hramos
added
the
Good first issue
Interested in collaborating? Take a stab at fixing one of these issues.
label
Aug 4, 2017
Tagging as a Good First Task. A solution is provided in the original post above. People can get familiar with the contribution process by applying the fix in a PR. |
@hramos I'm ready to create a PR as I'm new to the contribution process and is essential for me to get to know the process. |
facebook-github-bot
pushed a commit
that referenced
this issue
Aug 7, 2017
Summary: Currently, since the alertTitle is not set in UILocalNotification, the notification displays just the notification body with no title. This commit sets the alertTitle for local notifications. Issue: #14699 - In a sample RN app, created a component and added the following code to componentDidMount(): `PushNotificationIOS.scheduleLocalNotification({ fireDate: new Date(Date.now() + (30 * 1000)).toISOString(), alertTitle: 'Incoming Message', alertBody: 'Test message', soundName: 'default' })` - On running the app, the notification appears with both body and title once the component is mounted. ![settitle_fix](https://user-images.githubusercontent.com/4279549/28995873-f62c9866-7a11-11e7-9f29-95dba50ef40b.jpg) Closes #15381 Differential Revision: D5572606 Pulled By: shergin fbshipit-source-id: ce5d98ed595eedf51ac3da7dfd94de52cf80be3d
Great work on this guys, thanks! |
This issue has been moved to react-native-push-notification/ios#2. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Good first issue
Interested in collaborating? Take a stab at fixing one of these issues.
Resolution: Locked
This issue was locked by the bot.
Description
Setting the alertTitle property on PushNotificationIOS.scheduleLocalNotification does not display the title in the notification.
With alertTitle set:
Without:
Reproduction Steps
Use the below code to reproduce.
Sample Code
PushNotificationIOS.scheduleLocalNotification({ fireDate: new Date(Date.now() + (30 * 1000)).toISOString(), alertTitle: 'Incoming Message', alertBody: 'This is my message, please read it for good fortune.', soundName: 'default', applicationIconBadgeNumber: 1, userInfo: { id: 11 } })
Solution
Adding the following line in RCTPushNotificationManager.m (54) fixes the issue:
notification.alertTitle = [RCTConvert NSString:details[@"alertTitle"]];
Additional Information
The text was updated successfully, but these errors were encountered: