Skip to content

Commit 3d6f5a2

Browse files
authored
chore: add example for getTitle method (#158)
1 parent 34b4b28 commit 3d6f5a2

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

example/App.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export const App = () => {
7777
alert: 'Sample notification',
7878
badge: '+1',
7979
sound: 'default',
80+
alertTitle: 'title',
8081
category: 'REACT_NATIVE',
8182
'content-available': 1,
8283
},
@@ -121,7 +122,9 @@ export const App = () => {
121122
};
122123

123124
const onRemoteNotification = (notification) => {
124-
const result = `Message: ${notification.getMessage()};\n
125+
const result = `
126+
Title: ${notification.getTitle()};\n
127+
Message: ${notification.getMessage()};\n
125128
badge: ${notification.getBadgeCount()};\n
126129
sound: ${notification.getSound()};\n
127130
category: ${notification.getCategory()};\n
@@ -138,7 +141,8 @@ export const App = () => {
138141
const onLocalNotification = (notification) => {
139142
Alert.alert(
140143
'Local Notification Received',
141-
'Alert message: ' + notification.getMessage(),
144+
`Alert title: ${notification.getTitle()},
145+
'Alert message: ${notification.getMessage()}`,
142146
[
143147
{
144148
text: 'Dismiss',

example/ios/Podfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ PODS:
292292
- React-cxxreact (= 0.62.2)
293293
- React-jsi (= 0.62.2)
294294
- ReactCommon/callinvoker (= 0.62.2)
295-
- RNCPushNotificationIOS (1.2.2):
295+
- RNCPushNotificationIOS (1.3.0):
296296
- React
297297
- Yoga (1.14.0)
298298
- YogaKit (1.18.1):
@@ -453,10 +453,10 @@ SPEC CHECKSUMS:
453453
React-RCTText: fae545b10cfdb3d247c36c56f61a94cfd6dba41d
454454
React-RCTVibration: 4356114dbcba4ce66991096e51a66e61eda51256
455455
ReactCommon: ed4e11d27609d571e7eee8b65548efc191116eb3
456-
RNCPushNotificationIOS: 4c97a36dbec42dba411cc35e6dac25e34a805fde
456+
RNCPushNotificationIOS: d5fd66aed4e03c6491ca0c6111a03d4f6455ff6c
457457
Yoga: 3ebccbdd559724312790e7742142d062476b698e
458458
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
459459

460460
PODFILE CHECKSUM: fe0bcbd52826c4d7c0dd4aa1c136e663b1ff0615
461461

462-
COCOAPODS: 1.8.4
462+
COCOAPODS: 1.9.1

0 commit comments

Comments
 (0)