expo-notifications 0.32.9 → 0.32.10
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.
- package/CHANGELOG.md +8 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/notifications/NotificationsPackage.java +1 -1
- package/android/src/main/java/expo/modules/notifications/notifications/NotificationManager.java +1 -1
- package/android/src/main/java/expo/modules/notifications/service/NotificationForwarderActivity.kt +2 -2
- package/android/src/main/java/expo/modules/notifications/service/NotificationsService.kt +22 -7
- package/android/src/main/java/expo/modules/notifications/service/delegates/ExpoHandlingDelegate.kt +5 -7
- package/android/src/main/java/expo/modules/notifications/service/delegates/ExpoNotificationLifecycleListener.java +13 -7
- package/android/src/main/java/expo/modules/notifications/service/delegates/SharedPreferencesNotificationCategoriesStore.kt +4 -3
- package/build/useLastNotificationResponse.d.ts.map +1 -1
- package/build/useLastNotificationResponse.js +3 -8
- package/build/useLastNotificationResponse.js.map +1 -1
- package/expo-module.config.json +1 -1
- package/ios/EXNotifications/Notifications/Categories/CategoriesModule.swift +44 -22
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{0.32.9/expo.modules.notifications-0.32.9-sources.jar → 0.32.10/expo.modules.notifications-0.32.10-sources.jar} +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.10/expo.modules.notifications-0.32.10-sources.jar.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.10/expo.modules.notifications-0.32.10-sources.jar.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.10/expo.modules.notifications-0.32.10-sources.jar.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.10/expo.modules.notifications-0.32.10-sources.jar.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.10/expo.modules.notifications-0.32.10.aar +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.10/expo.modules.notifications-0.32.10.aar.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.10/expo.modules.notifications-0.32.10.aar.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.10/expo.modules.notifications-0.32.10.aar.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.10/expo.modules.notifications-0.32.10.aar.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{0.32.9/expo.modules.notifications-0.32.9.module → 0.32.10/expo.modules.notifications-0.32.10.module} +22 -22
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.10/expo.modules.notifications-0.32.10.module.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.10/expo.modules.notifications-0.32.10.module.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.10/expo.modules.notifications-0.32.10.module.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.10/expo.modules.notifications-0.32.10.module.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{0.32.9/expo.modules.notifications-0.32.9.pom → 0.32.10/expo.modules.notifications-0.32.10.pom} +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.10/expo.modules.notifications-0.32.10.pom.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.10/expo.modules.notifications-0.32.10.pom.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.10/expo.modules.notifications-0.32.10.pom.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.10/expo.modules.notifications-0.32.10.pom.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/maven-metadata.xml +4 -4
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/maven-metadata.xml.sha512 +1 -1
- package/package.json +2 -2
- package/src/useLastNotificationResponse.ts +3 -10
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.9/expo.modules.notifications-0.32.9-sources.jar.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.9/expo.modules.notifications-0.32.9-sources.jar.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.9/expo.modules.notifications-0.32.9-sources.jar.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.9/expo.modules.notifications-0.32.9-sources.jar.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.9/expo.modules.notifications-0.32.9.aar +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.9/expo.modules.notifications-0.32.9.aar.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.9/expo.modules.notifications-0.32.9.aar.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.9/expo.modules.notifications-0.32.9.aar.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.9/expo.modules.notifications-0.32.9.aar.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.9/expo.modules.notifications-0.32.9.module.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.9/expo.modules.notifications-0.32.9.module.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.9/expo.modules.notifications-0.32.9.module.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.9/expo.modules.notifications-0.32.9.module.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.9/expo.modules.notifications-0.32.9.pom.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.9/expo.modules.notifications-0.32.9.pom.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.9/expo.modules.notifications-0.32.9.pom.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.9/expo.modules.notifications-0.32.9.pom.sha512 +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,14 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 0.32.10 — 2025-09-04
|
|
14
|
+
|
|
15
|
+
### 🐛 Bug fixes
|
|
16
|
+
|
|
17
|
+
- [android] do not send faulty duplicate `TextInputNotificationResponse` events ([#39356](https://github.com/expo/expo/pull/39356) by [@vonovak](https://github.com/vonovak))
|
|
18
|
+
- fix text response not present on some Android versions ([#39350](https://github.com/expo/expo/pull/39350) by [@vonovak](https://github.com/vonovak))
|
|
19
|
+
- [ios] fix race condition in `setNotificationCategoryAsync` ([#39306](https://github.com/expo/expo/pull/39306) by [@vonovak](https://github.com/vonovak))
|
|
20
|
+
|
|
13
21
|
## 0.32.9 — 2025-09-03
|
|
14
22
|
|
|
15
23
|
_This version does not introduce any user-facing changes._
|
package/android/build.gradle
CHANGED
|
@@ -5,13 +5,13 @@ plugins {
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
group = 'host.exp.exponent'
|
|
8
|
-
version = '0.32.
|
|
8
|
+
version = '0.32.10'
|
|
9
9
|
|
|
10
10
|
android {
|
|
11
11
|
namespace "expo.modules.notifications"
|
|
12
12
|
defaultConfig {
|
|
13
13
|
versionCode 21
|
|
14
|
-
versionName '0.32.
|
|
14
|
+
versionName '0.32.10'
|
|
15
15
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -40,7 +40,7 @@ public class NotificationsPackage extends BasePackage {
|
|
|
40
40
|
|
|
41
41
|
@Override
|
|
42
42
|
public List<ReactActivityLifecycleListener> createReactActivityLifecycleListeners(Context activityContext) {
|
|
43
|
-
return Collections.singletonList(new ExpoNotificationLifecycleListener(
|
|
43
|
+
return Collections.singletonList(new ExpoNotificationLifecycleListener(mNotificationManager));
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|
package/android/src/main/java/expo/modules/notifications/notifications/NotificationManager.java
CHANGED
|
@@ -138,7 +138,7 @@ public class NotificationManager implements SingletonModule {
|
|
|
138
138
|
// OR a background state (ExpoNotificationLifecycleListener::onNewIntent)
|
|
139
139
|
|
|
140
140
|
// If we've just come from a background state, we'll have listeners set up
|
|
141
|
-
// pass on the notification to them
|
|
141
|
+
// - pass on the notification to them
|
|
142
142
|
if (!mListenerReferenceMap.isEmpty()) {
|
|
143
143
|
for (WeakReference<NotificationListener> listenerReference : mListenerReferenceMap.values()) {
|
|
144
144
|
NotificationListener listener = listenerReference.get();
|
package/android/src/main/java/expo/modules/notifications/service/NotificationForwarderActivity.kt
CHANGED
|
@@ -15,8 +15,8 @@ class NotificationForwarderActivity : Activity() {
|
|
|
15
15
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
16
16
|
super.onCreate(savedInstanceState)
|
|
17
17
|
val broadcastIntent =
|
|
18
|
-
NotificationsService.createNotificationResponseBroadcastIntent(applicationContext, intent
|
|
19
|
-
val notificationResponse = NotificationsService.getNotificationResponseFromBroadcastIntent(
|
|
18
|
+
NotificationsService.createNotificationResponseBroadcastIntent(applicationContext, intent)
|
|
19
|
+
val notificationResponse = NotificationsService.getNotificationResponseFromBroadcastIntent(intent)
|
|
20
20
|
ExpoHandlingDelegate.openAppToForeground(this, notificationResponse)
|
|
21
21
|
sendBroadcast(broadcastIntent)
|
|
22
22
|
finish()
|
|
@@ -459,8 +459,7 @@ open class NotificationsService : BroadcastReceiver() {
|
|
|
459
459
|
// are not allowed. If the notification wants to open foreground app,
|
|
460
460
|
// we should use the dedicated Activity pendingIntent.
|
|
461
461
|
if (action.opensAppToForeground() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
|
462
|
-
|
|
463
|
-
return ExpoHandlingDelegate.createPendingIntentForOpeningApp(context, intent, notificationResponse)
|
|
462
|
+
return ExpoHandlingDelegate.createPendingIntentForOpeningApp(context, intent)
|
|
464
463
|
}
|
|
465
464
|
|
|
466
465
|
// We're defaulting to the behaviour prior API 31 (mutable) even though Android recommends immutability
|
|
@@ -474,17 +473,24 @@ open class NotificationsService : BroadcastReceiver() {
|
|
|
474
473
|
}
|
|
475
474
|
|
|
476
475
|
/**
|
|
477
|
-
* Recreate an Intent from [createNotificationResponseIntent]
|
|
476
|
+
* Recreate an Intent from [createNotificationResponseIntent] intent
|
|
478
477
|
* for [NotificationForwarderActivity] to send broadcasts
|
|
479
478
|
*/
|
|
480
|
-
fun createNotificationResponseBroadcastIntent(context: Context,
|
|
479
|
+
fun createNotificationResponseBroadcastIntent(context: Context, intent: Intent?): Intent {
|
|
480
|
+
val extras = intent?.extras
|
|
481
481
|
val notification = extras?.getParcelable<Notification>(NOTIFICATION_KEY)
|
|
482
482
|
val action = extras?.getParcelable<NotificationAction>(NOTIFICATION_ACTION_KEY)
|
|
483
483
|
if (notification == null || action == null) {
|
|
484
484
|
throw IllegalArgumentException("notification ($notification) and action ($action) should not be null")
|
|
485
485
|
}
|
|
486
|
-
val
|
|
487
|
-
val
|
|
486
|
+
val textResponse = RemoteInput.getResultsFromIntent(intent)?.getString(USER_TEXT_RESPONSE_KEY)
|
|
487
|
+
val isTextInputResponse = textResponse != null && action is TextInputNotificationAction
|
|
488
|
+
val backgroundAction = if (isTextInputResponse) {
|
|
489
|
+
TextInputNotificationAction(action.identifier, action.title, false, action.placeholder)
|
|
490
|
+
} else {
|
|
491
|
+
NotificationAction(action.identifier, action.title, false)
|
|
492
|
+
}
|
|
493
|
+
val broadcastIntent = Intent(
|
|
488
494
|
NOTIFICATION_EVENT_ACTION,
|
|
489
495
|
getUriBuilder()
|
|
490
496
|
.appendPath(notification.notificationRequest.identifier)
|
|
@@ -498,8 +504,17 @@ open class NotificationsService : BroadcastReceiver() {
|
|
|
498
504
|
intent.putExtra(EVENT_TYPE_KEY, RECEIVE_RESPONSE_TYPE)
|
|
499
505
|
intent.putExtra(NOTIFICATION_KEY, notification)
|
|
500
506
|
intent.putExtra(NOTIFICATION_ACTION_KEY, backgroundAction as Parcelable)
|
|
507
|
+
|
|
508
|
+
// Include the text response in the new intent
|
|
509
|
+
if (isTextInputResponse) {
|
|
510
|
+
val remoteInput = RemoteInput.Builder(USER_TEXT_RESPONSE_KEY).build()
|
|
511
|
+
val remoteInputResults = Bundle().apply {
|
|
512
|
+
putString(USER_TEXT_RESPONSE_KEY, textResponse)
|
|
513
|
+
}
|
|
514
|
+
RemoteInput.addResultsToIntent(arrayOf(remoteInput), intent, remoteInputResults)
|
|
515
|
+
}
|
|
501
516
|
}
|
|
502
|
-
return
|
|
517
|
+
return broadcastIntent
|
|
503
518
|
}
|
|
504
519
|
|
|
505
520
|
fun getNotificationResponseFromBroadcastIntent(intent: Intent): NotificationResponse {
|
package/android/src/main/java/expo/modules/notifications/service/delegates/ExpoHandlingDelegate.kt
CHANGED
|
@@ -47,12 +47,10 @@ class ExpoHandlingDelegate(protected val context: Context) : HandlingDelegate {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
sListenersReferences[listener] = WeakReference(listener)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
responseIterator.remove()
|
|
55
|
-
}
|
|
50
|
+
val responseIterator = sPendingNotificationResponses.iterator()
|
|
51
|
+
while (responseIterator.hasNext()) {
|
|
52
|
+
listener.onNotificationResponseReceived(responseIterator.next())
|
|
53
|
+
responseIterator.remove()
|
|
56
54
|
}
|
|
57
55
|
}
|
|
58
56
|
|
|
@@ -62,7 +60,7 @@ class ExpoHandlingDelegate(protected val context: Context) : HandlingDelegate {
|
|
|
62
60
|
* - the foreground main Activity
|
|
63
61
|
* - the background [NotificationForwarderActivity] Activity that send notification clicked events through broadcast
|
|
64
62
|
*/
|
|
65
|
-
fun createPendingIntentForOpeningApp(context: Context, broadcastIntent: Intent
|
|
63
|
+
fun createPendingIntentForOpeningApp(context: Context, broadcastIntent: Intent): PendingIntent {
|
|
66
64
|
var intentFlags = PendingIntent.FLAG_UPDATE_CURRENT
|
|
67
65
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
|
68
66
|
// The intent may include `RemoteInput` from `TextInputNotificationAction`.
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
package expo.modules.notifications.service.delegates;
|
|
2
2
|
|
|
3
|
+
import static expo.modules.notifications.service.NotificationsService.NOTIFICATION_RESPONSE_KEY;
|
|
4
|
+
import static expo.modules.notifications.service.NotificationsService.TEXT_INPUT_NOTIFICATION_RESPONSE_KEY;
|
|
5
|
+
|
|
3
6
|
import android.app.Activity;
|
|
4
|
-
import android.content.Context;
|
|
5
7
|
import android.content.Intent;
|
|
6
8
|
import android.os.Bundle;
|
|
7
9
|
import android.util.Log;
|
|
@@ -10,11 +12,12 @@ import expo.modules.core.interfaces.ReactActivityLifecycleListener;
|
|
|
10
12
|
import expo.modules.notifications.notifications.NotificationManager;
|
|
11
13
|
import expo.modules.notifications.notifications.debug.DebugLogging;
|
|
12
14
|
|
|
15
|
+
// TODO vonovak consider removing this class entirely for SDK 55, its purpose is unclear
|
|
13
16
|
public class ExpoNotificationLifecycleListener implements ReactActivityLifecycleListener {
|
|
14
17
|
|
|
15
18
|
private NotificationManager mNotificationManager;
|
|
16
19
|
|
|
17
|
-
public ExpoNotificationLifecycleListener(
|
|
20
|
+
public ExpoNotificationLifecycleListener(NotificationManager notificationManager) {
|
|
18
21
|
mNotificationManager = notificationManager;
|
|
19
22
|
}
|
|
20
23
|
|
|
@@ -33,8 +36,9 @@ public class ExpoNotificationLifecycleListener implements ReactActivityLifecycle
|
|
|
33
36
|
if (intent != null) {
|
|
34
37
|
Bundle extras = intent.getExtras();
|
|
35
38
|
if (extras != null) {
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
// only actions that have opensAppToForeground: true are handled here
|
|
40
|
+
if (extras.containsKey(NOTIFICATION_RESPONSE_KEY) || extras.containsKey(TEXT_INPUT_NOTIFICATION_RESPONSE_KEY)) {
|
|
41
|
+
Log.d("ReactNativeJS", "[native] ExpoNotificationLifecycleListener contains an unmarshalled notification response. Skipping.");
|
|
38
42
|
return;
|
|
39
43
|
}
|
|
40
44
|
DebugLogging.logBundle("ExpoNotificationLifeCycleListener.onCreate:", extras);
|
|
@@ -56,9 +60,11 @@ public class ExpoNotificationLifecycleListener implements ReactActivityLifecycle
|
|
|
56
60
|
public boolean onNewIntent(Intent intent) {
|
|
57
61
|
Bundle extras = intent.getExtras();
|
|
58
62
|
if (extras != null) {
|
|
59
|
-
if (extras.containsKey(
|
|
60
|
-
|
|
61
|
-
intent.removeExtra(
|
|
63
|
+
if (extras.containsKey(NOTIFICATION_RESPONSE_KEY) || extras.containsKey(TEXT_INPUT_NOTIFICATION_RESPONSE_KEY)) {
|
|
64
|
+
intent.removeExtra(NOTIFICATION_RESPONSE_KEY);
|
|
65
|
+
intent.removeExtra(TEXT_INPUT_NOTIFICATION_RESPONSE_KEY);
|
|
66
|
+
// response events are already handled by
|
|
67
|
+
// NotificationForwarderActivity -> NotificationsService.onReceiveNotificationResponse -> NotificationEmitter.onNotificationResponseReceived
|
|
62
68
|
return ReactActivityLifecycleListener.super.onNewIntent(intent);
|
|
63
69
|
}
|
|
64
70
|
DebugLogging.logBundle("ExpoNotificationLifeCycleListener.onNewIntent:", extras);
|
|
@@ -86,14 +86,15 @@ class SharedPreferencesNotificationCategoriesStore(context: Context) {
|
|
|
86
86
|
* @return Return true if category was deleted, false if not.
|
|
87
87
|
*/
|
|
88
88
|
fun removeNotificationCategory(identifier: String): Boolean {
|
|
89
|
+
val id = preferencesNotificationCategoryKey(identifier)
|
|
89
90
|
sharedPreferences.getString(
|
|
90
|
-
|
|
91
|
+
id,
|
|
91
92
|
null
|
|
92
|
-
)
|
|
93
|
+
) ?: return false
|
|
93
94
|
|
|
94
95
|
return sharedPreferences
|
|
95
96
|
.edit()
|
|
96
|
-
.remove(
|
|
97
|
+
.remove(id)
|
|
97
98
|
.commit()
|
|
98
99
|
}
|
|
99
100
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLastNotificationResponse.d.ts","sourceRoot":"","sources":["../src/useLastNotificationResponse.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAOxF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,CAAC,OAAO,UAAU,2BAA2B,
|
|
1
|
+
{"version":3,"file":"useLastNotificationResponse.d.ts","sourceRoot":"","sources":["../src/useLastNotificationResponse.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAOxF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,CAAC,OAAO,UAAU,2BAA2B,8BAwBlD;AAKD,eAAO,MAAM,qBAAqB,GAChC,cAAc,yBAAyB,EACvC,aAAa,oBAAoB,GAAG,IAAI,gCAYzC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useLayoutEffect, useState } from 'react';
|
|
2
|
-
import { addNotificationResponseReceivedListener, addNotificationResponseClearedListener,
|
|
2
|
+
import { addNotificationResponseReceivedListener, addNotificationResponseClearedListener, getLastNotificationResponse, } from './NotificationsEmitter';
|
|
3
3
|
/**
|
|
4
4
|
* A React hook which returns the notification response that was received most recently
|
|
5
5
|
* (a notification response designates an interaction with a notification, such as tapping on it).
|
|
@@ -42,20 +42,15 @@ export default function useLastNotificationResponse() {
|
|
|
42
42
|
const [lastNotificationResponse, setLastNotificationResponse] = useState(undefined);
|
|
43
43
|
// useLayoutEffect ensures the listener is registered as soon as possible
|
|
44
44
|
useLayoutEffect(() => {
|
|
45
|
-
let isMounted = true;
|
|
46
45
|
// Get the last response first, in case it was set earlier (even in native code on startup)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
setLastNotificationResponse((prevResponse) => determineNextResponse(prevResponse, response));
|
|
50
|
-
}
|
|
51
|
-
});
|
|
46
|
+
const response = getLastNotificationResponse();
|
|
47
|
+
setLastNotificationResponse((prevResponse) => determineNextResponse(prevResponse, response));
|
|
52
48
|
// Set up listener for responses that come in, and set the last response if needed
|
|
53
49
|
const subscription = addNotificationResponseReceivedListener((response) => setLastNotificationResponse((prevResponse) => determineNextResponse(prevResponse, response)));
|
|
54
50
|
const clearResponseSubscription = addNotificationResponseClearedListener(() => {
|
|
55
51
|
setLastNotificationResponse(null);
|
|
56
52
|
});
|
|
57
53
|
return () => {
|
|
58
|
-
isMounted = false;
|
|
59
54
|
subscription.remove();
|
|
60
55
|
clearResponseSubscription.remove();
|
|
61
56
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLastNotificationResponse.js","sourceRoot":"","sources":["../src/useLastNotificationResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGlD,OAAO,EACL,uCAAuC,EACvC,sCAAsC,EACtC,
|
|
1
|
+
{"version":3,"file":"useLastNotificationResponse.js","sourceRoot":"","sources":["../src/useLastNotificationResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGlD,OAAO,EACL,uCAAuC,EACvC,sCAAsC,EACtC,2BAA2B,GAC5B,MAAM,wBAAwB,CAAC;AAEhC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,CAAC,OAAO,UAAU,2BAA2B;IACjD,MAAM,CAAC,wBAAwB,EAAE,2BAA2B,CAAC,GAC3D,QAAQ,CAA4B,SAAS,CAAC,CAAC;IAEjD,yEAAyE;IACzE,eAAe,CAAC,GAAG,EAAE;QACnB,2FAA2F;QAC3F,MAAM,QAAQ,GAAG,2BAA2B,EAAE,CAAC;QAC/C,2BAA2B,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,qBAAqB,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC;QAE7F,kFAAkF;QAClF,MAAM,YAAY,GAAG,uCAAuC,CAAC,CAAC,QAAQ,EAAE,EAAE,CACxE,2BAA2B,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,qBAAqB,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,CAC7F,CAAC;QACF,MAAM,yBAAyB,GAAG,sCAAsC,CAAC,GAAG,EAAE;YAC5E,2BAA2B,CAAC,IAAI,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;QACH,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,MAAM,EAAE,CAAC;YACtB,yBAAyB,CAAC,MAAM,EAAE,CAAC;QACrC,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,wBAAwB,CAAC;AAClC,CAAC;AAED,iEAAiE;AACjE,uFAAuF;AACvF,kDAAkD;AAClD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,YAAuC,EACvC,WAAwC,EACxC,EAAE;IACF,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAAO,WAAW,CAAC;IACrB,CAAC;IACD,OAAO,YAAY,CAAC,YAAY,CAAC,OAAO,CAAC,UAAU;QACjD,WAAW,CAAC,YAAY,CAAC,OAAO,CAAC,UAAU;QAC3C,CAAC,CAAC,WAAW;QACb,CAAC,CAAC,YAAY,CAAC;AACnB,CAAC,CAAC","sourcesContent":["import { useLayoutEffect, useState } from 'react';\n\nimport { MaybeNotificationResponse, NotificationResponse } from './Notifications.types';\nimport {\n addNotificationResponseReceivedListener,\n addNotificationResponseClearedListener,\n getLastNotificationResponse,\n} from './NotificationsEmitter';\n\n/**\n * A React hook which returns the notification response that was received most recently\n * (a notification response designates an interaction with a notification, such as tapping on it).\n *\n * To clear the last notification response, use [`clearLastNotificationResponseAsync()`](#notificationsclearlastnotificationresponseasync).\n *\n * > If you don't want to use a hook, you can use `Notifications.getLastNotificationResponseAsync()` instead.\n *\n * @return The hook may return one of these three types/values:\n * - `undefined` - until we're sure of what to return,\n * - `null` - if no notification response has been received yet,\n * - a [`NotificationResponse`](#notificationresponse) object - if a notification response was received.\n *\n * @example\n * Responding to a notification tap by opening a URL that could be put into the notification's `data`\n * (opening the URL is your responsibility and is not a part of the `expo-notifications` API):\n * ```jsx\n * import * as Notifications from 'expo-notifications';\n * import { Linking } from 'react-native';\n *\n * export default function App() {\n * const lastNotificationResponse = Notifications.useLastNotificationResponse();\n * React.useEffect(() => {\n * if (\n * lastNotificationResponse &&\n * lastNotificationResponse.notification.request.content.data.url &&\n * lastNotificationResponse.actionIdentifier === Notifications.DEFAULT_ACTION_IDENTIFIER\n * ) {\n * Linking.openURL(lastNotificationResponse.notification.request.content.data.url);\n * }\n * }, [lastNotificationResponse]);\n * return (\n * // Your app content\n * );\n * }\n * ```\n * @header listen\n */\nexport default function useLastNotificationResponse() {\n const [lastNotificationResponse, setLastNotificationResponse] =\n useState<MaybeNotificationResponse>(undefined);\n\n // useLayoutEffect ensures the listener is registered as soon as possible\n useLayoutEffect(() => {\n // Get the last response first, in case it was set earlier (even in native code on startup)\n const response = getLastNotificationResponse();\n setLastNotificationResponse((prevResponse) => determineNextResponse(prevResponse, response));\n\n // Set up listener for responses that come in, and set the last response if needed\n const subscription = addNotificationResponseReceivedListener((response) =>\n setLastNotificationResponse((prevResponse) => determineNextResponse(prevResponse, response))\n );\n const clearResponseSubscription = addNotificationResponseClearedListener(() => {\n setLastNotificationResponse(null);\n });\n return () => {\n subscription.remove();\n clearResponseSubscription.remove();\n };\n }, []);\n\n return lastNotificationResponse;\n}\n\n// returns the new response if it is different from the previous,\n// also has to return undefined until we're sure of what to return (null or a response)\n// the transition from response to null is invalid\nexport const determineNextResponse = (\n prevResponse: MaybeNotificationResponse,\n newResponse: NotificationResponse | null\n) => {\n if (!newResponse) {\n return null;\n }\n if (!prevResponse) {\n return newResponse;\n }\n return prevResponse.notification.request.identifier !==\n newResponse.notification.request.identifier\n ? newResponse\n : prevResponse;\n};\n"]}
|
package/expo-module.config.json
CHANGED
|
@@ -2,9 +2,50 @@
|
|
|
2
2
|
|
|
3
3
|
import ExpoModulesCore
|
|
4
4
|
import UIKit
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
actor CategoryManager {
|
|
7
|
+
private var categories: Set<UNNotificationCategory>?
|
|
8
|
+
|
|
9
|
+
func setCategory(identifier: String, actions: [CategoryActionRecord], options: CategoryOptionsRecord?) async -> CategoryRecord {
|
|
10
|
+
let categoryRecord = CategoryRecord(identifier, actions: actions, options: options)
|
|
11
|
+
let newCategory = categoryRecord.toUNNotificationCategory()
|
|
12
|
+
|
|
13
|
+
let current = await loadCategories()
|
|
14
|
+
let updated = current.filter { $0.identifier != identifier }.union([newCategory])
|
|
15
|
+
|
|
16
|
+
await updateCategories(updated)
|
|
17
|
+
return CategoryRecord(newCategory)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
func deleteCategory(identifier: String) async -> Bool {
|
|
21
|
+
let current = await loadCategories()
|
|
22
|
+
let exists = current.contains { $0.identifier == identifier }
|
|
23
|
+
|
|
24
|
+
if exists {
|
|
25
|
+
let updated = current.filter { $0.identifier != identifier }
|
|
26
|
+
await updateCategories(updated)
|
|
27
|
+
}
|
|
28
|
+
return exists
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
private func loadCategories() async -> Set<UNNotificationCategory> {
|
|
32
|
+
if let cached = categories {
|
|
33
|
+
return cached
|
|
34
|
+
}
|
|
35
|
+
let fresh = await UNUserNotificationCenter.current().notificationCategories()
|
|
36
|
+
categories = fresh
|
|
37
|
+
return fresh
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
private func updateCategories(_ newCategories: Set<UNNotificationCategory>) async {
|
|
41
|
+
categories = newCategories
|
|
42
|
+
UNUserNotificationCenter.current().setNotificationCategories(newCategories)
|
|
43
|
+
}
|
|
44
|
+
}
|
|
6
45
|
|
|
7
46
|
open class CategoriesModule: Module {
|
|
47
|
+
private let categoryManager = CategoryManager()
|
|
48
|
+
|
|
8
49
|
public func definition() -> ModuleDefinition {
|
|
9
50
|
Name("ExpoNotificationCategoriesModule")
|
|
10
51
|
|
|
@@ -27,29 +68,10 @@ open class CategoriesModule: Module {
|
|
|
27
68
|
}
|
|
28
69
|
|
|
29
70
|
open func setNotificationCategoryAsync(identifier: String, actions: [CategoryActionRecord], options: CategoryOptionsRecord?) async -> CategoryRecord {
|
|
30
|
-
|
|
31
|
-
let newNotificationCategory = categoryRecord.toUNNotificationCategory()
|
|
32
|
-
let oldCategories = await UNUserNotificationCenter.current().notificationCategories()
|
|
33
|
-
let newCategories = oldCategories
|
|
34
|
-
.filter { oldCategory in
|
|
35
|
-
return oldCategory.identifier != newNotificationCategory.identifier
|
|
36
|
-
}
|
|
37
|
-
.union([newNotificationCategory])
|
|
38
|
-
UNUserNotificationCenter.current().setNotificationCategories(newCategories)
|
|
39
|
-
return CategoryRecord(newNotificationCategory)
|
|
71
|
+
return await categoryManager.setCategory(identifier: identifier, actions: actions, options: options)
|
|
40
72
|
}
|
|
41
73
|
|
|
42
74
|
open func deleteNotificationCategoryAsync(identifier: String) async -> Bool {
|
|
43
|
-
|
|
44
|
-
let didDelete = oldCategories.contains { oldCategory in
|
|
45
|
-
return oldCategory.identifier == identifier
|
|
46
|
-
}
|
|
47
|
-
if didDelete {
|
|
48
|
-
let newCategories = oldCategories.filter { oldCategory in
|
|
49
|
-
return oldCategory.identifier != identifier
|
|
50
|
-
}
|
|
51
|
-
UNUserNotificationCenter.current().setNotificationCategories(newCategories)
|
|
52
|
-
}
|
|
53
|
-
return didDelete
|
|
75
|
+
return await categoryManager.deleteCategory(identifier: identifier)
|
|
54
76
|
}
|
|
55
77
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
26b870ecb6040de42f6cfa1a5caad419
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
c04acc3b1369624a875d78158cd92ab7fc941043
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2674c7c733ba0f80e0d2b10696cc21141756c0d32100db7c96c942573bc9afde
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3f440b5ad0a2bc1e931aeee41a90e73a01fcfb49151052c2dda06d7fee844fa89e0279562e931009ccc6d4dcc21b3da0d3c9d8eba0a9dc9c04771570d79845fd
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
c4b4a629ef9cdef938237bf679c40543
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
5c565e1fa875b0701c63da5bae4af5937b877cf9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
c6dac23e57a51b3cc5a8eee7fa9c92609b5d0d589855a505facf196bd88e9960
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
a8ec19c21f69061ccc18cb0b9f51759d5d2f5c1129b1e44da4b803b68e5d83c273e8e4ea5952032abff13c052901e481f013e78588b969ce98a3d995b77f47d6
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"component": {
|
|
4
4
|
"group": "host.exp.exponent",
|
|
5
5
|
"module": "expo.modules.notifications",
|
|
6
|
-
"version": "0.32.
|
|
6
|
+
"version": "0.32.10",
|
|
7
7
|
"attributes": {
|
|
8
8
|
"org.gradle.status": "release"
|
|
9
9
|
}
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
{
|
|
27
|
-
"name": "expo.modules.notifications-0.32.
|
|
28
|
-
"url": "expo.modules.notifications-0.32.
|
|
29
|
-
"size":
|
|
30
|
-
"sha512": "
|
|
31
|
-
"sha256": "
|
|
32
|
-
"sha1": "
|
|
33
|
-
"md5": "
|
|
27
|
+
"name": "expo.modules.notifications-0.32.10.aar",
|
|
28
|
+
"url": "expo.modules.notifications-0.32.10.aar",
|
|
29
|
+
"size": 385096,
|
|
30
|
+
"sha512": "a8ec19c21f69061ccc18cb0b9f51759d5d2f5c1129b1e44da4b803b68e5d83c273e8e4ea5952032abff13c052901e481f013e78588b969ce98a3d995b77f47d6",
|
|
31
|
+
"sha256": "c6dac23e57a51b3cc5a8eee7fa9c92609b5d0d589855a505facf196bd88e9960",
|
|
32
|
+
"sha1": "5c565e1fa875b0701c63da5bae4af5937b877cf9",
|
|
33
|
+
"md5": "c4b4a629ef9cdef938237bf679c40543"
|
|
34
34
|
}
|
|
35
35
|
]
|
|
36
36
|
},
|
|
@@ -122,13 +122,13 @@
|
|
|
122
122
|
],
|
|
123
123
|
"files": [
|
|
124
124
|
{
|
|
125
|
-
"name": "expo.modules.notifications-0.32.
|
|
126
|
-
"url": "expo.modules.notifications-0.32.
|
|
127
|
-
"size":
|
|
128
|
-
"sha512": "
|
|
129
|
-
"sha256": "
|
|
130
|
-
"sha1": "
|
|
131
|
-
"md5": "
|
|
125
|
+
"name": "expo.modules.notifications-0.32.10.aar",
|
|
126
|
+
"url": "expo.modules.notifications-0.32.10.aar",
|
|
127
|
+
"size": 385096,
|
|
128
|
+
"sha512": "a8ec19c21f69061ccc18cb0b9f51759d5d2f5c1129b1e44da4b803b68e5d83c273e8e4ea5952032abff13c052901e481f013e78588b969ce98a3d995b77f47d6",
|
|
129
|
+
"sha256": "c6dac23e57a51b3cc5a8eee7fa9c92609b5d0d589855a505facf196bd88e9960",
|
|
130
|
+
"sha1": "5c565e1fa875b0701c63da5bae4af5937b877cf9",
|
|
131
|
+
"md5": "c4b4a629ef9cdef938237bf679c40543"
|
|
132
132
|
}
|
|
133
133
|
]
|
|
134
134
|
},
|
|
@@ -142,13 +142,13 @@
|
|
|
142
142
|
},
|
|
143
143
|
"files": [
|
|
144
144
|
{
|
|
145
|
-
"name": "expo.modules.notifications-0.32.
|
|
146
|
-
"url": "expo.modules.notifications-0.32.
|
|
147
|
-
"size":
|
|
148
|
-
"sha512": "
|
|
149
|
-
"sha256": "
|
|
150
|
-
"sha1": "
|
|
151
|
-
"md5": "
|
|
145
|
+
"name": "expo.modules.notifications-0.32.10-sources.jar",
|
|
146
|
+
"url": "expo.modules.notifications-0.32.10-sources.jar",
|
|
147
|
+
"size": 99407,
|
|
148
|
+
"sha512": "3f440b5ad0a2bc1e931aeee41a90e73a01fcfb49151052c2dda06d7fee844fa89e0279562e931009ccc6d4dcc21b3da0d3c9d8eba0a9dc9c04771570d79845fd",
|
|
149
|
+
"sha256": "2674c7c733ba0f80e0d2b10696cc21141756c0d32100db7c96c942573bc9afde",
|
|
150
|
+
"sha1": "c04acc3b1369624a875d78158cd92ab7fc941043",
|
|
151
|
+
"md5": "26b870ecb6040de42f6cfa1a5caad419"
|
|
152
152
|
}
|
|
153
153
|
]
|
|
154
154
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1f94e5f815f0745c3682c40ade9fff90
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
6c69851f7816ffd6130fe53fc3214820ce873936
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2353e11b5b8fc9c21166a68c6490961c5abc43874c3da77f494133dd8dcc21af
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
a86b279c1eab02a3382154b06e50543948c5edbdf8350803f3f2b5b1618e76fd84af1e6d06cfd1a9e0d5fb6daebe9295cfbfd2af5bd0e3f489b70e147b064df0
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<modelVersion>4.0.0</modelVersion>
|
|
10
10
|
<groupId>host.exp.exponent</groupId>
|
|
11
11
|
<artifactId>expo.modules.notifications</artifactId>
|
|
12
|
-
<version>0.32.
|
|
12
|
+
<version>0.32.10</version>
|
|
13
13
|
<packaging>aar</packaging>
|
|
14
14
|
<name>expo.modules.notifications</name>
|
|
15
15
|
<url>https://github.com/expo/expo</url>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ec1116e311534e610a0beba036e94b88
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
c501647a038e0a8dd896436224dfd02e4aedc5f6
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
dcabdfd231bd3d54182ba6554c083403ab2aafd852c6ba47c6241ef3e7f857af
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
623abc05f2c226d6271b473e8138e434535d2a048914407e3c10bd00eee51378a72ed0168ed472ca4b4e7f3ccdafd771786b3d390b387640ba776a10ba5f1ce5
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<groupId>host.exp.exponent</groupId>
|
|
4
4
|
<artifactId>expo.modules.notifications</artifactId>
|
|
5
5
|
<versioning>
|
|
6
|
-
<latest>0.32.
|
|
7
|
-
<release>0.32.
|
|
6
|
+
<latest>0.32.10</latest>
|
|
7
|
+
<release>0.32.10</release>
|
|
8
8
|
<versions>
|
|
9
|
-
<version>0.32.
|
|
9
|
+
<version>0.32.10</version>
|
|
10
10
|
</versions>
|
|
11
|
-
<lastUpdated>
|
|
11
|
+
<lastUpdated>20250904150716</lastUpdated>
|
|
12
12
|
</versioning>
|
|
13
13
|
</metadata>
|
package/local-maven-repo/host/exp/exponent/expo.modules.notifications/maven-metadata.xml.md5
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
f5cccbdbadcd05e8343da91c2aa159c1
|
package/local-maven-repo/host/exp/exponent/expo.modules.notifications/maven-metadata.xml.sha1
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
284ea1c8d695572042781f8ee706d05297c08ea9
|
package/local-maven-repo/host/exp/exponent/expo.modules.notifications/maven-metadata.xml.sha256
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
cc18c499eec7aad75f89d85d3c12116b611926b1105038f90b35677cc52abb66
|
package/local-maven-repo/host/exp/exponent/expo.modules.notifications/maven-metadata.xml.sha512
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
e55df80ff094762f9465a36624f6d8d3b31311b3c74124df878c6310ceb096021032759458027fd3239970dfd1d14fd15142a700c1ceba407e5cb92ff3eb2732
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-notifications",
|
|
3
|
-
"version": "0.32.
|
|
3
|
+
"version": "0.32.10",
|
|
4
4
|
"description": "Provides an API to fetch push notification tokens and to present, schedule, receive, and respond to notifications.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"react": "*",
|
|
60
60
|
"react-native": "*"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "8cafaff8076e443e6c80e8013ec809f4f290f24d"
|
|
63
63
|
}
|
|
@@ -4,7 +4,7 @@ import { MaybeNotificationResponse, NotificationResponse } from './Notifications
|
|
|
4
4
|
import {
|
|
5
5
|
addNotificationResponseReceivedListener,
|
|
6
6
|
addNotificationResponseClearedListener,
|
|
7
|
-
|
|
7
|
+
getLastNotificationResponse,
|
|
8
8
|
} from './NotificationsEmitter';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -51,15 +51,9 @@ export default function useLastNotificationResponse() {
|
|
|
51
51
|
|
|
52
52
|
// useLayoutEffect ensures the listener is registered as soon as possible
|
|
53
53
|
useLayoutEffect(() => {
|
|
54
|
-
let isMounted = true;
|
|
55
54
|
// Get the last response first, in case it was set earlier (even in native code on startup)
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
setLastNotificationResponse((prevResponse) =>
|
|
59
|
-
determineNextResponse(prevResponse, response)
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
});
|
|
55
|
+
const response = getLastNotificationResponse();
|
|
56
|
+
setLastNotificationResponse((prevResponse) => determineNextResponse(prevResponse, response));
|
|
63
57
|
|
|
64
58
|
// Set up listener for responses that come in, and set the last response if needed
|
|
65
59
|
const subscription = addNotificationResponseReceivedListener((response) =>
|
|
@@ -69,7 +63,6 @@ export default function useLastNotificationResponse() {
|
|
|
69
63
|
setLastNotificationResponse(null);
|
|
70
64
|
});
|
|
71
65
|
return () => {
|
|
72
|
-
isMounted = false;
|
|
73
66
|
subscription.remove();
|
|
74
67
|
clearResponseSubscription.remove();
|
|
75
68
|
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
655ab013d290da813256f46fa63886df
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
524f042843a88a52038a6d375f8ac39cc8850c0d
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
84d1daa174a334cbd2ab7b2a2ba13fc31b92d6168fef0a820478e277549fa067
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ce65caf6c6c6799c26cb74b2ee722de501f6986071018c0da85f79f28858422ae8eff86db05b1e636ab06ec1dbe5bceac32822f83fa5eeded137d2d37a4df78d
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
52fa7e73f05ec9e24c3d535e5d886097
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
301978a4d3a0d5814ed31ee5854e1f7b761828f0
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
2918ed670b2d8a6559325a6ec9a19b4ab43e9e243f09e72e074272f8ce11f79f
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
dd3f365bfd6ea662007e58b2df8b583ead5049a7726370228835a1a29ba6a858baba658394549d4486d73356f5f97e42fad69b5162c1ffb75abc84f1a103b78a
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
69368ccce1663366ea65fb3333559565
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1d1db4affff51adb352e410340007a1fc47416ac
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
2ac834917442a0d3450cd9c2ae94e171c0beb53b198c2abb8e2a273ab616a7a6
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
88602c37ec9e12e0ae8462e828be1b72b6c209a301c1d7c25db1c4a43e2512405fc974faf8c21924015f4f48b4cbee872f9132e85736a50d6c5a77f212ced664
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
165b662327aac0c495090a82af1a6b26
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
d0d0ac11223ef724ebd883a5b145f0bcc12b4137
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ba73e3855d6a482419c3d849d64a0d55644f0b57ef4248bf27d90cd83257d362
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
c8f373d376f65f0375bb50d84a706ba42a088dcc3ba503c394998e688db237929e5c565436a27e92a40a813d1c095575fdb824e16a60e2128cbd0efbf7e0ac0c
|