expo-notifications 0.15.4 → 0.16.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 +4 -9
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/notifications/notifications/presentation/builders/CategoryAwareNotificationBuilder.java +4 -0
- package/android/src/main/java/expo/modules/notifications/service/NotificationsService.kt +1 -1
- package/ios/EXNotifications.xcframework/Info.plist +5 -5
- 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/package.json +5 -5
- package/plugin/build/withNotifications.d.ts +6 -3
- package/plugin/src/withNotifications.ts +6 -3
- package/tsconfig.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,26 +10,21 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
-
## 0.
|
|
13
|
+
## 0.16.0 — 2022-07-07
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
### 🛠 Breaking changes
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
- [android] Set the "notification number" (sometimes used to increment badge count on some launchers) from the notification payload `badge` field. ([#17171](https://github.com/expo/expo/pull/17171) by [@danstepanov](https://github.com/danstepanov))
|
|
18
18
|
|
|
19
19
|
### 🐛 Bug fixes
|
|
20
20
|
|
|
21
|
+
- Fixed Android 12+ runtime crash caused by `PendingIntent` misconfiguration. ([#17333](https://github.com/expo/expo/pull/17333) by [@kudo](https://github.com/kudo))
|
|
21
22
|
- Fix app not bringing to foreground when clicking notification on Android 12+. ([#17686](https://github.com/expo/expo/pull/17686) by [@kudo](https://github.com/kudo))
|
|
22
23
|
- Fixed Android data-only FCM notifications (i.e. notifications without a title and message) appearing in the notification drawer ([#17707](https://github.com/expo/expo/pull/17707) by [@sausti](https://github.com/sausti))
|
|
23
24
|
- Add support for unregistering from push notifications on Android and iOS ([#17812](https://github.com/expo/expo/pull/17812) by [@sausti](https://github.com/sausti))
|
|
24
25
|
- Fix another Android 12+ trampoline issue from push notifications. ([#17871](https://github.com/expo/expo/pull/17871) by [@kudo](https://github.com/kudo))
|
|
25
26
|
- Fixed `useLastNotificationResponse` returns latest received notification but not the clicked notification on Android. ([#17974](https://github.com/expo/expo/pull/17974) by [@kudo](https://github.com/kudo))
|
|
26
27
|
|
|
27
|
-
## 0.15.2 — 2022-05-05
|
|
28
|
-
|
|
29
|
-
### 🐛 Bug fixes
|
|
30
|
-
|
|
31
|
-
- Fixed Android 12+ runtime crash caused by `PendingIntent` misconfiguration. ([#17333](https://github.com/expo/expo/pull/17333) by [@kudo](https://github.com/kudo))
|
|
32
|
-
|
|
33
28
|
### ⚠️ Notices
|
|
34
29
|
|
|
35
30
|
- Fixed exception on Android 12+ devices for missing `SCHEDULE_EXACT_ALARM` permission. If `scheduleNotificationAsync` needs a precise timer, the `SCHEDULE_EXACT_ALARM` should be explicitly added to **AndroidManifest.xml**. ([#17334](https://github.com/expo/expo/pull/17334) by [@kudo](https://github.com/kudo))
|
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.16.0'
|
|
7
7
|
|
|
8
8
|
buildscript {
|
|
9
9
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
@@ -74,7 +74,7 @@ android {
|
|
|
74
74
|
minSdkVersion safeExtGet("minSdkVersion", 21)
|
|
75
75
|
targetSdkVersion safeExtGet("targetSdkVersion", 31)
|
|
76
76
|
versionCode 21
|
|
77
|
-
versionName '0.
|
|
77
|
+
versionName '0.16.0'
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
lintOptions {
|
|
@@ -36,6 +36,10 @@ public class CategoryAwareNotificationBuilder extends ExpoNotificationBuilder {
|
|
|
36
36
|
if (categoryIdentifier != null) {
|
|
37
37
|
addActionsToBuilder(builder, categoryIdentifier);
|
|
38
38
|
}
|
|
39
|
+
|
|
40
|
+
if (content.getBadgeCount() != null) {
|
|
41
|
+
builder.setNumber(content.getBadgeCount().intValue());
|
|
42
|
+
}
|
|
39
43
|
|
|
40
44
|
return builder;
|
|
41
45
|
}
|
|
@@ -454,7 +454,7 @@ open class NotificationsService : BroadcastReceiver() {
|
|
|
454
454
|
// [notification trampolines](https://developer.android.com/about/versions/12/behavior-changes-12#identify-notification-trampolines)
|
|
455
455
|
// are not allowed. If the notification wants to open foreground app,
|
|
456
456
|
// we should use the dedicated Activity pendingIntent.
|
|
457
|
-
if (
|
|
457
|
+
if (action.opensAppToForeground()) {
|
|
458
458
|
val notificationResponse = getNotificationResponseFromBroadcastIntent(intent)
|
|
459
459
|
return ExpoHandlingDelegate.createPendingIntentForOpeningApp(context, intent, notificationResponse)
|
|
460
460
|
}
|
|
@@ -6,30 +6,30 @@
|
|
|
6
6
|
<array>
|
|
7
7
|
<dict>
|
|
8
8
|
<key>LibraryIdentifier</key>
|
|
9
|
-
<string>ios-
|
|
9
|
+
<string>ios-arm64</string>
|
|
10
10
|
<key>LibraryPath</key>
|
|
11
11
|
<string>EXNotifications.framework</string>
|
|
12
12
|
<key>SupportedArchitectures</key>
|
|
13
13
|
<array>
|
|
14
14
|
<string>arm64</string>
|
|
15
|
-
<string>x86_64</string>
|
|
16
15
|
</array>
|
|
17
16
|
<key>SupportedPlatform</key>
|
|
18
17
|
<string>ios</string>
|
|
19
|
-
<key>SupportedPlatformVariant</key>
|
|
20
|
-
<string>simulator</string>
|
|
21
18
|
</dict>
|
|
22
19
|
<dict>
|
|
23
20
|
<key>LibraryIdentifier</key>
|
|
24
|
-
<string>ios-
|
|
21
|
+
<string>ios-arm64_x86_64-simulator</string>
|
|
25
22
|
<key>LibraryPath</key>
|
|
26
23
|
<string>EXNotifications.framework</string>
|
|
27
24
|
<key>SupportedArchitectures</key>
|
|
28
25
|
<array>
|
|
29
26
|
<string>arm64</string>
|
|
27
|
+
<string>x86_64</string>
|
|
30
28
|
</array>
|
|
31
29
|
<key>SupportedPlatform</key>
|
|
32
30
|
<string>ios</string>
|
|
31
|
+
<key>SupportedPlatformVariant</key>
|
|
32
|
+
<string>simulator</string>
|
|
33
33
|
</dict>
|
|
34
34
|
</array>
|
|
35
35
|
<key>CFBundlePackageType</key>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-notifications",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Notifications module",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -37,14 +37,14 @@
|
|
|
37
37
|
"preset": "expo-module-scripts/ios"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@expo/config-plugins": "
|
|
40
|
+
"@expo/config-plugins": "~5.0.0",
|
|
41
41
|
"@expo/image-utils": "^0.3.18",
|
|
42
42
|
"@ide/backoff": "^1.0.0",
|
|
43
43
|
"abort-controller": "^3.0.0",
|
|
44
44
|
"assert": "^2.0.0",
|
|
45
45
|
"badgin": "^1.1.5",
|
|
46
|
-
"expo-application": "~4.
|
|
47
|
-
"expo-constants": "~13.
|
|
46
|
+
"expo-application": "~4.2.0",
|
|
47
|
+
"expo-constants": "~13.2.0",
|
|
48
48
|
"fs-extra": "^9.1.0",
|
|
49
49
|
"uuid": "^3.4.0"
|
|
50
50
|
},
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"expo": "*"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "6e131f2da851a47c3a24eb3d6fc971a1a7822086"
|
|
62
62
|
}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { ConfigPlugin } from '@expo/config-plugins';
|
|
2
2
|
export declare type NotificationsPluginProps = {
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Local path to an image to use as the icon for push notifications.
|
|
5
5
|
* 96x96 all-white png with transparency. We recommend following
|
|
6
6
|
* [Google's design guidelines](https://material.io/design/iconography/product-icons.html#design-principles).
|
|
7
|
+
* @platform android
|
|
7
8
|
*/
|
|
8
9
|
icon?: string;
|
|
9
10
|
/**
|
|
10
|
-
*
|
|
11
|
+
* Tint color for the push notification image when it appears in the notification tray.
|
|
11
12
|
* @default '#ffffff'
|
|
13
|
+
* @platform android
|
|
12
14
|
*/
|
|
13
15
|
color?: string;
|
|
14
16
|
/**
|
|
@@ -16,8 +18,9 @@ export declare type NotificationsPluginProps = {
|
|
|
16
18
|
*/
|
|
17
19
|
sounds?: string[];
|
|
18
20
|
/**
|
|
19
|
-
*
|
|
21
|
+
* Environment of the app: either 'development' or 'production'.
|
|
20
22
|
* @default 'development'
|
|
23
|
+
* @platform ios
|
|
21
24
|
*/
|
|
22
25
|
mode?: 'development' | 'production';
|
|
23
26
|
};
|
|
@@ -7,14 +7,16 @@ const pkg = require('expo-notifications/package.json');
|
|
|
7
7
|
|
|
8
8
|
export type NotificationsPluginProps = {
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Local path to an image to use as the icon for push notifications.
|
|
11
11
|
* 96x96 all-white png with transparency. We recommend following
|
|
12
12
|
* [Google's design guidelines](https://material.io/design/iconography/product-icons.html#design-principles).
|
|
13
|
+
* @platform android
|
|
13
14
|
*/
|
|
14
15
|
icon?: string;
|
|
15
16
|
/**
|
|
16
|
-
*
|
|
17
|
+
* Tint color for the push notification image when it appears in the notification tray.
|
|
17
18
|
* @default '#ffffff'
|
|
19
|
+
* @platform android
|
|
18
20
|
*/
|
|
19
21
|
color?: string;
|
|
20
22
|
/**
|
|
@@ -22,8 +24,9 @@ export type NotificationsPluginProps = {
|
|
|
22
24
|
*/
|
|
23
25
|
sounds?: string[];
|
|
24
26
|
/**
|
|
25
|
-
*
|
|
27
|
+
* Environment of the app: either 'development' or 'production'.
|
|
26
28
|
* @default 'development'
|
|
29
|
+
* @platform ios
|
|
27
30
|
*/
|
|
28
31
|
mode?: 'development' | 'production';
|
|
29
32
|
};
|
package/tsconfig.json
CHANGED