expo-notifications 0.16.1 → 0.18.0
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 +26 -0
- package/README.md +1 -1
- package/android/build.gradle +4 -4
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/java/expo/modules/notifications/permissions/NotificationPermissionsModule.kt +144 -0
- package/android/src/main/java/expo/modules/notifications/service/NotificationsService.kt +1 -1
- package/build/BadgeModule.types.d.ts +2 -2
- package/build/BadgeModule.types.d.ts.map +1 -1
- package/build/DevicePushTokenAutoRegistration.fx.d.ts +2 -5
- package/build/DevicePushTokenAutoRegistration.fx.d.ts.map +1 -1
- package/build/DevicePushTokenAutoRegistration.fx.js +2 -4
- package/build/DevicePushTokenAutoRegistration.fx.js.map +1 -1
- package/build/NotificationCategoriesModule.web.d.ts +1 -1
- package/build/NotificationCategoriesModule.web.d.ts.map +1 -1
- package/build/NotificationChannelGroupManager.types.d.ts +8 -0
- package/build/NotificationChannelGroupManager.types.d.ts.map +1 -1
- package/build/NotificationChannelGroupManager.types.js.map +1 -1
- package/build/NotificationChannelManager.types.d.ts +14 -4
- package/build/NotificationChannelManager.types.d.ts.map +1 -1
- package/build/NotificationChannelManager.types.js +7 -1
- package/build/NotificationChannelManager.types.js.map +1 -1
- package/build/NotificationPermissions.d.ts +44 -2
- package/build/NotificationPermissions.d.ts.map +1 -1
- package/build/NotificationPermissions.js +44 -2
- package/build/NotificationPermissions.js.map +1 -1
- package/build/NotificationPermissions.types.d.ts +41 -4
- package/build/NotificationPermissions.types.d.ts.map +1 -1
- package/build/NotificationPermissions.types.js.map +1 -1
- package/build/NotificationScheduler.types.d.ts +1 -1
- package/build/NotificationScheduler.types.d.ts.map +1 -1
- package/build/Notifications.types.d.ts +420 -90
- package/build/Notifications.types.d.ts.map +1 -1
- package/build/Notifications.types.js +3 -0
- package/build/Notifications.types.js.map +1 -1
- package/build/NotificationsEmitter.d.ts +66 -0
- package/build/NotificationsEmitter.d.ts.map +1 -1
- package/build/NotificationsEmitter.js +68 -0
- package/build/NotificationsEmitter.js.map +1 -1
- package/build/NotificationsHandler.d.ts +44 -1
- package/build/NotificationsHandler.d.ts.map +1 -1
- package/build/NotificationsHandler.js +29 -0
- package/build/NotificationsHandler.js.map +1 -1
- package/build/TokenEmitter.d.ts +37 -1
- package/build/TokenEmitter.d.ts.map +1 -1
- package/build/TokenEmitter.js +32 -3
- package/build/TokenEmitter.js.map +1 -1
- package/build/Tokens.types.d.ts +31 -3
- package/build/Tokens.types.d.ts.map +1 -1
- package/build/Tokens.types.js.map +1 -1
- package/build/cancelAllScheduledNotificationsAsync.d.ts +5 -0
- package/build/cancelAllScheduledNotificationsAsync.d.ts.map +1 -1
- package/build/cancelAllScheduledNotificationsAsync.js +5 -0
- package/build/cancelAllScheduledNotificationsAsync.js.map +1 -1
- package/build/cancelScheduledNotificationAsync.d.ts +20 -0
- package/build/cancelScheduledNotificationAsync.d.ts.map +1 -1
- package/build/cancelScheduledNotificationAsync.js +20 -0
- package/build/cancelScheduledNotificationAsync.js.map +1 -1
- package/build/deleteNotificationCategoryAsync.d.ts +9 -0
- package/build/deleteNotificationCategoryAsync.d.ts.map +1 -1
- package/build/deleteNotificationCategoryAsync.js +9 -0
- package/build/deleteNotificationCategoryAsync.js.map +1 -1
- package/build/deleteNotificationChannelAsync.d.ts +7 -0
- package/build/deleteNotificationChannelAsync.d.ts.map +1 -1
- package/build/deleteNotificationChannelAsync.js +7 -0
- package/build/deleteNotificationChannelAsync.js.map +1 -1
- package/build/deleteNotificationChannelGroupAsync.d.ts +7 -0
- package/build/deleteNotificationChannelGroupAsync.d.ts.map +1 -1
- package/build/deleteNotificationChannelGroupAsync.js +7 -0
- package/build/deleteNotificationChannelGroupAsync.js.map +1 -1
- package/build/dismissAllNotificationsAsync.d.ts +5 -0
- package/build/dismissAllNotificationsAsync.d.ts.map +1 -1
- package/build/dismissAllNotificationsAsync.js +5 -0
- package/build/dismissAllNotificationsAsync.js.map +1 -1
- package/build/dismissNotificationAsync.d.ts +6 -0
- package/build/dismissNotificationAsync.d.ts.map +1 -1
- package/build/dismissNotificationAsync.js +6 -0
- package/build/dismissNotificationAsync.js.map +1 -1
- package/build/getAllScheduledNotificationsAsync.d.ts +5 -0
- package/build/getAllScheduledNotificationsAsync.d.ts.map +1 -1
- package/build/getAllScheduledNotificationsAsync.js +5 -0
- package/build/getAllScheduledNotificationsAsync.js.map +1 -1
- package/build/getBadgeCountAsync.d.ts +6 -0
- package/build/getBadgeCountAsync.d.ts.map +1 -1
- package/build/getBadgeCountAsync.js +6 -0
- package/build/getBadgeCountAsync.js.map +1 -1
- package/build/getDevicePushTokenAsync.d.ts +5 -0
- package/build/getDevicePushTokenAsync.d.ts.map +1 -1
- package/build/getDevicePushTokenAsync.js +6 -1
- package/build/getDevicePushTokenAsync.js.map +1 -1
- package/build/getExpoPushTokenAsync.d.ts +74 -0
- package/build/getExpoPushTokenAsync.d.ts.map +1 -1
- package/build/getExpoPushTokenAsync.js +41 -1
- package/build/getExpoPushTokenAsync.js.map +1 -1
- package/build/getNextTriggerDateAsync.d.ts +23 -0
- package/build/getNextTriggerDateAsync.d.ts.map +1 -1
- package/build/getNextTriggerDateAsync.js +23 -0
- package/build/getNextTriggerDateAsync.js.map +1 -1
- package/build/getNotificationCategoriesAsync.d.ts +8 -0
- package/build/getNotificationCategoriesAsync.d.ts.map +1 -1
- package/build/getNotificationCategoriesAsync.js +8 -0
- package/build/getNotificationCategoriesAsync.js.map +1 -1
- package/build/getNotificationChannelAsync.d.ts +8 -0
- package/build/getNotificationChannelAsync.d.ts.map +1 -1
- package/build/getNotificationChannelAsync.js +8 -0
- package/build/getNotificationChannelAsync.js.map +1 -1
- package/build/getNotificationChannelGroupAsync.d.ts +9 -0
- package/build/getNotificationChannelGroupAsync.d.ts.map +1 -1
- package/build/getNotificationChannelGroupAsync.js +9 -0
- package/build/getNotificationChannelGroupAsync.js.map +1 -1
- package/build/getNotificationChannelGroupsAsync.d.ts +7 -0
- package/build/getNotificationChannelGroupsAsync.d.ts.map +1 -1
- package/build/getNotificationChannelGroupsAsync.js +7 -0
- package/build/getNotificationChannelGroupsAsync.js.map +1 -1
- package/build/getNotificationChannelsAsync.d.ts +7 -0
- package/build/getNotificationChannelsAsync.d.ts.map +1 -1
- package/build/getNotificationChannelsAsync.js +7 -0
- package/build/getNotificationChannelsAsync.js.map +1 -1
- package/build/getPresentedNotificationsAsync.d.ts +6 -0
- package/build/getPresentedNotificationsAsync.d.ts.map +1 -1
- package/build/getPresentedNotificationsAsync.js +6 -0
- package/build/getPresentedNotificationsAsync.js.map +1 -1
- package/build/presentNotificationAsync.d.ts +6 -2
- package/build/presentNotificationAsync.d.ts.map +1 -1
- package/build/presentNotificationAsync.js +6 -2
- package/build/presentNotificationAsync.js.map +1 -1
- package/build/registerTaskAsync.d.ts +27 -0
- package/build/registerTaskAsync.d.ts.map +1 -1
- package/build/registerTaskAsync.js +27 -0
- package/build/registerTaskAsync.js.map +1 -1
- package/build/scheduleNotificationAsync.d.ts +55 -0
- package/build/scheduleNotificationAsync.d.ts.map +1 -1
- package/build/scheduleNotificationAsync.js +55 -0
- package/build/scheduleNotificationAsync.js.map +1 -1
- package/build/setBadgeCountAsync.d.ts +13 -0
- package/build/setBadgeCountAsync.d.ts.map +1 -1
- package/build/setBadgeCountAsync.js +10 -0
- package/build/setBadgeCountAsync.js.map +1 -1
- package/build/setNotificationCategoryAsync.d.ts +14 -11
- package/build/setNotificationCategoryAsync.d.ts.map +1 -1
- package/build/setNotificationCategoryAsync.js +12 -0
- package/build/setNotificationCategoryAsync.js.map +1 -1
- package/build/setNotificationChannelAsync.d.ts +19 -0
- package/build/setNotificationChannelAsync.d.ts.map +1 -1
- package/build/setNotificationChannelAsync.js +19 -0
- package/build/setNotificationChannelAsync.js.map +1 -1
- package/build/setNotificationChannelGroupAsync.d.ts +9 -0
- package/build/setNotificationChannelGroupAsync.d.ts.map +1 -1
- package/build/setNotificationChannelGroupAsync.js +9 -0
- package/build/setNotificationChannelGroupAsync.js.map +1 -1
- package/build/unregisterForNotificationsAsync.d.ts.map +1 -1
- package/build/unregisterForNotificationsAsync.js +1 -0
- package/build/unregisterForNotificationsAsync.js.map +1 -1
- package/build/unregisterTaskAsync.d.ts +5 -0
- package/build/unregisterTaskAsync.d.ts.map +1 -1
- package/build/unregisterTaskAsync.js +5 -0
- package/build/unregisterTaskAsync.js.map +1 -1
- package/build/useLastNotificationResponse.d.ts +33 -5
- package/build/useLastNotificationResponse.d.ts.map +1 -1
- package/build/useLastNotificationResponse.js +33 -5
- package/build/useLastNotificationResponse.js.map +1 -1
- package/ios/EXNotifications.podspec +1 -1
- package/package.json +5 -6
- package/plugin/build/withNotifications.d.ts +2 -2
- package/plugin/build/withNotifications.js +1 -1
- package/plugin/build/withNotificationsAndroid.d.ts +4 -4
- package/plugin/build/withNotificationsAndroid.js +3 -5
- package/plugin/build/withNotificationsIOS.d.ts +1 -1
- package/plugin/build/withNotificationsIOS.js +1 -1
- package/plugin/src/withNotifications.ts +1 -1
- package/plugin/src/withNotificationsAndroid.ts +3 -3
- package/plugin/src/withNotificationsIOS.ts +1 -1
- package/src/DevicePushTokenAutoRegistration.fx.ts +2 -4
- package/src/NotificationChannelGroupManager.types.ts +8 -0
- package/src/NotificationChannelManager.types.ts +16 -1
- package/src/NotificationPermissions.ts +44 -2
- package/src/NotificationPermissions.types.ts +42 -6
- package/src/Notifications.types.ts +441 -90
- package/src/NotificationsEmitter.ts +68 -0
- package/src/NotificationsHandler.ts +44 -0
- package/src/TokenEmitter.ts +36 -1
- package/src/Tokens.types.ts +31 -0
- package/src/cancelAllScheduledNotificationsAsync.ts +5 -0
- package/src/cancelScheduledNotificationAsync.ts +20 -0
- package/src/deleteNotificationCategoryAsync.ts +9 -0
- package/src/deleteNotificationChannelAsync.ts +7 -0
- package/src/deleteNotificationChannelGroupAsync.ts +7 -0
- package/src/dismissAllNotificationsAsync.ts +5 -0
- package/src/dismissNotificationAsync.ts +6 -0
- package/src/getAllScheduledNotificationsAsync.ts +5 -0
- package/src/getBadgeCountAsync.ts +6 -0
- package/src/getDevicePushTokenAsync.ts +6 -1
- package/src/getExpoPushTokenAsync.ts +82 -6
- package/src/getNextTriggerDateAsync.ts +23 -0
- package/src/getNotificationCategoriesAsync.ts +8 -0
- package/src/getNotificationChannelAsync.ts +8 -0
- package/src/getNotificationChannelGroupAsync.ts +9 -0
- package/src/getNotificationChannelGroupsAsync.ts +7 -0
- package/src/getNotificationChannelsAsync.ts +7 -0
- package/src/getPresentedNotificationsAsync.ts +6 -0
- package/src/presentNotificationAsync.ts +6 -2
- package/src/registerTaskAsync.ts +27 -0
- package/src/scheduleNotificationAsync.ts +55 -0
- package/src/setBadgeCountAsync.ts +13 -0
- package/src/setNotificationCategoryAsync.ts +18 -11
- package/src/setNotificationChannelAsync.ts +19 -0
- package/src/setNotificationChannelGroupAsync.ts +9 -0
- package/src/unregisterForNotificationsAsync.ts +1 -0
- package/src/unregisterTaskAsync.ts +5 -0
- package/src/useLastNotificationResponse.ts +33 -5
- package/android/src/main/java/expo/modules/notifications/permissions/NotificationPermissionsModule.java +0 -74
- package/ios/EXNotifications.xcframework/Info.plist +0 -40
- package/ios/EXNotifications.xcframework/ios-arm64/EXNotifications.framework/EXNotifications +0 -0
- package/ios/EXNotifications.xcframework/ios-arm64/EXNotifications.framework/Info.plist +0 -0
- package/ios/EXNotifications.xcframework/ios-arm64_x86_64-simulator/EXNotifications.framework/EXNotifications +0 -0
- package/ios/EXNotifications.xcframework/ios-arm64_x86_64-simulator/EXNotifications.framework/Info.plist +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,32 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 0.18.0 — 2023-02-03
|
|
14
|
+
|
|
15
|
+
### 💡 Others
|
|
16
|
+
|
|
17
|
+
- Update `getExpoPushTokenAsync` to make `projectId` required. ([#20833](https://github.com/expo/expo/pull/20833) by [@gabrieldonadel](https://github.com/gabrieldonadel))
|
|
18
|
+
- On Android bump `compileSdkVersion` and `targetSdkVersion` to `33`. ([#20721](https://github.com/expo/expo/pull/20721) by [@lukmccall](https://github.com/lukmccall))
|
|
19
|
+
- Add JSDoc comments, perform type changes related to documentation autogeneration. ([#21002](https://github.com/expo/expo/pull/21002) by [@Simek](https://github.com/Simek))
|
|
20
|
+
|
|
21
|
+
## 0.17.0 — 2022-10-25
|
|
22
|
+
|
|
23
|
+
### 🛠 Breaking changes
|
|
24
|
+
|
|
25
|
+
- [plugin] Upgrade minimum runtime requirement to Node 14 (LTS). ([#18204](https://github.com/expo/expo/pull/18204) by [@EvanBacon](https://github.com/EvanBacon))
|
|
26
|
+
- Bumped iOS deployment target to 13.0 and deprecated support for iOS 12. ([#18873](https://github.com/expo/expo/pull/18873) by [@tsapeta](https://github.com/tsapeta))
|
|
27
|
+
|
|
28
|
+
### 🐛 Bug fixes
|
|
29
|
+
|
|
30
|
+
- Fixed build error for setting `compileSdkVersion` to 33. ([#19432](https://github.com/expo/expo/pull/19432) by [@kudo](https://github.com/kudo))
|
|
31
|
+
- Fixed the `POST_NOTIFICATIONS` runtime permission integration when `targerSdkVersion` is set to 33. ([#19672](https://github.com/expo/expo/pull/19672) by [@kudo](https://github.com/kudo), [@kudo](https://github.com/kudo))
|
|
32
|
+
- Fixed `projectId` variable not found reference error when using development builds. ([#20276](https://github.com/expo/expo/pull/20276) by [@amandeepmittal](https://github.com/amandeepmittal))
|
|
33
|
+
|
|
34
|
+
### 💡 Others
|
|
35
|
+
|
|
36
|
+
- [plugin] Migrate import from @expo/config-plugins to expo/config-plugins and @expo/config-types to expo/config. ([#18855](https://github.com/expo/expo/pull/18855) by [@brentvatne](https://github.com/brentvatne))
|
|
37
|
+
- Drop `@expo/config-plugins` dependency in favor of peer dependency on `expo`. ([#18595](https://github.com/expo/expo/pull/18595) by [@EvanBacon](https://github.com/EvanBacon))
|
|
38
|
+
|
|
13
39
|
## 0.16.1 — 2022-07-16
|
|
14
40
|
|
|
15
41
|
_This version does not introduce any user-facing changes._
|
package/README.md
CHANGED
|
@@ -181,7 +181,7 @@ Here are a few ways people claim to have solved this problem, maybe one of these
|
|
|
181
181
|
Go read the Apple's [Technical Note on troubleshooting push notifications](https://developer.apple.com/library/archive/technotes/tn2265/_index.html)! This the single most reliable source of information on this problem. To help you grasp what they're suggesting:
|
|
182
182
|
|
|
183
183
|
- Make sure the device has a reliable connection to the Internet (try turning off Wi-Fi or switching to another network, and disabling firewall block on port 5223, as suggested in [this SO answer](https://stackoverflow.com/a/34332047/1123156)).
|
|
184
|
-
- Make sure your app configuration is set properly for registering for push notifications (for bare workflow check out [this guide](https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/AddingCapabilities/AddingCapabilities.html
|
|
184
|
+
- Make sure your app configuration is set properly for registering for push notifications (for bare workflow check out [this guide](https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/AddingCapabilities/AddingCapabilities.html), for managed workflow this is done automatically for you by `expo-cli`) as also suggested by [this StackOverflow answer](https://stackoverflow.com/a/10791240/1123156).
|
|
185
185
|
- If you're in bare workflow you may want to try to debug this even further by logging persistent connection debug information as outlined by [this StackOverflow answer](https://stackoverflow.com/a/8036052/1123156).
|
|
186
186
|
|
|
187
187
|
</p>
|
package/android/build.gradle
CHANGED
|
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
|
|
|
3
3
|
apply plugin: 'maven-publish'
|
|
4
4
|
|
|
5
5
|
group = 'host.exp.exponent'
|
|
6
|
-
version = '0.
|
|
6
|
+
version = '0.18.0'
|
|
7
7
|
|
|
8
8
|
buildscript {
|
|
9
9
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
@@ -59,7 +59,7 @@ afterEvaluate {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
android {
|
|
62
|
-
compileSdkVersion safeExtGet("compileSdkVersion",
|
|
62
|
+
compileSdkVersion safeExtGet("compileSdkVersion", 33)
|
|
63
63
|
|
|
64
64
|
compileOptions {
|
|
65
65
|
sourceCompatibility JavaVersion.VERSION_11
|
|
@@ -72,9 +72,9 @@ android {
|
|
|
72
72
|
|
|
73
73
|
defaultConfig {
|
|
74
74
|
minSdkVersion safeExtGet("minSdkVersion", 21)
|
|
75
|
-
targetSdkVersion safeExtGet("targetSdkVersion",
|
|
75
|
+
targetSdkVersion safeExtGet("targetSdkVersion", 33)
|
|
76
76
|
versionCode 21
|
|
77
|
-
versionName '0.
|
|
77
|
+
versionName '0.18.0'
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
lintOptions {
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
package expo.modules.notifications.permissions
|
|
2
|
+
|
|
3
|
+
import android.app.NotificationManager
|
|
4
|
+
import android.content.Context
|
|
5
|
+
import android.os.Build
|
|
6
|
+
import androidx.annotation.RequiresApi
|
|
7
|
+
import androidx.core.app.NotificationManagerCompat
|
|
8
|
+
import androidx.core.os.bundleOf
|
|
9
|
+
import expo.modules.core.ExportedModule
|
|
10
|
+
import expo.modules.core.ModuleRegistry
|
|
11
|
+
import expo.modules.core.Promise
|
|
12
|
+
import expo.modules.core.arguments.ReadableArguments
|
|
13
|
+
import expo.modules.core.interfaces.ExpoMethod
|
|
14
|
+
import expo.modules.interfaces.permissions.Permissions
|
|
15
|
+
import expo.modules.interfaces.permissions.PermissionsResponse
|
|
16
|
+
import expo.modules.interfaces.permissions.PermissionsStatus
|
|
17
|
+
|
|
18
|
+
class NotificationPermissionsModule(context: Context?) : ExportedModule(context) {
|
|
19
|
+
private lateinit var moduleRegistry: ModuleRegistry
|
|
20
|
+
|
|
21
|
+
override fun onCreate(moduleRegistry: ModuleRegistry) {
|
|
22
|
+
this.moduleRegistry = moduleRegistry
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
override fun getName(): String {
|
|
26
|
+
return EXPORTED_NAME
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@ExpoMethod
|
|
30
|
+
fun getPermissionsAsync(promise: Promise) {
|
|
31
|
+
if (context.applicationContext.applicationInfo.targetSdkVersion >= 33 && Build.VERSION.SDK_INT >= 33) {
|
|
32
|
+
getPermissionsWithPromiseImplApi33(promise)
|
|
33
|
+
} else {
|
|
34
|
+
getPermissionsWithPromiseImplClassic(promise)
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@ExpoMethod
|
|
39
|
+
fun requestPermissionsAsync(permissionsTypes: ReadableArguments?, promise: Promise) {
|
|
40
|
+
if (context.applicationContext.applicationInfo.targetSdkVersion >= 33 && Build.VERSION.SDK_INT >= 33) {
|
|
41
|
+
requestPermissionsWithPromiseImplApi33(promise)
|
|
42
|
+
} else {
|
|
43
|
+
getPermissionsWithPromiseImplClassic(promise)
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@RequiresApi(33)
|
|
48
|
+
private fun getPermissionsWithPromiseImplApi33(promise: Promise) {
|
|
49
|
+
val permissionManager = moduleRegistry.getModule(Permissions::class.java)
|
|
50
|
+
if (permissionManager == null) {
|
|
51
|
+
promise.reject("E_NO_PERMISSIONS", "Permissions module is null. Are you sure all the installed Expo modules are properly linked?")
|
|
52
|
+
return
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
permissionManager.getPermissions(
|
|
56
|
+
{ permissionsMap: Map<String, PermissionsResponse> ->
|
|
57
|
+
val managerCompat = NotificationManagerCompat.from(context)
|
|
58
|
+
val areEnabled = managerCompat.areNotificationsEnabled()
|
|
59
|
+
val platformBundle = bundleOf(
|
|
60
|
+
IMPORTANCE_KEY to managerCompat.importance,
|
|
61
|
+
).apply {
|
|
62
|
+
val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
|
63
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && notificationManager != null) {
|
|
64
|
+
putInt(INTERRUPTION_FILTER_KEY, notificationManager.currentInterruptionFilter)
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
val areAllGranted = permissionsMap.all { (_, response) -> response.status == PermissionsStatus.GRANTED }
|
|
69
|
+
val areAllDenied = permissionsMap.all { (_, response) -> response.status == PermissionsStatus.DENIED }
|
|
70
|
+
val canAskAgain = permissionsMap.all { (_, response) -> response.canAskAgain }
|
|
71
|
+
val status = when {
|
|
72
|
+
areAllDenied -> PermissionsStatus.DENIED.status
|
|
73
|
+
!areEnabled -> PermissionsStatus.DENIED.status
|
|
74
|
+
areAllGranted -> PermissionsStatus.GRANTED.status
|
|
75
|
+
else -> PermissionsStatus.UNDETERMINED.status
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
promise.resolve(
|
|
79
|
+
bundleOf(
|
|
80
|
+
PermissionsResponse.EXPIRES_KEY to PermissionsResponse.PERMISSION_EXPIRES_NEVER,
|
|
81
|
+
PermissionsResponse.STATUS_KEY to status,
|
|
82
|
+
PermissionsResponse.CAN_ASK_AGAIN_KEY to canAskAgain,
|
|
83
|
+
PermissionsResponse.GRANTED_KEY to areAllGranted,
|
|
84
|
+
ANDROID_RESPONSE_KEY to platformBundle,
|
|
85
|
+
)
|
|
86
|
+
)
|
|
87
|
+
},
|
|
88
|
+
*PERMISSIONS
|
|
89
|
+
)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
private fun getPermissionsWithPromiseImplClassic(promise: Promise) {
|
|
93
|
+
val managerCompat = NotificationManagerCompat.from(context)
|
|
94
|
+
val areEnabled = managerCompat.areNotificationsEnabled()
|
|
95
|
+
val status = if (areEnabled) PermissionsStatus.GRANTED else PermissionsStatus.DENIED
|
|
96
|
+
val platformBundle = bundleOf(
|
|
97
|
+
IMPORTANCE_KEY to managerCompat.importance,
|
|
98
|
+
).apply {
|
|
99
|
+
val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
|
100
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && notificationManager != null) {
|
|
101
|
+
putInt(INTERRUPTION_FILTER_KEY, notificationManager.currentInterruptionFilter)
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
promise.resolve(
|
|
106
|
+
bundleOf(
|
|
107
|
+
PermissionsResponse.EXPIRES_KEY to PermissionsResponse.PERMISSION_EXPIRES_NEVER,
|
|
108
|
+
PermissionsResponse.STATUS_KEY to status.status,
|
|
109
|
+
PermissionsResponse.CAN_ASK_AGAIN_KEY to areEnabled,
|
|
110
|
+
PermissionsResponse.GRANTED_KEY to (status == PermissionsStatus.GRANTED),
|
|
111
|
+
ANDROID_RESPONSE_KEY to platformBundle,
|
|
112
|
+
)
|
|
113
|
+
)
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@RequiresApi(33)
|
|
117
|
+
private fun requestPermissionsWithPromiseImplApi33(promise: Promise) {
|
|
118
|
+
val permissionManager = moduleRegistry.getModule(Permissions::class.java)
|
|
119
|
+
if (permissionManager == null) {
|
|
120
|
+
promise.reject("E_NO_PERMISSIONS", "Permissions module is null. Are you sure all the installed Expo modules are properly linked?")
|
|
121
|
+
return
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
permissionManager.askForPermissions(
|
|
125
|
+
{
|
|
126
|
+
getPermissionsWithPromiseImplApi33(promise)
|
|
127
|
+
},
|
|
128
|
+
*PERMISSIONS
|
|
129
|
+
)
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
companion object {
|
|
133
|
+
private const val EXPORTED_NAME = "ExpoNotificationPermissionsModule"
|
|
134
|
+
private const val ANDROID_RESPONSE_KEY = "android"
|
|
135
|
+
private const val IMPORTANCE_KEY = "importance"
|
|
136
|
+
private const val INTERRUPTION_FILTER_KEY = "interruptionFilter"
|
|
137
|
+
|
|
138
|
+
private val PERMISSIONS: Array<String>
|
|
139
|
+
/**
|
|
140
|
+
* TODO: Use {@link Android.Manifest.permission.POST_NOTIFICATIONS} when we support compileSdkVersion 33
|
|
141
|
+
*/
|
|
142
|
+
get() = arrayOf("android.permission.POST_NOTIFICATIONS")
|
|
143
|
+
}
|
|
144
|
+
}
|
|
@@ -502,7 +502,7 @@ open class NotificationsService : BroadcastReceiver() {
|
|
|
502
502
|
val notification = intent.getParcelableExtra<Notification>(NOTIFICATION_KEY) ?: throw IllegalArgumentException("$NOTIFICATION_KEY not found in the intent extras.")
|
|
503
503
|
val action = intent.getParcelableExtra<NotificationAction>(NOTIFICATION_ACTION_KEY) ?: throw IllegalArgumentException("$NOTIFICATION_ACTION_KEY not found in the intent extras.")
|
|
504
504
|
val response = if (action is TextInputNotificationAction) {
|
|
505
|
-
val userText = action.placeholder ?: RemoteInput.getResultsFromIntent(intent)
|
|
505
|
+
val userText = action.placeholder ?: RemoteInput.getResultsFromIntent(intent)?.getString(USER_TEXT_RESPONSE_KEY) ?: ""
|
|
506
506
|
TextInputNotificationResponse(action, notification, userText)
|
|
507
507
|
} else {
|
|
508
508
|
NotificationResponse(action, notification)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Options as BadginOptions } from 'badgin';
|
|
2
2
|
import { ProxyNativeModule } from 'expo-modules-core';
|
|
3
|
-
export
|
|
4
|
-
|
|
3
|
+
export type WebSetBadgeCountOptions = BadginOptions;
|
|
4
|
+
type SetBadgeCountOptions = WebSetBadgeCountOptions | undefined;
|
|
5
5
|
export interface BadgeModule extends ProxyNativeModule {
|
|
6
6
|
getBadgeCountAsync?: () => Promise<number>;
|
|
7
7
|
setBadgeCountAsync?: (badgeCount: number, options: SetBadgeCountOptions) => Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeModule.types.d.ts","sourceRoot":"","sources":["../src/BadgeModule.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,
|
|
1
|
+
{"version":3,"file":"BadgeModule.types.d.ts","sourceRoot":"","sources":["../src/BadgeModule.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,MAAM,uBAAuB,GAAG,aAAa,CAAC;AACpD,KAAK,oBAAoB,GAAG,uBAAuB,GAAG,SAAS,CAAC;AAEhE,MAAM,WAAW,WAAY,SAAQ,iBAAiB;IACpD,kBAAkB,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3C,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAC9F"}
|
|
@@ -2,17 +2,14 @@ import 'abort-controller/polyfill';
|
|
|
2
2
|
/**
|
|
3
3
|
* Encapsulates device server registration data
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export type DevicePushTokenRegistration = {
|
|
6
6
|
isEnabled: boolean;
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
9
9
|
* Sets the registration information so that the device push token gets pushed
|
|
10
10
|
* to the given registration endpoint
|
|
11
|
-
* @param
|
|
11
|
+
* @param enabled
|
|
12
12
|
*/
|
|
13
13
|
export declare function setAutoServerRegistrationEnabledAsync(enabled: boolean): Promise<void>;
|
|
14
|
-
/**
|
|
15
|
-
* This function is exported only for testing purposes.
|
|
16
|
-
*/
|
|
17
14
|
export declare function __handlePersistedRegistrationInfoAsync(registrationInfo: string | null | undefined): Promise<void>;
|
|
18
15
|
//# sourceMappingURL=DevicePushTokenAutoRegistration.fx.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevicePushTokenAutoRegistration.fx.d.ts","sourceRoot":"","sources":["../src/DevicePushTokenAutoRegistration.fx.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC;AAiBnC;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"DevicePushTokenAutoRegistration.fx.d.ts","sourceRoot":"","sources":["../src/DevicePushTokenAutoRegistration.fx.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC;AAiBnC;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG;IACxC,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;;;GAIG;AACH,wBAAsB,qCAAqC,CAAC,OAAO,EAAE,OAAO,iBAY3E;AAGD,wBAAsB,sCAAsC,CAC1D,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,iBAiC5C"}
|
|
@@ -14,7 +14,7 @@ async function updatePushTokenAsync(token) {
|
|
|
14
14
|
/**
|
|
15
15
|
* Sets the registration information so that the device push token gets pushed
|
|
16
16
|
* to the given registration endpoint
|
|
17
|
-
* @param
|
|
17
|
+
* @param enabled
|
|
18
18
|
*/
|
|
19
19
|
export async function setAutoServerRegistrationEnabledAsync(enabled) {
|
|
20
20
|
// We are overwriting registration, so we shouldn't let
|
|
@@ -25,9 +25,7 @@ export async function setAutoServerRegistrationEnabledAsync(enabled) {
|
|
|
25
25
|
}
|
|
26
26
|
await ServerRegistrationModule.setRegistrationInfoAsync(enabled ? JSON.stringify({ isEnabled: enabled }) : null);
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
* This function is exported only for testing purposes.
|
|
30
|
-
*/
|
|
28
|
+
// note(Chmiela): This function is exported only for testing purposes.
|
|
31
29
|
export async function __handlePersistedRegistrationInfoAsync(registrationInfo) {
|
|
32
30
|
if (!registrationInfo) {
|
|
33
31
|
// No registration info, nothing to do
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevicePushTokenAutoRegistration.fx.js","sourceRoot":"","sources":["../src/DevicePushTokenAutoRegistration.fx.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,0BAA0B,IAAI,oCAAoC,EAAE,MAAM,oCAAoC,CAAC;AAExH,IAAI,mBAAmB,GAA2B,IAAI,CAAC;AACvD,KAAK,UAAU,oBAAoB,CAAC,KAAsB;IACxD,+BAA+B;IAC/B,mBAAmB,EAAE,KAAK,EAAE,CAAC;IAC7B,mBAAmB,GAAG,IAAI,eAAe,EAAE,CAAC;IAC5C,OAAO,MAAM,oCAAoC,CAAC,mBAAmB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACvF,CAAC;AASD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,qCAAqC,CAAC,OAAgB;IAC1E,uDAAuD;IACvD,gCAAgC;IAChC,mBAAmB,EAAE,KAAK,EAAE,CAAC;IAE7B,IAAI,CAAC,wBAAwB,CAAC,wBAAwB,EAAE;QACtD,MAAM,IAAI,mBAAmB,CAAC,0BAA0B,EAAE,0BAA0B,CAAC,CAAC;KACvF;IAED,MAAM,wBAAwB,CAAC,wBAAwB,CACrD,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CACxD,CAAC;AACJ,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"DevicePushTokenAutoRegistration.fx.js","sourceRoot":"","sources":["../src/DevicePushTokenAutoRegistration.fx.ts"],"names":[],"mappings":"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","sourcesContent":["import 'abort-controller/polyfill';\nimport { UnavailabilityError } from 'expo-modules-core';\n\nimport ServerRegistrationModule from './ServerRegistrationModule';\nimport { addPushTokenListener } from './TokenEmitter';\nimport { DevicePushToken } from './Tokens.types';\nimport getDevicePushTokenAsync from './getDevicePushTokenAsync';\nimport { updateDevicePushTokenAsync as updateDevicePushTokenAsyncWithSignal } from './utils/updateDevicePushTokenAsync';\n\nlet lastAbortController: AbortController | null = null;\nasync function updatePushTokenAsync(token: DevicePushToken) {\n // Abort current update process\n lastAbortController?.abort();\n lastAbortController = new AbortController();\n return await updateDevicePushTokenAsyncWithSignal(lastAbortController.signal, token);\n}\n\n/**\n * Encapsulates device server registration data\n */\nexport type DevicePushTokenRegistration = {\n isEnabled: boolean;\n};\n\n/**\n * Sets the registration information so that the device push token gets pushed\n * to the given registration endpoint\n * @param enabled\n */\nexport async function setAutoServerRegistrationEnabledAsync(enabled: boolean) {\n // We are overwriting registration, so we shouldn't let\n // any pending request complete.\n lastAbortController?.abort();\n\n if (!ServerRegistrationModule.setRegistrationInfoAsync) {\n throw new UnavailabilityError('ServerRegistrationModule', 'setRegistrationInfoAsync');\n }\n\n await ServerRegistrationModule.setRegistrationInfoAsync(\n enabled ? JSON.stringify({ isEnabled: enabled }) : null\n );\n}\n\n// note(Chmiela): This function is exported only for testing purposes.\nexport async function __handlePersistedRegistrationInfoAsync(\n registrationInfo: string | null | undefined\n) {\n if (!registrationInfo) {\n // No registration info, nothing to do\n return;\n }\n\n let registration: DevicePushTokenRegistration | null = null;\n try {\n registration = JSON.parse(registrationInfo);\n } catch (e) {\n console.warn(\n '[expo-notifications] Error encountered while fetching registration information for auto token updates.',\n e\n );\n }\n\n if (!registration?.isEnabled) {\n // Registration is invalid or not enabled, nothing more to do\n return;\n }\n\n try {\n // Since the registration is enabled, fetching a \"new\" device token\n // shouldn't be a problem.\n const latestDevicePushToken = await getDevicePushTokenAsync();\n await updatePushTokenAsync(latestDevicePushToken);\n } catch (e) {\n console.warn(\n '[expo-notifications] Error encountered while updating server registration with latest device push token.',\n e\n );\n }\n}\n\nif (ServerRegistrationModule.getRegistrationInfoAsync) {\n // A global scope (to get all the updates) device push token\n // subscription, never cleared.\n addPushTokenListener(async (token) => {\n try {\n // Before updating the push token on server we always check if we should\n // Since modules can't change their method availability while running, we\n // can assert it's defined.\n const registrationInfo = await ServerRegistrationModule.getRegistrationInfoAsync!();\n\n if (!registrationInfo) {\n // Registration is not enabled\n return;\n }\n\n const registration: DevicePushTokenRegistration | null = JSON.parse(registrationInfo);\n if (registration?.isEnabled) {\n // Dispatch an abortable task to update\n // registration with new token.\n await updatePushTokenAsync(token);\n }\n } catch (e) {\n console.warn(\n '[expo-notifications] Error encountered while updating server registration with latest device push token.',\n e\n );\n }\n });\n\n // Verify if persisted registration\n // has successfully uploaded last known\n // device push token. If not, retry.\n ServerRegistrationModule.getRegistrationInfoAsync().then(__handlePersistedRegistrationInfoAsync);\n} else {\n console.warn(\n `[expo-notifications] Error encountered while fetching auto-registration state, new tokens will not be automatically registered on server.`,\n new UnavailabilityError('ServerRegistrationModule', 'getRegistrationInfoAsync')\n );\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NotificationAction } from './Notifications.types';
|
|
2
2
|
declare const _default: {
|
|
3
3
|
getNotificationCategoriesAsync(): Promise<null>;
|
|
4
|
-
setNotificationCategoryAsync(identifier: string, actions: NotificationAction[], options?: object
|
|
4
|
+
setNotificationCategoryAsync(identifier: string, actions: NotificationAction[], options?: object): Promise<null>;
|
|
5
5
|
deleteNotificationCategoryAsync(identifier: string): Promise<null>;
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationCategoriesModule.web.d.ts","sourceRoot":"","sources":["../src/NotificationCategoriesModule.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;;sCAGjB,QAAQ,IAAI,CAAC;6CAIvC,MAAM,WACT,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"NotificationCategoriesModule.web.d.ts","sourceRoot":"","sources":["../src/NotificationCategoriesModule.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;;sCAGjB,QAAQ,IAAI,CAAC;6CAIvC,MAAM,WACT,kBAAkB,EAAE,YACnB,MAAM,GACf,QAAQ,IAAI,CAAC;gDAGkC,MAAM,GAAG,QAAQ,IAAI,CAAC;;AAX1E,wBAcE"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { ProxyNativeModule } from 'expo-modules-core';
|
|
2
2
|
import { NotificationChannel } from './NotificationChannelManager.types';
|
|
3
|
+
/**
|
|
4
|
+
* An object represents a notification channel group.
|
|
5
|
+
* @platform android
|
|
6
|
+
*/
|
|
3
7
|
export interface NotificationChannelGroup {
|
|
4
8
|
id: string;
|
|
5
9
|
name: string | null;
|
|
@@ -7,6 +11,10 @@ export interface NotificationChannelGroup {
|
|
|
7
11
|
isBlocked?: boolean;
|
|
8
12
|
channels: NotificationChannel[];
|
|
9
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* An object represents a notification channel group to be set.
|
|
16
|
+
* @platform android
|
|
17
|
+
*/
|
|
10
18
|
export interface NotificationChannelGroupInput {
|
|
11
19
|
name: string | null;
|
|
12
20
|
description?: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationChannelGroupManager.types.d.ts","sourceRoot":"","sources":["../src/NotificationChannelGroupManager.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAEzE,MAAM,WAAW,wBAAwB;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,mBAAmB,EAAE,CAAC;CACjC;AAED,MAAM,WAAW,6BAA6B;IAC5C,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,+BAAgC,SAAQ,iBAAiB;IACxE,iCAAiC,CAAC,EAAE,MAAM,OAAO,CAAC,wBAAwB,EAAE,CAAC,CAAC;IAC9E,gCAAgC,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC,CAAC;IACjG,gCAAgC,CAAC,EAAE,CACjC,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,6BAA6B,KACjC,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC,CAAC;IAC9C,mCAAmC,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1E"}
|
|
1
|
+
{"version":3,"file":"NotificationChannelGroupManager.types.d.ts","sourceRoot":"","sources":["../src/NotificationChannelGroupManager.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAEzE;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,mBAAmB,EAAE,CAAC;CACjC;AAED;;;GAGG;AACH,MAAM,WAAW,6BAA6B;IAC5C,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,+BAAgC,SAAQ,iBAAiB;IACxE,iCAAiC,CAAC,EAAE,MAAM,OAAO,CAAC,wBAAwB,EAAE,CAAC,CAAC;IAC9E,gCAAgC,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC,CAAC;IACjG,gCAAgC,CAAC,EAAE,CACjC,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,6BAA6B,KACjC,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC,CAAC;IAC9C,mCAAmC,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationChannelGroupManager.types.js","sourceRoot":"","sources":["../src/NotificationChannelGroupManager.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ProxyNativeModule } from 'expo-modules-core';\n\nimport { NotificationChannel } from './NotificationChannelManager.types';\n\nexport interface NotificationChannelGroup {\n id: string;\n name: string | null;\n description?: string | null;\n isBlocked?: boolean;\n channels: NotificationChannel[];\n}\n\nexport interface NotificationChannelGroupInput {\n name: string | null;\n description?: string | null;\n}\n\nexport interface NotificationChannelGroupManager extends ProxyNativeModule {\n getNotificationChannelGroupsAsync?: () => Promise<NotificationChannelGroup[]>;\n getNotificationChannelGroupAsync?: (groupId: string) => Promise<NotificationChannelGroup | null>;\n setNotificationChannelGroupAsync?: (\n groupId: string,\n group: NotificationChannelGroupInput\n ) => Promise<NotificationChannelGroup | null>;\n deleteNotificationChannelGroupAsync?: (groupId: string) => Promise<void>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"NotificationChannelGroupManager.types.js","sourceRoot":"","sources":["../src/NotificationChannelGroupManager.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ProxyNativeModule } from 'expo-modules-core';\n\nimport { NotificationChannel } from './NotificationChannelManager.types';\n\n/**\n * An object represents a notification channel group.\n * @platform android\n */\nexport interface NotificationChannelGroup {\n id: string;\n name: string | null;\n description?: string | null;\n isBlocked?: boolean;\n channels: NotificationChannel[];\n}\n\n/**\n * An object represents a notification channel group to be set.\n * @platform android\n */\nexport interface NotificationChannelGroupInput {\n name: string | null;\n description?: string | null;\n}\n\nexport interface NotificationChannelGroupManager extends ProxyNativeModule {\n getNotificationChannelGroupsAsync?: () => Promise<NotificationChannelGroup[]>;\n getNotificationChannelGroupAsync?: (groupId: string) => Promise<NotificationChannelGroup | null>;\n setNotificationChannelGroupAsync?: (\n groupId: string,\n group: NotificationChannelGroupInput\n ) => Promise<NotificationChannelGroup | null>;\n deleteNotificationChannelGroupAsync?: (groupId: string) => Promise<void>;\n}\n"]}
|
|
@@ -19,7 +19,9 @@ export declare enum AndroidImportance {
|
|
|
19
19
|
MIN = 3,
|
|
20
20
|
LOW = 4,
|
|
21
21
|
DEFAULT = 5,
|
|
22
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated Use `DEFAULT` instead.
|
|
24
|
+
*/
|
|
23
25
|
DEEFAULT = 5,
|
|
24
26
|
HIGH = 6,
|
|
25
27
|
MAX = 7
|
|
@@ -49,7 +51,11 @@ export interface AudioAttributes {
|
|
|
49
51
|
requestHardwareAudioVideoSynchronization: boolean;
|
|
50
52
|
};
|
|
51
53
|
}
|
|
52
|
-
export
|
|
54
|
+
export type AudioAttributesInput = Partial<AudioAttributes>;
|
|
55
|
+
/**
|
|
56
|
+
* An object represents a notification channel.
|
|
57
|
+
* @platform android
|
|
58
|
+
*/
|
|
53
59
|
export interface NotificationChannel {
|
|
54
60
|
id: string;
|
|
55
61
|
name: string | null;
|
|
@@ -66,8 +72,12 @@ export interface NotificationChannel {
|
|
|
66
72
|
enableLights: boolean;
|
|
67
73
|
enableVibrate: boolean;
|
|
68
74
|
}
|
|
69
|
-
|
|
70
|
-
|
|
75
|
+
type RequiredBy<T, K extends keyof T> = Partial<Omit<T, K>> & Required<Pick<T, K>>;
|
|
76
|
+
/**
|
|
77
|
+
* An object represents a notification channel to be set.
|
|
78
|
+
* @platform android
|
|
79
|
+
*/
|
|
80
|
+
export type NotificationChannelInput = RequiredBy<Omit<NotificationChannel, 'id' | 'audioAttributes' | 'sound'> & {
|
|
71
81
|
audioAttributes?: AudioAttributesInput;
|
|
72
82
|
sound?: string | null;
|
|
73
83
|
}, 'name' | 'importance'>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationChannelManager.types.d.ts","sourceRoot":"","sources":["../src/NotificationChannelManager.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"NotificationChannelManager.types.d.ts","sourceRoot":"","sources":["../src/NotificationChannelManager.types.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @docsMissing
|
|
1
2
|
export var AndroidNotificationVisibility;
|
|
2
3
|
(function (AndroidNotificationVisibility) {
|
|
3
4
|
AndroidNotificationVisibility[AndroidNotificationVisibility["UNKNOWN"] = 0] = "UNKNOWN";
|
|
@@ -5,6 +6,7 @@ export var AndroidNotificationVisibility;
|
|
|
5
6
|
AndroidNotificationVisibility[AndroidNotificationVisibility["PRIVATE"] = 2] = "PRIVATE";
|
|
6
7
|
AndroidNotificationVisibility[AndroidNotificationVisibility["SECRET"] = 3] = "SECRET";
|
|
7
8
|
})(AndroidNotificationVisibility || (AndroidNotificationVisibility = {}));
|
|
9
|
+
// @docsMissing
|
|
8
10
|
export var AndroidAudioContentType;
|
|
9
11
|
(function (AndroidAudioContentType) {
|
|
10
12
|
AndroidAudioContentType[AndroidAudioContentType["UNKNOWN"] = 0] = "UNKNOWN";
|
|
@@ -13,6 +15,7 @@ export var AndroidAudioContentType;
|
|
|
13
15
|
AndroidAudioContentType[AndroidAudioContentType["MOVIE"] = 3] = "MOVIE";
|
|
14
16
|
AndroidAudioContentType[AndroidAudioContentType["SONIFICATION"] = 4] = "SONIFICATION";
|
|
15
17
|
})(AndroidAudioContentType || (AndroidAudioContentType = {}));
|
|
18
|
+
// @docsMissing
|
|
16
19
|
export var AndroidImportance;
|
|
17
20
|
(function (AndroidImportance) {
|
|
18
21
|
AndroidImportance[AndroidImportance["UNKNOWN"] = 0] = "UNKNOWN";
|
|
@@ -21,11 +24,14 @@ export var AndroidImportance;
|
|
|
21
24
|
AndroidImportance[AndroidImportance["MIN"] = 3] = "MIN";
|
|
22
25
|
AndroidImportance[AndroidImportance["LOW"] = 4] = "LOW";
|
|
23
26
|
AndroidImportance[AndroidImportance["DEFAULT"] = 5] = "DEFAULT";
|
|
24
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated Use `DEFAULT` instead.
|
|
29
|
+
*/
|
|
25
30
|
AndroidImportance[AndroidImportance["DEEFAULT"] = 5] = "DEEFAULT";
|
|
26
31
|
AndroidImportance[AndroidImportance["HIGH"] = 6] = "HIGH";
|
|
27
32
|
AndroidImportance[AndroidImportance["MAX"] = 7] = "MAX";
|
|
28
33
|
})(AndroidImportance || (AndroidImportance = {}));
|
|
34
|
+
// @docsMissing
|
|
29
35
|
export var AndroidAudioUsage;
|
|
30
36
|
(function (AndroidAudioUsage) {
|
|
31
37
|
AndroidAudioUsage[AndroidAudioUsage["UNKNOWN"] = 0] = "UNKNOWN";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationChannelManager.types.js","sourceRoot":"","sources":["../src/NotificationChannelManager.types.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,6BAKX;AALD,WAAY,6BAA6B;IACvC,uFAAW,CAAA;IACX,qFAAU,CAAA;IACV,uFAAW,CAAA;IACX,qFAAU,CAAA;AACZ,CAAC,EALW,6BAA6B,KAA7B,6BAA6B,QAKxC;AAED,MAAM,CAAN,IAAY,uBAMX;AAND,WAAY,uBAAuB;IACjC,2EAAW,CAAA;IACX,yEAAU,CAAA;IACV,uEAAS,CAAA;IACT,uEAAS,CAAA;IACT,qFAAgB,CAAA;AAClB,CAAC,EANW,uBAAuB,KAAvB,uBAAuB,QAMlC;AAED,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"NotificationChannelManager.types.js","sourceRoot":"","sources":["../src/NotificationChannelManager.types.ts"],"names":[],"mappings":"AAEA,eAAe;AACf,MAAM,CAAN,IAAY,6BAKX;AALD,WAAY,6BAA6B;IACvC,uFAAW,CAAA;IACX,qFAAU,CAAA;IACV,uFAAW,CAAA;IACX,qFAAU,CAAA;AACZ,CAAC,EALW,6BAA6B,KAA7B,6BAA6B,QAKxC;AAED,eAAe;AACf,MAAM,CAAN,IAAY,uBAMX;AAND,WAAY,uBAAuB;IACjC,2EAAW,CAAA;IACX,yEAAU,CAAA;IACV,uEAAS,CAAA;IACT,uEAAS,CAAA;IACT,qFAAgB,CAAA;AAClB,CAAC,EANW,uBAAuB,KAAvB,uBAAuB,QAMlC;AAED,eAAe;AACf,MAAM,CAAN,IAAY,iBAaX;AAbD,WAAY,iBAAiB;IAC3B,+DAAW,CAAA;IACX,uEAAe,CAAA;IACf,yDAAQ,CAAA;IACR,uDAAO,CAAA;IACP,uDAAO,CAAA;IACP,+DAAW,CAAA;IACX;;OAEG;IACH,iEAAY,CAAA;IACZ,yDAAQ,CAAA;IACR,uDAAO,CAAA;AACT,CAAC,EAbW,iBAAiB,KAAjB,iBAAiB,QAa5B;AAED,eAAe;AACf,MAAM,CAAN,IAAY,iBAgBX;AAhBD,WAAY,iBAAiB;IAC3B,+DAAW,CAAA;IACX,2DAAS,CAAA;IACT,uFAAuB,CAAA;IACvB,6GAAkC,CAAA;IAClC,2DAAS,CAAA;IACT,yEAAgB,CAAA;IAChB,2FAAyB,CAAA;IACzB,qHAAsC,CAAA;IACtC,qHAAsC,CAAA;IACtC,qHAAsC,CAAA;IACtC,sFAAuB,CAAA;IACvB,kGAA6B,CAAA;IAC7B,8GAAmC,CAAA;IACnC,gGAA4B,CAAA;IAC5B,0DAAS,CAAA;AACX,CAAC,EAhBW,iBAAiB,KAAjB,iBAAiB,QAgB5B","sourcesContent":["import { ProxyNativeModule } from 'expo-modules-core';\n\n// @docsMissing\nexport enum AndroidNotificationVisibility {\n UNKNOWN = 0,\n PUBLIC = 1,\n PRIVATE = 2,\n SECRET = 3,\n}\n\n// @docsMissing\nexport enum AndroidAudioContentType {\n UNKNOWN = 0,\n SPEECH = 1,\n MUSIC = 2,\n MOVIE = 3,\n SONIFICATION = 4,\n}\n\n// @docsMissing\nexport enum AndroidImportance {\n UNKNOWN = 0,\n UNSPECIFIED = 1,\n NONE = 2,\n MIN = 3,\n LOW = 4,\n DEFAULT = 5,\n /**\n * @deprecated Use `DEFAULT` instead.\n */\n DEEFAULT = 5,\n HIGH = 6,\n MAX = 7,\n}\n\n// @docsMissing\nexport enum AndroidAudioUsage {\n UNKNOWN = 0,\n MEDIA = 1,\n VOICE_COMMUNICATION = 2,\n VOICE_COMMUNICATION_SIGNALLING = 3,\n ALARM = 4,\n NOTIFICATION = 5,\n NOTIFICATION_RINGTONE = 6,\n NOTIFICATION_COMMUNICATION_REQUEST = 7,\n NOTIFICATION_COMMUNICATION_INSTANT = 8,\n NOTIFICATION_COMMUNICATION_DELAYED = 9,\n NOTIFICATION_EVENT = 10,\n ASSISTANCE_ACCESSIBILITY = 11,\n ASSISTANCE_NAVIGATION_GUIDANCE = 12,\n ASSISTANCE_SONIFICATION = 13,\n GAME = 14,\n}\n\n// @docsMissing\nexport interface AudioAttributes {\n usage: AndroidAudioUsage;\n contentType: AndroidAudioContentType;\n flags: {\n enforceAudibility: boolean;\n requestHardwareAudioVideoSynchronization: boolean;\n };\n}\n\n// We're making inner flags required to set intentionally.\n// Not providing `true` for a flag makes it false, it doesn't make sense\n// to let it be left undefined.\nexport type AudioAttributesInput = Partial<AudioAttributes>;\n\n/**\n * An object represents a notification channel.\n * @platform android\n */\nexport interface NotificationChannel {\n id: string;\n name: string | null;\n importance: AndroidImportance;\n bypassDnd: boolean;\n description: string | null;\n groupId?: string | null;\n lightColor: string;\n lockscreenVisibility: AndroidNotificationVisibility;\n showBadge: boolean;\n sound: 'default' | 'custom' | null;\n audioAttributes: AudioAttributes;\n vibrationPattern: number[] | null;\n enableLights: boolean;\n enableVibrate: boolean;\n}\n\ntype RequiredBy<T, K extends keyof T> = Partial<Omit<T, K>> & Required<Pick<T, K>>;\n\n/**\n * An object represents a notification channel to be set.\n * @platform android\n */\nexport type NotificationChannelInput = RequiredBy<\n Omit<\n NotificationChannel,\n | 'id' // id is handled separately as a function argument\n | 'audioAttributes' // need to make it AudioAttributesInput\n | 'sound'\n > & { audioAttributes?: AudioAttributesInput; sound?: string | null },\n 'name' | 'importance'\n>;\n\nexport interface NotificationChannelManager extends ProxyNativeModule {\n getNotificationChannelsAsync?: () => Promise<NotificationChannel[] | null>;\n getNotificationChannelAsync?: (channelId: string) => Promise<NotificationChannel | null>;\n setNotificationChannelAsync?: (\n channelId: string,\n channelConfiguration: NotificationChannelInput\n ) => Promise<NotificationChannel | null>;\n deleteNotificationChannelAsync?: (channelId: string) => Promise<void>;\n}\n"]}
|
|
@@ -1,14 +1,56 @@
|
|
|
1
1
|
import { NotificationPermissionsRequest, NotificationPermissionsStatus } from './NotificationPermissions.types';
|
|
2
|
+
/**
|
|
3
|
+
* Calling this function checks current permissions settings related to notifications.
|
|
4
|
+
* It lets you verify whether the app is currently allowed to display alerts, play sounds, etc.
|
|
5
|
+
* There is no user-facing effect of calling this.
|
|
6
|
+
* @return It returns a `Promise` resolving to an object represents permission settings ([`NotificationPermissionsStatus`](#notificationpermissionsstatus)).
|
|
7
|
+
* On iOS, make sure you [properly interpret the permissions response](#interpreting-the-ios-permissions-response).
|
|
8
|
+
* @example Check if the app is allowed to send any type of notifications (interrupting and non-interrupting–provisional on iOS).
|
|
9
|
+
* ```ts
|
|
10
|
+
* import * as Notifications from 'expo-notifications';
|
|
11
|
+
*
|
|
12
|
+
* export async function allowsNotificationsAsync() {
|
|
13
|
+
* const settings = await Notifications.getPermissionsAsync();
|
|
14
|
+
* return (
|
|
15
|
+
* settings.granted || settings.ios?.status === Notifications.IosAuthorizationStatus.PROVISIONAL
|
|
16
|
+
* );
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
* @header permissions
|
|
20
|
+
*/
|
|
2
21
|
export declare function getPermissionsAsync(): Promise<NotificationPermissionsStatus>;
|
|
22
|
+
/**
|
|
23
|
+
* Prompts the user for notification permissions according to request. **Request defaults to asking the user to allow displaying alerts,
|
|
24
|
+
* setting badge count and playing sounds**.
|
|
25
|
+
* @param permissions An object representing configuration for the request scope.
|
|
26
|
+
* @return It returns a Promise resolving to an object represents permission settings ([`NotificationPermissionsStatus`](#notificationpermissionsstatus)).
|
|
27
|
+
* On iOS, make sure you [properly interpret the permissions response](#interpreting-the-ios-permissions-response).
|
|
28
|
+
* @example Prompts the user to allow the app to show alerts, play sounds, set badge count and let Siri read out messages through AirPods.
|
|
29
|
+
* ```ts
|
|
30
|
+
* import * as Notifications from 'expo-notifications';
|
|
31
|
+
*
|
|
32
|
+
* export function requestPermissionsAsync() {
|
|
33
|
+
* return await Notifications.requestPermissionsAsync({
|
|
34
|
+
* ios: {
|
|
35
|
+
* allowAlert: true,
|
|
36
|
+
* allowBadge: true,
|
|
37
|
+
* allowSound: true,
|
|
38
|
+
* allowAnnouncements: true,
|
|
39
|
+
* },
|
|
40
|
+
* });
|
|
41
|
+
* }
|
|
42
|
+
* ```
|
|
43
|
+
* @header permissions
|
|
44
|
+
*/
|
|
3
45
|
export declare function requestPermissionsAsync(permissions?: NotificationPermissionsRequest): Promise<NotificationPermissionsStatus>;
|
|
4
46
|
/**
|
|
5
47
|
* Check or request permissions to send and receive push notifications.
|
|
6
48
|
* This uses both `requestPermissionsAsync` and `getPermissionsAsync` to interact with the permissions.
|
|
7
|
-
*
|
|
8
49
|
* @example
|
|
9
50
|
* ```ts
|
|
10
|
-
* const [
|
|
51
|
+
* const [permissionResponse, requestPermission] = Notifications.usePermissions();
|
|
11
52
|
* ```
|
|
53
|
+
* @header permission
|
|
12
54
|
*/
|
|
13
55
|
export declare const usePermissions: (options?: import("expo-modules-core").PermissionHookOptions<NotificationPermissionsRequest> | undefined) => [NotificationPermissionsStatus | null, () => Promise<NotificationPermissionsStatus>, () => Promise<NotificationPermissionsStatus>];
|
|
14
56
|
//# sourceMappingURL=NotificationPermissions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationPermissions.d.ts","sourceRoot":"","sources":["../src/NotificationPermissions.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,8BAA8B,EAC9B,6BAA6B,EAC9B,MAAM,iCAAiC,CAAC;AAGzC,wBAAsB,mBAAmB,2CAMxC;AAED,wBAAsB,uBAAuB,CAAC,WAAW,CAAC,EAAE,8BAA8B,0CAczF;AAGD;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,iPAMzB,CAAC"}
|
|
1
|
+
{"version":3,"file":"NotificationPermissions.d.ts","sourceRoot":"","sources":["../src/NotificationPermissions.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,8BAA8B,EAC9B,6BAA6B,EAC9B,MAAM,iCAAiC,CAAC;AAGzC;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,mBAAmB,2CAMxC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,uBAAuB,CAAC,WAAW,CAAC,EAAE,8BAA8B,0CAczF;AAGD;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,iPAMzB,CAAC"}
|