expo-notifications 58.0.10 → 58.1.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.
Files changed (37) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/android/build.gradle +2 -2
  3. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{58.0.10/expo.modules.notifications-58.0.10.module → 58.1.0/expo.modules.notifications-58.1.0.module} +7 -7
  4. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/58.1.0/expo.modules.notifications-58.1.0.module.md5 +1 -0
  5. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/58.1.0/expo.modules.notifications-58.1.0.module.sha1 +1 -0
  6. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/58.1.0/expo.modules.notifications-58.1.0.module.sha256 +1 -0
  7. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/58.1.0/expo.modules.notifications-58.1.0.module.sha512 +1 -0
  8. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{58.0.10/expo.modules.notifications-58.0.10.pom → 58.1.0/expo.modules.notifications-58.1.0.pom} +1 -1
  9. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/58.1.0/expo.modules.notifications-58.1.0.pom.md5 +1 -0
  10. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/58.1.0/expo.modules.notifications-58.1.0.pom.sha1 +1 -0
  11. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/58.1.0/expo.modules.notifications-58.1.0.pom.sha256 +1 -0
  12. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/58.1.0/expo.modules.notifications-58.1.0.pom.sha512 +1 -0
  13. package/package.json +7 -7
  14. package/plugin/build/withNotifications.d.ts +9 -0
  15. package/plugin/build/withNotifications.js.map +1 -1
  16. package/plugin/build/withNotificationsIOS.js +15 -7
  17. package/plugin/build/withNotificationsIOS.js.map +1 -1
  18. package/plugin/src/withNotifications.ts +10 -0
  19. package/plugin/src/withNotificationsIOS.ts +26 -7
  20. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/58.0.10/expo.modules.notifications-58.0.10.module.md5 +0 -1
  21. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/58.0.10/expo.modules.notifications-58.0.10.module.sha1 +0 -1
  22. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/58.0.10/expo.modules.notifications-58.0.10.module.sha256 +0 -1
  23. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/58.0.10/expo.modules.notifications-58.0.10.module.sha512 +0 -1
  24. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/58.0.10/expo.modules.notifications-58.0.10.pom.md5 +0 -1
  25. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/58.0.10/expo.modules.notifications-58.0.10.pom.sha1 +0 -1
  26. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/58.0.10/expo.modules.notifications-58.0.10.pom.sha256 +0 -1
  27. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/58.0.10/expo.modules.notifications-58.0.10.pom.sha512 +0 -1
  28. /package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{58.0.10/expo.modules.notifications-58.0.10-sources.jar → 58.1.0/expo.modules.notifications-58.1.0-sources.jar} +0 -0
  29. /package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{58.0.10/expo.modules.notifications-58.0.10-sources.jar.md5 → 58.1.0/expo.modules.notifications-58.1.0-sources.jar.md5} +0 -0
  30. /package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{58.0.10/expo.modules.notifications-58.0.10-sources.jar.sha1 → 58.1.0/expo.modules.notifications-58.1.0-sources.jar.sha1} +0 -0
  31. /package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{58.0.10/expo.modules.notifications-58.0.10-sources.jar.sha256 → 58.1.0/expo.modules.notifications-58.1.0-sources.jar.sha256} +0 -0
  32. /package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{58.0.10/expo.modules.notifications-58.0.10-sources.jar.sha512 → 58.1.0/expo.modules.notifications-58.1.0-sources.jar.sha512} +0 -0
  33. /package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{58.0.10/expo.modules.notifications-58.0.10.aar → 58.1.0/expo.modules.notifications-58.1.0.aar} +0 -0
  34. /package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{58.0.10/expo.modules.notifications-58.0.10.aar.md5 → 58.1.0/expo.modules.notifications-58.1.0.aar.md5} +0 -0
  35. /package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{58.0.10/expo.modules.notifications-58.0.10.aar.sha1 → 58.1.0/expo.modules.notifications-58.1.0.aar.sha1} +0 -0
  36. /package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{58.0.10/expo.modules.notifications-58.0.10.aar.sha256 → 58.1.0/expo.modules.notifications-58.1.0.aar.sha256} +0 -0
  37. /package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{58.0.10/expo.modules.notifications-58.0.10.aar.sha512 → 58.1.0/expo.modules.notifications-58.1.0.aar.sha512} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## 58.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Add `enableRemoteNotifications` config plugin option. Set it to `false` to skip the APNs entitlement for apps that use only local notifications. Defaults to `true`. ([#50891](https://github.com/expo/expo/pull/50891) by [@netmaxt3r](https://github.com/netmaxt3r))
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies. ([#50391](https://github.com/expo/expo/pull/50391))
12
+ - @expo/image-utils@0.12.3
13
+
14
+ ## 58.0.11
15
+
16
+ ### Patch Changes
17
+
18
+ - Bump precompiled artifacts due to ABI breakage in expo-modules-jsi@58.0.6. ([#50881](https://github.com/expo/expo/pull/50881) by [@kitten](https://github.com/kitten))
19
+ - Updated dependencies. ([#50881](https://github.com/expo/expo/pull/50881))
20
+ - expo-application@58.0.3
21
+
3
22
  ## 58.0.10
4
23
 
5
24
  ### Patch Changes
@@ -5,13 +5,13 @@ plugins {
5
5
  }
6
6
 
7
7
  group = 'host.exp.exponent'
8
- version = '58.0.10'
8
+ version = '58.1.0'
9
9
 
10
10
  android {
11
11
  namespace "expo.modules.notifications"
12
12
  defaultConfig {
13
13
  versionCode 21
14
- versionName '58.0.10'
14
+ versionName '58.1.0'
15
15
  testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
16
16
  consumerProguardFiles 'proguard-rules.pro'
17
17
  }
@@ -3,7 +3,7 @@
3
3
  "component": {
4
4
  "group": "host.exp.exponent",
5
5
  "module": "expo.modules.notifications",
6
- "version": "58.0.10",
6
+ "version": "58.1.0",
7
7
  "attributes": {
8
8
  "org.gradle.status": "release"
9
9
  }
@@ -24,8 +24,8 @@
24
24
  },
25
25
  "files": [
26
26
  {
27
- "name": "expo.modules.notifications-58.0.10.aar",
28
- "url": "expo.modules.notifications-58.0.10.aar",
27
+ "name": "expo.modules.notifications-58.1.0.aar",
28
+ "url": "expo.modules.notifications-58.1.0.aar",
29
29
  "size": 443625,
30
30
  "sha512": "a401a078be6a11f57f72d93d27a13c446a4d3d8731418dedcb23215d14056d12fee2ee1ff24592bd0729395cbaeb0e9f5e9cc1aba2cc58b206e95c874d2ace95",
31
31
  "sha256": "0216e56114469d9ea6870c8b97b5c96c4a97f1bfa33a61483caeb656a63249e2",
@@ -136,8 +136,8 @@
136
136
  ],
137
137
  "files": [
138
138
  {
139
- "name": "expo.modules.notifications-58.0.10.aar",
140
- "url": "expo.modules.notifications-58.0.10.aar",
139
+ "name": "expo.modules.notifications-58.1.0.aar",
140
+ "url": "expo.modules.notifications-58.1.0.aar",
141
141
  "size": 443625,
142
142
  "sha512": "a401a078be6a11f57f72d93d27a13c446a4d3d8731418dedcb23215d14056d12fee2ee1ff24592bd0729395cbaeb0e9f5e9cc1aba2cc58b206e95c874d2ace95",
143
143
  "sha256": "0216e56114469d9ea6870c8b97b5c96c4a97f1bfa33a61483caeb656a63249e2",
@@ -156,8 +156,8 @@
156
156
  },
157
157
  "files": [
158
158
  {
159
- "name": "expo.modules.notifications-58.0.10-sources.jar",
160
- "url": "expo.modules.notifications-58.0.10-sources.jar",
159
+ "name": "expo.modules.notifications-58.1.0-sources.jar",
160
+ "url": "expo.modules.notifications-58.1.0-sources.jar",
161
161
  "size": 101538,
162
162
  "sha512": "45139df00e6abdce6f071c0ef519c9a6d026f33ebbb80d5a495d963628866bcc9d6a9181ae21828a41d85e0b63cf8a7a11083e135133be30f8fba7cf4cba3519",
163
163
  "sha256": "202f39312f5784dfa6a55eb5404e64195751ba5065f2ec34fc465f9914b5ff6d",
@@ -0,0 +1 @@
1
+ 1a05de34193bd576f3890f84961e10b8f1c3c29e52e3e30b4ac8c5acfbeec533
@@ -0,0 +1 @@
1
+ 0a2745b209758c904a72ac03cc235cf23b532d509e0a4cb03a7b8f0ff4fdacb4058557eb76a2139df7081be01b9df83796b7668c8ed40e758e4b885cdc7f1d6d
@@ -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>58.0.10</version>
12
+ <version>58.1.0</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
+ 5976caac47c080a5cfae7faa914188f8db819576131042175d80a96df12312dc
@@ -0,0 +1 @@
1
+ bb99904bc0d041411c18a57351e5b1c453acdc2562eaf2ecaedcd17d83778e7ae08d4df925e61f9f8ed6fcef4e270958f6fe1fb08a27136c07e7c2de991f7323
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-notifications",
3
- "version": "58.0.10",
3
+ "version": "58.1.0",
4
4
  "description": "Provides an API to fetch push notification tokens and to present, schedule, receive, and respond to notifications.",
5
5
  "keywords": [
6
6
  "expo",
@@ -26,19 +26,19 @@
26
26
  "main": "build/index.js",
27
27
  "types": "build/index.d.ts",
28
28
  "dependencies": {
29
- "@expo/image-utils": "^0.12.2",
29
+ "@expo/image-utils": "^0.12.3",
30
30
  "abort-controller": "^3.0.0",
31
31
  "badgin": "^1.1.5",
32
- "expo-application": "~58.0.2",
32
+ "expo-application": "~58.0.3",
33
33
  "expo-constants": "~58.0.9"
34
34
  },
35
35
  "devDependencies": {
36
- "@types/jest": "^29.2.1",
36
+ "@types/jest": "^30.0.0",
37
37
  "@types/node": "^22.14.0",
38
38
  "@types/react": "~19.3.0",
39
- "expo": "58.0.1",
40
- "expo-module-scripts": "56.0.4",
41
- "memfs": "^3.2.0"
39
+ "expo": "58.0.3",
40
+ "expo-module-scripts": "56.0.6",
41
+ "memfs": "^3.6.0"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "expo": "*",
@@ -35,6 +35,15 @@ export type NotificationsPluginProps = {
35
35
  * @platform ios
36
36
  */
37
37
  mode?: 'development' | 'production';
38
+ /**
39
+ * Whether to enable remote notifications.
40
+ *
41
+ * If set to `false`, the plugin does not add the `aps-environment` entitlement to the native project,
42
+ * and only local notifications work. `mode` has no effect.
43
+ * @default true
44
+ * @platform ios
45
+ */
46
+ enableRemoteNotifications?: boolean;
38
47
  /**
39
48
  * Whether to enable background remote notifications, as described in [Apple documentation](https://developer.apple.com/documentation/usernotifications/pushing-background-updates-to-your-app).
40
49
  *
@@ -1 +1 @@
1
- {"version":3,"sources":["withNotifications.ts"],"sourcesContent":[null],"names":["pkg","require","withNotifications","config","props","withNotificationsAndroid","withNotificationsIOS","createRunOncePlugin","name","version"],"mappings":";;;;+BA4DA;;;eAAA;;;;yBA5DkD;;;;;;0CAET;sCACJ;AAErC,MAAMA,MAAMC,QAAQ;AAiDpB,MAAMC,oBAAmE,CAACC,QAAQC;IAChFD,SAASE,IAAAA,kDAAwB,EAACF,QAAQC,SAAS,CAAC;IACpDD,SAASG,IAAAA,0CAAoB,EAACH,QAAQC,SAAS,CAAC;IAChD,OAAOD;AACT;MAEA,WAAeI,IAAAA,oCAAmB,EAACL,mBAAmBF,IAAIQ,IAAI,EAAER,IAAIS,OAAO"}
1
+ {"version":3,"sources":["withNotifications.ts"],"sourcesContent":[null],"names":["pkg","require","withNotifications","config","props","withNotificationsAndroid","withNotificationsIOS","createRunOncePlugin","name","version"],"mappings":";;;;+BAsEA;;;eAAA;;;;yBAtEkD;;;;;;0CAET;sCACJ;AAErC,MAAMA,MAAMC,QAAQ;AA2DpB,MAAMC,oBAAmE,CAACC,QAAQC;IAChFD,SAASE,IAAAA,kDAAwB,EAACF,QAAQC,SAAS,CAAC;IACpDD,SAASG,IAAAA,0CAAoB,EAACH,QAAQC,SAAS,CAAC;IAChD,OAAOD;AACT;MAEA,WAAeI,IAAAA,oCAAmB,EAACL,mBAAmBF,IAAIQ,IAAI,EAAER,IAAIS,OAAO"}
@@ -42,13 +42,21 @@ function _path() {
42
42
  return data;
43
43
  }
44
44
  const ERROR_MSG_PREFIX = 'An error occurred while configuring iOS notifications. ';
45
- const withNotificationsIOS = (config, { mode = 'development', sounds = [], enableBackgroundRemoteNotifications })=>{
46
- config = (0, _configplugins().withEntitlementsPlist)(config, (config)=>{
47
- if (!config.modResults['aps-environment']) {
48
- config.modResults['aps-environment'] = mode;
49
- }
50
- return config;
51
- });
45
+ const withNotificationsIOS = (config, { mode = 'development', sounds = [], enableRemoteNotifications = true, enableBackgroundRemoteNotifications })=>{
46
+ if (typeof enableRemoteNotifications !== 'boolean') {
47
+ throw new Error(ERROR_MSG_PREFIX + `"enableRemoteNotifications" has an invalid value: ${enableRemoteNotifications}. Expected a boolean.`);
48
+ }
49
+ if (!enableRemoteNotifications && enableBackgroundRemoteNotifications) {
50
+ throw new Error(ERROR_MSG_PREFIX + `"enableBackgroundRemoteNotifications" requires "enableRemoteNotifications" to be true, because background remote notifications are delivered through APNs. Set "enableRemoteNotifications" to true, or remove "enableBackgroundRemoteNotifications" from the expo-notifications plugin options.`);
51
+ }
52
+ if (enableRemoteNotifications) {
53
+ config = (0, _configplugins().withEntitlementsPlist)(config, (config)=>{
54
+ if (!config.modResults['aps-environment']) {
55
+ config.modResults['aps-environment'] = mode;
56
+ }
57
+ return config;
58
+ });
59
+ }
52
60
  config = withNotificationSounds(config, {
53
61
  sounds
54
62
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["withNotificationsIOS.ts"],"sourcesContent":[null],"names":["setNotificationSounds","withNotificationsIOS","ERROR_MSG_PREFIX","config","mode","sounds","enableBackgroundRemoteNotifications","withEntitlementsPlist","modResults","withNotificationSounds","withBackgroundRemoteNotifications","undefined","Error","withInfoPlist","Array","isArray","UIBackgroundModes","notificationBackgroundMode","includes","push","withXcodeProject","modRequest","projectRoot","project","projectName","sourceRoot","IOSConfig","Paths","getSourceRoot","soundFileRelativePath","fileName","basename","sourceFilepath","resolve","destinationFilepath","copyFileSync","hasFile","XcodeUtils","addResourceFileToGroup","filepath","groupName","isBuildFile"],"mappings":";;;;;;;;;;;;;;;QA2EgBA;eAAAA;;QA5DHC;eAAAA;;;;yBARN;;;;;;;yBACsB;;;;;;;yBACK;;;;;;AAIlC,MAAMC,mBAAmB;AAElB,MAAMD,uBAA+D,CAC1EE,QACA,EAAEC,OAAO,aAAa,EAAEC,SAAS,EAAE,EAAEC,mCAAmC,EAAE;IAE1EH,SAASI,IAAAA,sCAAqB,EAACJ,QAAQ,CAACA;QACtC,IAAI,CAACA,OAAOK,UAAU,CAAC,kBAAkB,EAAE;YACzCL,OAAOK,UAAU,CAAC,kBAAkB,GAAGJ;QACzC;QACA,OAAOD;IACT;IACAA,SAASM,uBAAuBN,QAAQ;QAAEE;IAAO;IACjDF,SAASO,kCAAkCP,QAAQG;IAEnD,OAAOH;AACT;AAEA,MAAMO,oCAAuE,CAC3EP,QACAG;IAEA,IACE,CACEA,CAAAA,wCAAwCK,aACxC,OAAOL,wCAAwC,SAAQ,GAEzD;QACA,MAAM,IAAIM,MACRV,mBACE,CAAC,4DAA4D,EAAEI,oCAAoC,qBAAqB,CAAC;IAE/H;IACA,IAAI,CAACA,qCAAqC;QACxC,OAAOH;IACT;IACA,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ACX,QAAQa,OAAO,CAAC,GAAGZ,YAAY,CAAC,EAAEM,UAAU,GAAG;YAClDP,UAAUG,0BAAS,CAACW,UAAU,CAACC,sBAAsB,CAAC;gBACpDC,UAAU,GAAGf,YAAY,CAAC,EAAEM,UAAU;gBACtCU,WAAWhB;gBACXiB,aAAa;gBACblB;YACF;QACF;IACF;IAEA,OAAOA;AACT"}
1
+ {"version":3,"sources":["withNotificationsIOS.ts"],"sourcesContent":[null],"names":["setNotificationSounds","withNotificationsIOS","ERROR_MSG_PREFIX","config","mode","sounds","enableRemoteNotifications","enableBackgroundRemoteNotifications","Error","withEntitlementsPlist","modResults","withNotificationSounds","withBackgroundRemoteNotifications","undefined","withInfoPlist","Array","isArray","UIBackgroundModes","notificationBackgroundMode","includes","push","withXcodeProject","modRequest","projectRoot","project","projectName","sourceRoot","IOSConfig","Paths","getSourceRoot","soundFileRelativePath","fileName","basename","sourceFilepath","resolve","destinationFilepath","copyFileSync","hasFile","XcodeUtils","addResourceFileToGroup","filepath","groupName","isBuildFile"],"mappings":";;;;;;;;;;;;;;;QA8FgBA;eAAAA;;QA/EHC;eAAAA;;;;yBARN;;;;;;;yBACsB;;;;;;;yBACK;;;;;;AAIlC,MAAMC,mBAAmB;AAElB,MAAMD,uBAA+D,CAC1EE,QACA,EACEC,OAAO,aAAa,EACpBC,SAAS,EAAE,EACXC,4BAA4B,IAAI,EAChCC,mCAAmC,EACpC;IAED,IAAI,OAAOD,8BAA8B,WAAW;QAClD,MAAM,IAAIE,MACRN,mBACE,CAAC,kDAAkD,EAAEI,0BAA0B,qBAAqB,CAAC;IAE3G;IACA,IAAI,CAACA,6BAA6BC,qCAAqC;QACrE,MAAM,IAAIC,MACRN,mBACE,CAAC,+RAA+R,CAAC;IAEvS;IACA,IAAII,2BAA2B;QAC7BH,SAASM,IAAAA,sCAAqB,EAACN,QAAQ,CAACA;YACtC,IAAI,CAACA,OAAOO,UAAU,CAAC,kBAAkB,EAAE;gBACzCP,OAAOO,UAAU,C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+DAA+D,EAAE,OAAOG,OAAO,CAAC,CAAC;IAExF;IACA,MAAMqB,aAAaC,0BAAS,CAACC,KAAK,CAACC,aAAa,CAACN;IACjD,KAAK,MAAMO,yBAAyBzB,OAAQ;QAC1C,MAAM0B,WAAWC,IAAAA,gBAAQ,EAACF;QAC1B,MAAMG,iBAAiBC,IAAAA,eAAO,EAACX,aAAaO;QAC5C,MAAMK,sBAAsBD,IAAAA,eAAO,EAACR,YAAYK;QAEhD,6DAA6D;QAC7D,qDAAqD;QACrDK,IAAAA,kBAAY,EAACH,gBAAgBE;QAC7B,IAAI,CAACX,QAAQa,OAAO,CAAC,GAAGZ,YAAY,CAAC,EAAEM,UAAU,GAAG;YAClDP,UAAUG,0BAAS,CAACW,UAAU,CAACC,sBAAsB,CAAC;gBACpDC,UAAU,GAAGf,YAAY,CAAC,EAAEM,UAAU;gBACtCU,WAAWhB;gBACXiB,aAAa;gBACblB;YACF;QACF;IACF;IAEA,OAAOA;AACT"}
@@ -42,6 +42,16 @@ export type NotificationsPluginProps = {
42
42
  */
43
43
  mode?: 'development' | 'production';
44
44
 
45
+ /**
46
+ * Whether to enable remote notifications.
47
+ *
48
+ * If set to `false`, the plugin does not add the `aps-environment` entitlement to the native project,
49
+ * and only local notifications work. `mode` has no effect.
50
+ * @default true
51
+ * @platform ios
52
+ */
53
+ enableRemoteNotifications?: boolean;
54
+
45
55
  /**
46
56
  * Whether to enable background remote notifications, as described in [Apple documentation](https://developer.apple.com/documentation/usernotifications/pushing-background-updates-to-your-app).
47
57
  *
@@ -15,14 +15,33 @@ const ERROR_MSG_PREFIX = 'An error occurred while configuring iOS notifications.
15
15
 
16
16
  export const withNotificationsIOS: ConfigPlugin<NotificationsPluginProps> = (
17
17
  config,
18
- { mode = 'development', sounds = [], enableBackgroundRemoteNotifications }
18
+ {
19
+ mode = 'development',
20
+ sounds = [],
21
+ enableRemoteNotifications = true,
22
+ enableBackgroundRemoteNotifications,
23
+ }
19
24
  ) => {
20
- config = withEntitlementsPlist(config, (config) => {
21
- if (!config.modResults['aps-environment']) {
22
- config.modResults['aps-environment'] = mode;
23
- }
24
- return config;
25
- });
25
+ if (typeof enableRemoteNotifications !== 'boolean') {
26
+ throw new Error(
27
+ ERROR_MSG_PREFIX +
28
+ `"enableRemoteNotifications" has an invalid value: ${enableRemoteNotifications}. Expected a boolean.`
29
+ );
30
+ }
31
+ if (!enableRemoteNotifications && enableBackgroundRemoteNotifications) {
32
+ throw new Error(
33
+ ERROR_MSG_PREFIX +
34
+ `"enableBackgroundRemoteNotifications" requires "enableRemoteNotifications" to be true, because background remote notifications are delivered through APNs. Set "enableRemoteNotifications" to true, or remove "enableBackgroundRemoteNotifications" from the expo-notifications plugin options.`
35
+ );
36
+ }
37
+ if (enableRemoteNotifications) {
38
+ config = withEntitlementsPlist(config, (config) => {
39
+ if (!config.modResults['aps-environment']) {
40
+ config.modResults['aps-environment'] = mode;
41
+ }
42
+ return config;
43
+ });
44
+ }
26
45
  config = withNotificationSounds(config, { sounds });
27
46
  config = withBackgroundRemoteNotifications(config, enableBackgroundRemoteNotifications);
28
47
 
@@ -1 +0,0 @@
1
- c02fd3f44a24641f6c4ac4e85f7f363eae2215a6bb3cd66ee29244e74de01a85
@@ -1 +0,0 @@
1
- 0e50199bd84f1ed6eea48a15206d1dcf8189f77234e0d9eab983e0da03ef082d3db0fe0d0d49089ea1d6de74c92831af085d3ca679b5eaee6f3f737d6ed4b0f2
@@ -1 +0,0 @@
1
- f3579f37dfa62051b8c91ea40b2815f818e90c5c29318843ea51376108f7c9c2
@@ -1 +0,0 @@
1
- 49fc421659737f4545f4b56c5ea32f0dbb1b911c531f0d8b0ea6c6a3a450192151ba5a081cd5432e68c401c87a6fcacfcf24a7958bea4179d0da4840ef98dc08