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

Collection of recent PRs #1002

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9b419f2
Removing extraneous files because they are not really used in a modul…
rhdeck Aug 13, 2018
ed8b03b
Convert old-school compile directives to implementation
rhdeck Aug 13, 2018
173ef86
Adding support for receiving a new token from listener for security u…
rhdeck Aug 13, 2018
6caf1c0
Switching to new Firebase task approach for getting instance tokens
rhdeck Aug 13, 2018
d06ede0
Moving manifest requirements into the module
rhdeck Aug 13, 2018
01a2574
Adding support for RNPM prelink and plugin to automate the addition o…
rhdeck Aug 13, 2018
d0a4018
Adding peerDependency of RNUG
rhdeck Aug 15, 2018
9d34168
Properly handle default values of metadata
maxkomarychev Oct 29, 2018
6d4d73c
Improve the docs around specifying notification_color
robwalkerco Nov 23, 2018
0ad7b12
fix fcm isForeground
zhangjunhou Nov 30, 2018
6cf060a
[Android] Allow to set the notification to executes on idle
Dec 7, 2018
1c62f5d
Updated gradle configuration
hussainahmad Dec 14, 2018
7bf73ed
Updating to use google services 4.0.2 which does not have nullnull pr…
rhdeck Dec 16, 2018
c4fcb64
Correct android colors.xml path
robwalkerco Dec 18, 2018
87a5b65
Corrected colors.xml path again
robwalkerco Dec 19, 2018
98e4e4d
Updating core
rhdeck Jan 13, 2019
a2260c9
3.2.0
rhdeck Jan 13, 2019
6934e6f
...and back to using firebase messaging
rhdeck Jan 13, 2019
91af67c
update broken link to docs
schumannd Feb 4, 2019
cdafdab
PR #836: Merge remote-tracking branch 'rhdeck/master'
Feb 15, 2019
548c4d1
PR #995: Merge remote-tracking branch 'schumannd/master'
Feb 15, 2019
f7e3f5e
PR #963: Merge remote-tracking branch 'hussainahmad/patch-1'
Feb 15, 2019
c329124
PR #959: Merge remote-tracking branch 'hshiraiwa/feat/allow-while-idle'
Feb 15, 2019
85d593f
PR #954: Merge remote-tracking branch 'zhangjunhou/master'
Feb 15, 2019
359d350
PR #947: Merge remote-tracking branch 'robwalkerco/patch-1'
Feb 15, 2019
e7448e3
PR #926: Merge remote-tracking branch 'maxkomarychev/default-channel-…
Feb 15, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ In your `AndroidManifest.xml`
android:value="YOUR NOTIFICATION CHANNEL DESCRIPTION"/>
<!-- Change the resource name to your App's accent color - or any other color you want -->
<meta-data android:name="com.dieam.reactnativepushnotification.notification_color"
android:resource="@android:color/white"/>
android:resource="@color/white"/> <!-- or @android:color/{name} to use a standard color -->

<!-- < Only if you're using GCM or localNotificationSchedule() > -->
<receiver
Expand Down Expand Up @@ -122,20 +122,21 @@ In your `AndroidManifest.xml`

```

If not using a built in Android color (`@android:color/{name}`) for the `notification_color` `meta-data` item.
In `android/app/src/main/res/values/colors.xml` (Create the file if it doesn't exist).
```xml
<resources>
<color name="white">#FFF</color>
</resources>
```

In `android/settings.gradle`
```gradle
...
include ':react-native-push-notification'
project(':react-native-push-notification').projectDir = file('../node_modules/react-native-push-notification/android')
```

In `android/app/src/res/values/colors.xml` (Create the file if it doesn't exist).
```xml
<resources>
<color name="white">#FFF</color>
</resources>
```

Manually register module in `MainApplication.java` (if you did not use `react-native link`):

```java
Expand Down Expand Up @@ -249,6 +250,7 @@ PushNotification.localNotification({
priority: "high", // (optional) set notification priority, default: high
visibility: "private", // (optional) set notification visibility, default: private
importance: "high", // (optional) set notification importance, default: high
allowWhileIdle: false, // (optional) set notification to work while on doze, default: false

/* iOS only properties */
alertAction: // (optional) default: view
Expand Down Expand Up @@ -348,6 +350,17 @@ Available options:

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

## Notification while idle ##

(optional) Specify `allowWhileIdle` to set if the notification should be allowed to execute even when the system is on low-power idle modes.

On Android 6.0 (API level 23) and forward, the Doze was introduced to reduce battery consumption when the device is unused for long periods of time. But while on Doze the AlarmManager alarms (used to show scheduled notifications) are deferred to the next maintenance window. This may cause the notification to be delayed while on Doze.

This can significantly impact the power use of the device when idle. So it must only be used when the notification is required to go off on a exact time, for example on a calendar notification.

More information:
https://developer.android.com/training/monitoring-device-state/doze-standby

#### IOS
The `userInfo` parameter for `PushNotification.localNotification` is required for this operation and must contain an `id` parameter. The id supplied will then be used for the cancel operation.
```javascript
Expand Down
14 changes: 7 additions & 7 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ dependencies {
def googlePlayServicesVersion = project.hasProperty('googlePlayServicesVersion') ? project.googlePlayServicesVersion : DEFAULT_GOOGLE_PLAY_SERVICES_VERSION
def firebaseVersion = project.hasProperty('firebaseVersion') ? project.firebaseVersion : DEFAULT_FIREBASE_MESSAGING_VERSION

compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile "com.android.support:appcompat-v7:$supportLibVersion"
compile 'com.facebook.react:react-native:+'
compile "com.google.android.gms:play-services-gcm:$googlePlayServicesVersion"
compile 'me.leolin:ShortcutBadger:1.1.8@aar'
compile "com.google.firebase:firebase-messaging:$firebaseVersion"
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
implementation "com.android.support:appcompat-v7:$supportLibVersion"
implementation 'com.facebook.react:react-native:+'
implementation "com.google.android.gms:play-services-gcm:$googlePlayServicesVersion"
implementation 'me.leolin:ShortcutBadger:1.1.8@aar'
implementation "com.google.firebase:firebase-messaging:$firebaseVersion"
}
17 changes: 0 additions & 17 deletions android/proguard-rules.pro

This file was deleted.

120 changes: 0 additions & 120 deletions android/react-native-notifications.iml

This file was deleted.

Loading