Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

Commit 2b2c69e

Browse files
author
Boris Tacyniak
authored
Merge pull request #2096 from Abhishek12345679/master
Fixed further markdown inconsistencies
2 parents fcc229d + e9f7605 commit 2b2c69e

File tree

1 file changed

+44
-14
lines changed

1 file changed

+44
-14
lines changed

README.md

Lines changed: 44 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,15 @@ Changelog is available from version 3.1.3 here: [Changelog](https://github.com/z
2424

2525
### NPM
2626

27-
`npm install --save react-native-push-notification`
27+
```
28+
npm install --save react-native-push-notification
29+
```
2830

2931
### Yarn
3032

31-
`yarn add react-native-push-notification`
33+
```
34+
yarn add react-native-push-notification
35+
```
3236

3337
**NOTE: If you target iOS you also need to follow the [installation instructions for PushNotificationIOS](https://github.com/react-native-community/react-native-push-notification-ios) since this package depends on it.**
3438

@@ -293,7 +297,9 @@ Notification object example:
293297

294298
## Local Notifications
295299

296-
`PushNotification.localNotification(details: Object)`
300+
```js
301+
PushNotification.localNotification(details: Object)
302+
```
297303

298304
EXAMPLE:
299305

@@ -353,7 +359,9 @@ PushNotification.localNotification({
353359

354360
## Scheduled Notifications
355361

356-
`PushNotification.localNotificationSchedule(details: Object)`
362+
```js
363+
PushNotification.localNotificationSchedule(details: Object)
364+
```
357365

358366
EXAMPLE:
359367

@@ -371,7 +379,9 @@ PushNotification.localNotificationSchedule({
371379

372380
## Get the initial notification
373381

374-
`PushNotification.popInitialNotification(callback)`
382+
```js
383+
PushNotification.popInitialNotification(callback)
384+
```
375385

376386
EXAMPLE:
377387

@@ -577,19 +587,24 @@ Returns an array of local scheduled notification objects containing:
577587

578588
## Abandon Permissions
579589

580-
`PushNotification.abandonPermissions()` Revokes the current token and unregister for all remote notifications received via APNS or FCM.
590+
```js
591+
PushNotification.abandonPermissions()
592+
```
593+
Revokes the current token and unregister for all remote notifications received via APNS or FCM.
581594

582595
## Notification priority
583596

584597
(optional) Specify `priority` to set priority of notification. Default value: "high"
585598

586599
Available options:
587600

601+
```
588602
"max" = NotficationCompat.PRIORITY_MAX\
589603
"high" = NotficationCompat.PRIORITY_HIGH\
590604
"low" = NotficationCompat.PRIORITY_LOW\
591605
"min" = NotficationCompat.PRIORITY_MIN\
592606
"default" = NotficationCompat.PRIORITY_DEFAULT
607+
```
593608

594609
More information: https://developer.android.com/reference/android/app/Notification.html#PRIORITY_DEFAULT
595610

@@ -599,10 +614,11 @@ More information: https://developer.android.com/reference/android/app/Notificati
599614

600615
Available options:
601616

617+
```
602618
"private" = NotficationCompat.VISIBILITY_PRIVATE\
603619
"public" = NotficationCompat.VISIBILITY_PUBLIC\
604620
"secret" = NotficationCompat.VISIBILITY_SECRET
605-
621+
```
606622
More information: https://developer.android.com/reference/android/app/Notification.html#VISIBILITY_PRIVATE
607623

608624
## Notification importance
@@ -611,13 +627,14 @@ More information: https://developer.android.com/reference/android/app/Notificati
611627
Constants available on the `Importance` object. `import PushNotification, {Importance} from 'react-native-push-notification';`
612628

613629
Available options:
614-
630+
```
615631
Importance.DEFAULT = NotificationManager.IMPORTANCE_DEFAULT\
616632
Importance.HIGH = NotificationManager.IMPORTANCE_HIGH\
617633
Importance.LOW = NotificationManager.IMPORTANCE_LOW\
618634
Importance.MIN = NotificationManager.IMPORTANCE_MIN\
619635
Importance.NONE= NotificationManager.IMPORTANCE_NONE\
620636
Importance.UNSPECIFIED = NotificationManager.IMPORTANCE_UNSPECIFIED
637+
```
621638

622639
More information: https://developer.android.com/reference/android/app/NotificationManager#IMPORTANCE_DEFAULT
623640

@@ -715,17 +732,25 @@ Documentation [here](https://github.com/react-native-push-notification-ios/push-
715732

716733
## Set application badge icon
717734

718-
`PushNotification.setApplicationIconBadgeNumber(number: number)`
735+
```js
736+
PushNotification.setApplicationIconBadgeNumber(number: number)
737+
```
719738

720739
Works natively in iOS.
721740

722741
Uses the [ShortcutBadger](https://github.com/leolin310148/ShortcutBadger) on Android, and as such will not work on all Android devices.
723742

724743
## Android Only Methods
725744

726-
`PushNotification.subscribeToTopic(topic: string)` Subscribe to a topic (works only with Firebase)
745+
```js
746+
PushNotification.subscribeToTopic(topic: string)
747+
```
748+
Subscribe to a topic (works only with Firebase)
727749

728-
`PushNotification.unsubscribeFromTopic(topic: string)` Unsubscribe from a topic (works only with Firebase)
750+
```js
751+
PushNotification.unsubscribeFromTopic(topic: string)
752+
```
753+
Unsubscribe from a topic (works only with Firebase)
729754

730755
## Android Custom Notification Handling
731756

@@ -746,7 +771,7 @@ Data payloads of notifications from 3rd party services may not match the format
746771

747772
Custom handlers are added in Application init or `MainActivity.onCreate()` methods:
748773

749-
```
774+
```java
750775
RNPushNotification.IntentHandlers.add(new RNPushNotification.RNIntentHandler() {
751776
@Override
752777
public void onNewIntent(Intent intent) {
@@ -772,7 +797,9 @@ RNPushNotification.IntentHandlers.add(new RNPushNotification.RNIntentHandler() {
772797

773798
## Checking Notification Permissions
774799

775-
`PushNotification.checkPermissions(callback: Function)` Check permissions
800+
```js
801+
PushNotification.checkPermissions(callback: Function) //Check permissions
802+
```
776803

777804
`callback` will be invoked with a `permissions` object:
778805

@@ -782,4 +809,7 @@ RNPushNotification.IntentHandlers.add(new RNPushNotification.RNIntentHandler() {
782809

783810
## iOS Only Methods
784811

785-
`PushNotification.getApplicationIconBadgeNumber(callback: Function)` Get badge number
812+
```js
813+
PushNotification.getApplicationIconBadgeNumber(callback: Function) //Get badge number
814+
```
815+

0 commit comments

Comments
 (0)