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

Commit e9f7605

Browse files
FIxed further markdown inconsistencies
`something` to ```js something ```
1 parent 6a81fba commit e9f7605

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

@@ -352,7 +358,9 @@ PushNotification.localNotification({
352358

353359
## Scheduled Notifications
354360

355-
`PushNotification.localNotificationSchedule(details: Object)`
361+
```js
362+
PushNotification.localNotificationSchedule(details: Object)
363+
```
356364

357365
EXAMPLE:
358366

@@ -370,7 +378,9 @@ PushNotification.localNotificationSchedule({
370378

371379
## Get the initial notification
372380

373-
`PushNotification.popInitialNotification(callback)`
381+
```js
382+
PushNotification.popInitialNotification(callback)
383+
```
374384

375385
EXAMPLE:
376386

@@ -578,19 +588,24 @@ Returns an array of local scheduled notification objects containing:
578588

579589
## Abandon Permissions
580590

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

583596
## Notification priority
584597

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

587600
Available options:
588601

602+
```
589603
"max" = NotficationCompat.PRIORITY_MAX\
590604
"high" = NotficationCompat.PRIORITY_HIGH\
591605
"low" = NotficationCompat.PRIORITY_LOW\
592606
"min" = NotficationCompat.PRIORITY_MIN\
593607
"default" = NotficationCompat.PRIORITY_DEFAULT
608+
```
594609

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

@@ -600,10 +615,11 @@ More information: https://developer.android.com/reference/android/app/Notificati
600615

601616
Available options:
602617

618+
```
603619
"private" = NotficationCompat.VISIBILITY_PRIVATE\
604620
"public" = NotficationCompat.VISIBILITY_PUBLIC\
605621
"secret" = NotficationCompat.VISIBILITY_SECRET
606-
622+
```
607623
More information: https://developer.android.com/reference/android/app/Notification.html#VISIBILITY_PRIVATE
608624

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

614630
Available options:
615-
631+
```
616632
Importance.DEFAULT = NotificationManager.IMPORTANCE_DEFAULT\
617633
Importance.HIGH = NotificationManager.IMPORTANCE_HIGH\
618634
Importance.LOW = NotificationManager.IMPORTANCE_LOW\
619635
Importance.MIN = NotificationManager.IMPORTANCE_MIN\
620636
Importance.NONE= NotificationManager.IMPORTANCE_NONE\
621637
Importance.UNSPECIFIED = NotificationManager.IMPORTANCE_UNSPECIFIED
638+
```
622639

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

@@ -713,17 +730,25 @@ Documentation [here](https://github.com/react-native-push-notification-ios/push-
713730

714731
## Set application badge icon
715732

716-
`PushNotification.setApplicationIconBadgeNumber(number: number)`
733+
```js
734+
PushNotification.setApplicationIconBadgeNumber(number: number)
735+
```
717736

718737
Works natively in iOS.
719738

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

722741
## Android Only Methods
723742

724-
`PushNotification.subscribeToTopic(topic: string)` Subscribe to a topic (works only with Firebase)
743+
```js
744+
PushNotification.subscribeToTopic(topic: string)
745+
```
746+
Subscribe to a topic (works only with Firebase)
725747

726-
`PushNotification.unsubscribeFromTopic(topic: string)` Unsubscribe from a topic (works only with Firebase)
748+
```js
749+
PushNotification.unsubscribeFromTopic(topic: string)
750+
```
751+
Unsubscribe from a topic (works only with Firebase)
727752

728753
## Android Custom Notification Handling
729754

@@ -744,7 +769,7 @@ Data payloads of notifications from 3rd party services may not match the format
744769

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

747-
```
772+
```java
748773
RNPushNotification.IntentHandlers.add(new RNPushNotification.RNIntentHandler() {
749774
@Override
750775
public void onNewIntent(Intent intent) {
@@ -770,7 +795,9 @@ RNPushNotification.IntentHandlers.add(new RNPushNotification.RNIntentHandler() {
770795

771796
## Checking Notification Permissions
772797

773-
`PushNotification.checkPermissions(callback: Function)` Check permissions
798+
```js
799+
PushNotification.checkPermissions(callback: Function) //Check permissions
800+
```
774801

775802
`callback` will be invoked with a `permissions` object:
776803

@@ -780,4 +807,7 @@ RNPushNotification.IntentHandlers.add(new RNPushNotification.RNIntentHandler() {
780807

781808
## iOS Only Methods
782809

783-
`PushNotification.getApplicationIconBadgeNumber(callback: Function)` Get badge number
810+
```js
811+
PushNotification.getApplicationIconBadgeNumber(callback: Function) //Get badge number
812+
```
813+

0 commit comments

Comments
 (0)