@imatis/react-native-notifications 4.1.2-imatis.15 → 4.1.2-imatis.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,4 +14,15 @@
14
14
  <natures>
15
15
  <nature>org.eclipse.buildship.core.gradleprojectnature</nature>
16
16
  </natures>
17
+ <filteredResources>
18
+ <filter>
19
+ <id>1643077747355</id>
20
+ <name></name>
21
+ <type>30</type>
22
+ <matcher>
23
+ <id>org.eclipse.core.resources.regexFilterMatcher</id>
24
+ <arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
25
+ </matcher>
26
+ </filter>
27
+ </filteredResources>
17
28
  </projectDescription>
@@ -1,2 +1,13 @@
1
+ arguments=
2
+ auto.sync=false
3
+ build.scans.enabled=false
4
+ connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
1
5
  connection.project.dir=
2
6
  eclipse.preferences.version=1
7
+ gradle.user.home=
8
+ java.home=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
9
+ jvm.arguments=
10
+ offline.mode=false
11
+ override.workspace.settings=true
12
+ show.console.view=true
13
+ show.executions.view=true
@@ -11,7 +11,8 @@
11
11
  <service android:name=".core.ProxyService"/>
12
12
 
13
13
  <service
14
- android:name=".fcm.FcmInstanceIdListenerService">
14
+ android:name=".fcm.FcmInstanceIdListenerService"
15
+ android:exported="true">
15
16
  <intent-filter>
16
17
  <action android:name="com.google.firebase.MESSAGING_EVENT" />
17
18
  <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
@@ -71,11 +71,14 @@ public class PushNotification implements IPushNotification {
71
71
  }
72
72
 
73
73
  @Override
74
- public void onReceived() throws InvalidNotificationException {
75
- if (!mAppLifecycleFacade.isAppVisible()) {
76
- notifyReceivedBackgroundToJS();
74
+ public void onReceived() {
75
+ ReactContext reactContext = mAppLifecycleFacade.getRunningReactContext();
76
+ boolean hasActiveCatalystInstance = reactContext != null && reactContext.hasActiveCatalystInstance();
77
+ if (!mAppLifecycleFacade.isAppVisible() || !hasActiveCatalystInstance) {
77
78
  postNotification(null);
78
- } else {
79
+ notifyReceivedBackgroundToJS();
80
+ }
81
+ if (hasActiveCatalystInstance) {
79
82
  notifyReceivedToJS();
80
83
  }
81
84
  }
@@ -186,7 +189,8 @@ public class PushNotification implements IPushNotification {
186
189
  .setContentIntent(intent)
187
190
  .setDefaults(Notification.DEFAULT_VIBRATE)
188
191
  .setAutoCancel(true)
189
- .setPriority(Notification.PRIORITY_HIGH);
192
+ .setPriority(Notification.PRIORITY_HIGH)
193
+ .setOngoing(mNotificationProps.getOngoing());
190
194
 
191
195
  if (soundUri != null) {
192
196
  notification.setSound(soundUri);
@@ -54,6 +54,10 @@ public class PushNotificationProps {
54
54
  return 0.0;
55
55
  }
56
56
 
57
+ public Boolean getOngoing() {
58
+ return mBundle.getBoolean("ongoing");
59
+ }
60
+
57
61
  @Override
58
62
  public String toString() {
59
63
  StringBuilder sb = new StringBuilder(1024);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imatis/react-native-notifications",
3
- "version": "4.1.2-imatis.15",
3
+ "version": "4.1.2-imatis.19",
4
4
  "description": "Advanced Push Notifications (Silent, interactive notifications) for iOS & Android",
5
5
  "author": "Lidan Hifi <lidan.hifi@gmail.com>",
6
6
  "license": "MIT",