@capacitor/push-notifications 6.0.3 → 7.0.0-alpha.2
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/CapacitorPushNotifications.podspec +1 -1
- package/Package.swift +2 -2
- package/README.md +7 -1
- package/android/build.gradle +10 -10
- package/android/src/main/java/com/capacitorjs/plugins/pushnotifications/PushNotificationsPlugin.java +17 -19
- package/dist/plugin.cjs.js +0 -2
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +0 -2
- package/dist/plugin.js.map +1 -1
- package/package.json +10 -10
|
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
|
|
|
11
11
|
s.author = package['author']
|
|
12
12
|
s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] }
|
|
13
13
|
s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}', 'push-notifications/ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
|
|
14
|
-
s.ios.deployment_target
|
|
14
|
+
s.ios.deployment_target = '14.0'
|
|
15
15
|
s.dependency 'Capacitor'
|
|
16
16
|
s.swift_version = '5.1'
|
|
17
17
|
end
|
package/Package.swift
CHANGED
|
@@ -3,14 +3,14 @@ import PackageDescription
|
|
|
3
3
|
|
|
4
4
|
let package = Package(
|
|
5
5
|
name: "CapacitorPushNotifications",
|
|
6
|
-
platforms: [.iOS(.
|
|
6
|
+
platforms: [.iOS(.v14)],
|
|
7
7
|
products: [
|
|
8
8
|
.library(
|
|
9
9
|
name: "CapacitorPushNotifications",
|
|
10
10
|
targets: ["PushNotificationsPlugin"])
|
|
11
11
|
],
|
|
12
12
|
dependencies: [
|
|
13
|
-
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git",
|
|
13
|
+
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", branch: "main")
|
|
14
14
|
],
|
|
15
15
|
targets: [
|
|
16
16
|
.target(
|
package/README.md
CHANGED
|
@@ -31,11 +31,17 @@ The Push Notification API uses [Firebase Cloud Messaging](https://firebase.googl
|
|
|
31
31
|
|
|
32
32
|
Android 13 requires a permission check in order to receive push notifications. You are required to call `checkPermissions()` and `requestPermissions()` accordingly, when targeting SDK 33.
|
|
33
33
|
|
|
34
|
+
From Android 15 onwards, users can install an app in the [Private space](https://developer.android.com/about/versions/15/features#private-space). Users can lock their private space at any time, which means that push notifications are not shown until the user unlocks it.
|
|
35
|
+
|
|
36
|
+
It is not possible to detect if an app is installed in the private space. Therefore, if your app shows any critical notifications, inform your users to avoid installing the app in the private space.
|
|
37
|
+
|
|
38
|
+
For more information about the behavior changes of your app related to the private space, refer to [Android documentation](https://developer.android.com/about/versions/15/behavior-changes-all#private-space-changes).
|
|
39
|
+
|
|
34
40
|
### Variables
|
|
35
41
|
|
|
36
42
|
This plugin will use the following project variables (defined in your app's `variables.gradle` file):
|
|
37
43
|
|
|
38
|
-
- `firebaseMessagingVersion` version of `com.google.firebase:firebase-messaging` (default: `
|
|
44
|
+
- `firebaseMessagingVersion` version of `com.google.firebase:firebase-messaging` (default: `24.1.0`)
|
|
39
45
|
|
|
40
46
|
---
|
|
41
47
|
|
package/android/build.gradle
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
ext {
|
|
2
2
|
capacitorVersion = System.getenv('CAPACITOR_VERSION')
|
|
3
3
|
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
|
|
4
|
-
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.
|
|
5
|
-
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1
|
|
6
|
-
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.
|
|
7
|
-
firebaseMessagingVersion = project.hasProperty('firebaseMessagingVersion') ? rootProject.ext.firebaseMessagingVersion : '
|
|
4
|
+
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0'
|
|
5
|
+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1'
|
|
6
|
+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1'
|
|
7
|
+
firebaseMessagingVersion = project.hasProperty('firebaseMessagingVersion') ? rootProject.ext.firebaseMessagingVersion : '24.1.0'
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
buildscript {
|
|
@@ -16,7 +16,7 @@ buildscript {
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
dependencies {
|
|
19
|
-
classpath 'com.android.tools.build:gradle:8.2
|
|
19
|
+
classpath 'com.android.tools.build:gradle:8.7.2'
|
|
20
20
|
if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") {
|
|
21
21
|
classpath 'io.github.gradle-nexus:publish-plugin:1.3.0'
|
|
22
22
|
}
|
|
@@ -32,10 +32,10 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") {
|
|
|
32
32
|
|
|
33
33
|
android {
|
|
34
34
|
namespace "com.capacitorjs.plugins.pushnotifications"
|
|
35
|
-
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion :
|
|
35
|
+
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35
|
|
36
36
|
defaultConfig {
|
|
37
|
-
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion :
|
|
38
|
-
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion :
|
|
37
|
+
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23
|
|
38
|
+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35
|
|
39
39
|
versionCode 1
|
|
40
40
|
versionName "1.0"
|
|
41
41
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
@@ -50,8 +50,8 @@ android {
|
|
|
50
50
|
abortOnError false
|
|
51
51
|
}
|
|
52
52
|
compileOptions {
|
|
53
|
-
sourceCompatibility JavaVersion.
|
|
54
|
-
targetCompatibility JavaVersion.
|
|
53
|
+
sourceCompatibility JavaVersion.VERSION_21
|
|
54
|
+
targetCompatibility JavaVersion.VERSION_21
|
|
55
55
|
}
|
|
56
56
|
publishing {
|
|
57
57
|
singleVariant("release")
|
package/android/src/main/java/com/capacitorjs/plugins/pushnotifications/PushNotificationsPlugin.java
CHANGED
|
@@ -126,33 +126,31 @@ public class PushNotificationsPlugin extends Plugin {
|
|
|
126
126
|
@PluginMethod
|
|
127
127
|
public void getDeliveredNotifications(PluginCall call) {
|
|
128
128
|
JSArray notifications = new JSArray();
|
|
129
|
-
|
|
130
|
-
StatusBarNotification[] activeNotifications = notificationManager.getActiveNotifications();
|
|
129
|
+
StatusBarNotification[] activeNotifications = notificationManager.getActiveNotifications();
|
|
131
130
|
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
for (StatusBarNotification notif : activeNotifications) {
|
|
132
|
+
JSObject jsNotif = new JSObject();
|
|
134
133
|
|
|
135
|
-
|
|
136
|
-
|
|
134
|
+
jsNotif.put("id", notif.getId());
|
|
135
|
+
jsNotif.put("tag", notif.getTag());
|
|
137
136
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
137
|
+
Notification notification = notif.getNotification();
|
|
138
|
+
if (notification != null) {
|
|
139
|
+
jsNotif.put("title", notification.extras.getCharSequence(Notification.EXTRA_TITLE));
|
|
140
|
+
jsNotif.put("body", notification.extras.getCharSequence(Notification.EXTRA_TEXT));
|
|
141
|
+
jsNotif.put("group", notification.getGroup());
|
|
142
|
+
jsNotif.put("groupSummary", 0 != (notification.flags & Notification.FLAG_GROUP_SUMMARY));
|
|
144
143
|
|
|
145
|
-
|
|
144
|
+
JSObject extras = new JSObject();
|
|
146
145
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
jsNotif.put("data", extras);
|
|
146
|
+
for (String key : notification.extras.keySet()) {
|
|
147
|
+
extras.put(key, notification.extras.getString(key));
|
|
152
148
|
}
|
|
153
149
|
|
|
154
|
-
|
|
150
|
+
jsNotif.put("data", extras);
|
|
155
151
|
}
|
|
152
|
+
|
|
153
|
+
notifications.put(jsNotif);
|
|
156
154
|
}
|
|
157
155
|
|
|
158
156
|
JSObject result = new JSObject();
|
package/dist/plugin.cjs.js
CHANGED
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst PushNotifications = registerPlugin('PushNotifications', {});\nexport * from './definitions';\nexport { PushNotifications };\n//# sourceMappingURL=index.js.map"],"names":["registerPlugin"],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst PushNotifications = registerPlugin('PushNotifications', {});\nexport * from './definitions';\nexport { PushNotifications };\n//# sourceMappingURL=index.js.map"],"names":["registerPlugin"],"mappings":";;;;AACK,MAAC,iBAAiB,GAAGA,mBAAc,CAAC,mBAAmB,EAAE,EAAE;;;;"}
|
package/dist/plugin.js
CHANGED
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/index.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst PushNotifications = registerPlugin('PushNotifications', {});\nexport * from './definitions';\nexport { PushNotifications };\n//# sourceMappingURL=index.js.map"],"names":["registerPlugin"],"mappings":";;;AACK,OAAC,iBAAiB,GAAGA,mBAAc,CAAC,mBAAmB,EAAE,EAAE
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/index.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst PushNotifications = registerPlugin('PushNotifications', {});\nexport * from './definitions';\nexport { PushNotifications };\n//# sourceMappingURL=index.js.map"],"names":["registerPlugin"],"mappings":";;;AACK,OAAC,iBAAiB,GAAGA,mBAAc,CAAC,mBAAmB,EAAE,EAAE;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor/push-notifications",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0-alpha.2",
|
|
4
4
|
"description": "The Push Notifications API provides access to native push notifications.",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
],
|
|
32
32
|
"scripts": {
|
|
33
33
|
"verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
|
|
34
|
-
"verify:ios": "xcodebuild build -scheme CapacitorPushNotifications -
|
|
34
|
+
"verify:ios": "xcodebuild build -scheme CapacitorPushNotifications -destination generic/platform=iOS",
|
|
35
35
|
"verify:android": "cd android && ./gradlew clean build test && cd ..",
|
|
36
36
|
"verify:web": "npm run build",
|
|
37
37
|
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
|
|
@@ -40,31 +40,31 @@
|
|
|
40
40
|
"prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
|
|
41
41
|
"swiftlint": "node-swiftlint",
|
|
42
42
|
"docgen": "docgen --api PushNotificationsPlugin --output-readme README.md --output-json dist/docs.json",
|
|
43
|
-
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.
|
|
43
|
+
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
|
|
44
44
|
"clean": "rimraf ./dist",
|
|
45
45
|
"watch": "tsc --watch",
|
|
46
46
|
"prepublishOnly": "npm run build",
|
|
47
47
|
"publish:cocoapod": "pod trunk push ./CapacitorPushNotifications.podspec --allow-warnings"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@capacitor/android": "
|
|
50
|
+
"@capacitor/android": "next",
|
|
51
51
|
"@capacitor/cli": "^6.0.0",
|
|
52
|
-
"@capacitor/core": "
|
|
52
|
+
"@capacitor/core": "next",
|
|
53
53
|
"@capacitor/docgen": "0.2.2",
|
|
54
|
-
"@capacitor/ios": "
|
|
54
|
+
"@capacitor/ios": "next",
|
|
55
55
|
"@ionic/eslint-config": "^0.4.0",
|
|
56
56
|
"@ionic/prettier-config": "~1.0.1",
|
|
57
57
|
"@ionic/swiftlint-config": "^1.1.2",
|
|
58
58
|
"eslint": "^8.57.0",
|
|
59
59
|
"prettier": "~2.3.0",
|
|
60
60
|
"prettier-plugin-java": "~1.0.2",
|
|
61
|
-
"rimraf": "^
|
|
62
|
-
"rollup": "^
|
|
61
|
+
"rimraf": "^6.0.1",
|
|
62
|
+
"rollup": "^4.26.0",
|
|
63
63
|
"swiftlint": "^1.0.1",
|
|
64
64
|
"typescript": "~4.1.5"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
|
-
"@capacitor/core": "
|
|
67
|
+
"@capacitor/core": "next"
|
|
68
68
|
},
|
|
69
69
|
"prettier": "@ionic/prettier-config",
|
|
70
70
|
"swiftlint": "@ionic/swiftlint-config",
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"publishConfig": {
|
|
83
83
|
"access": "public"
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "023f53b42a81049b7cdef6c7b0102b85b4df1c01"
|
|
86
86
|
}
|