@capacitor/push-notifications 6.0.3 → 7.0.0-alpha.1

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.
@@ -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 = '13.0'
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(.v13)],
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", from: "6.0.0")
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
@@ -35,7 +35,7 @@ Android 13 requires a permission check in order to receive push notifications.
35
35
 
36
36
  This plugin will use the following project variables (defined in your app's `variables.gradle` file):
37
37
 
38
- - `firebaseMessagingVersion` version of `com.google.firebase:firebase-messaging` (default: `23.3.1`)
38
+ - `firebaseMessagingVersion` version of `com.google.firebase:firebase-messaging` (default: `24.1.0`)
39
39
 
40
40
  ---
41
41
 
@@ -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.6.1'
5
- androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5'
6
- androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1'
7
- firebaseMessagingVersion = project.hasProperty('firebaseMessagingVersion') ? rootProject.ext.firebaseMessagingVersion : '23.3.1'
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.1'
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 : 34
35
+ compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35
36
36
  defaultConfig {
37
- minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
38
- targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34
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.VERSION_17
54
- targetCompatibility JavaVersion.VERSION_17
53
+ sourceCompatibility JavaVersion.VERSION_21
54
+ targetCompatibility JavaVersion.VERSION_21
55
55
  }
56
56
  publishing {
57
57
  singleVariant("release")
@@ -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
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
130
- StatusBarNotification[] activeNotifications = notificationManager.getActiveNotifications();
129
+ StatusBarNotification[] activeNotifications = notificationManager.getActiveNotifications();
131
130
 
132
- for (StatusBarNotification notif : activeNotifications) {
133
- JSObject jsNotif = new JSObject();
131
+ for (StatusBarNotification notif : activeNotifications) {
132
+ JSObject jsNotif = new JSObject();
134
133
 
135
- jsNotif.put("id", notif.getId());
136
- jsNotif.put("tag", notif.getTag());
134
+ jsNotif.put("id", notif.getId());
135
+ jsNotif.put("tag", notif.getTag());
137
136
 
138
- Notification notification = notif.getNotification();
139
- if (notification != null) {
140
- jsNotif.put("title", notification.extras.getCharSequence(Notification.EXTRA_TITLE));
141
- jsNotif.put("body", notification.extras.getCharSequence(Notification.EXTRA_TEXT));
142
- jsNotif.put("group", notification.getGroup());
143
- jsNotif.put("groupSummary", 0 != (notification.flags & Notification.FLAG_GROUP_SUMMARY));
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
- JSObject extras = new JSObject();
144
+ JSObject extras = new JSObject();
146
145
 
147
- for (String key : notification.extras.keySet()) {
148
- extras.put(key, notification.extras.getString(key));
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
- notifications.put(jsNotif);
150
+ jsNotif.put("data", extras);
155
151
  }
152
+
153
+ notifications.put(jsNotif);
156
154
  }
157
155
 
158
156
  JSObject result = new JSObject();
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var core = require('@capacitor/core');
6
4
 
7
5
  const PushNotifications = core.registerPlugin('PushNotifications', {});
@@ -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":";;;;;;AACK,MAAC,iBAAiB,GAAGA,mBAAc,CAAC,mBAAmB,EAAE,EAAE;;;;"}
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
@@ -5,8 +5,6 @@ var capacitorPushNotifications = (function (exports, core) {
5
5
 
6
6
  exports.PushNotifications = PushNotifications;
7
7
 
8
- Object.defineProperty(exports, '__esModule', { value: true });
9
-
10
8
  return exports;
11
9
 
12
10
  })({}, capacitorExports);
@@ -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": "6.0.3",
3
+ "version": "7.0.0-alpha.1",
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 -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'",
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.js",
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": "^6.0.0",
50
+ "@capacitor/android": "next",
51
51
  "@capacitor/cli": "^6.0.0",
52
- "@capacitor/core": "^6.0.0",
52
+ "@capacitor/core": "next",
53
53
  "@capacitor/docgen": "0.2.2",
54
- "@capacitor/ios": "^6.0.0",
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": "^3.0.0",
62
- "rollup": "^2.29.0",
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": "^6.0.0"
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": "6e94aa5bf785e957d0cfac83b62b5355bcf7d1ed"
85
+ "gitHead": "2158e6aa205a584a258c34f606e694fdf31cdcc0"
86
86
  }