expo-device 5.7.0 → 5.8.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 CHANGED
@@ -10,6 +10,20 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 5.8.0 — 2023-10-17
14
+
15
+ ### 🛠 Breaking changes
16
+
17
+ - Dropped support for Android SDK 21 and 22. ([#24201](https://github.com/expo/expo/pull/24201) by [@behenate](https://github.com/behenate))
18
+
19
+ ### 🎉 New features
20
+
21
+ - Added new devices for iOS. ([#24555](https://github.com/expo/expo/pull/24555) by [@johanholm](https://github.com/johanholm))
22
+
23
+ ### 🐛 Bug fixes
24
+
25
+ - [iOS] fix tvOS compilation. ([#24845](https://github.com/expo/expo/pull/24845) by [@douglowder](https://github.com/douglowder))
26
+
13
27
  ## 5.7.0 — 2023-09-15
14
28
 
15
29
  ### 🎉 New features
@@ -3,15 +3,20 @@ apply plugin: 'kotlin-android'
3
3
  apply plugin: 'maven-publish'
4
4
 
5
5
  group = 'host.exp.exponent'
6
- version = '5.7.0'
6
+ version = '5.8.0'
7
7
 
8
- buildscript {
9
- def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
10
- if (expoModulesCorePlugin.exists()) {
11
- apply from: expoModulesCorePlugin
12
- applyKotlinExpoModulesCorePlugin()
8
+ def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
9
+ if (expoModulesCorePlugin.exists()) {
10
+ apply from: expoModulesCorePlugin
11
+ applyKotlinExpoModulesCorePlugin()
12
+ // Remove this check, but keep the contents after SDK49 support is dropped
13
+ if (safeExtGet("expoProvidesDefaultConfig", false)) {
14
+ useExpoPublishing()
15
+ useCoreDependencies()
13
16
  }
17
+ }
14
18
 
19
+ buildscript {
15
20
  // Simple helper that allows the root project to override versions declared by this library.
16
21
  ext.safeExtGet = { prop, fallback ->
17
22
  rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
@@ -35,23 +40,44 @@ buildscript {
35
40
  }
36
41
  }
37
42
 
38
- afterEvaluate {
39
- publishing {
40
- publications {
41
- release(MavenPublication) {
42
- from components.release
43
+ // Remove this if and it's contents, when support for SDK49 is dropped
44
+ if (!safeExtGet("expoProvidesDefaultConfig", false)) {
45
+ afterEvaluate {
46
+ publishing {
47
+ publications {
48
+ release(MavenPublication) {
49
+ from components.release
50
+ }
43
51
  }
44
- }
45
- repositories {
46
- maven {
47
- url = mavenLocal().url
52
+ repositories {
53
+ maven {
54
+ url = mavenLocal().url
55
+ }
48
56
  }
49
57
  }
50
58
  }
51
59
  }
52
60
 
53
61
  android {
54
- compileSdkVersion safeExtGet("compileSdkVersion", 33)
62
+ // Remove this if and it's contents, when support for SDK49 is dropped
63
+ if (!safeExtGet("expoProvidesDefaultConfig", false)) {
64
+ compileSdkVersion safeExtGet("compileSdkVersion", 33)
65
+
66
+ defaultConfig {
67
+ minSdkVersion safeExtGet("minSdkVersion", 23)
68
+ targetSdkVersion safeExtGet("targetSdkVersion", 33)
69
+ }
70
+
71
+ publishing {
72
+ singleVariant("release") {
73
+ withSourcesJar()
74
+ }
75
+ }
76
+
77
+ lintOptions {
78
+ abortOnError false
79
+ }
80
+ }
55
81
 
56
82
  def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
57
83
  if (agpVersion.tokenize('.')[0].toInteger() < 8) {
@@ -67,26 +93,19 @@ android {
67
93
 
68
94
  namespace "expo.modules.device"
69
95
  defaultConfig {
70
- minSdkVersion safeExtGet("minSdkVersion", 21)
71
- targetSdkVersion safeExtGet("targetSdkVersion", 33)
72
96
  versionCode 12
73
- versionName '5.7.0'
74
- }
75
- lintOptions {
76
- abortOnError false
77
- }
78
- publishing {
79
- singleVariant("release") {
80
- withSourcesJar()
81
- }
97
+ versionName '5.8.0'
82
98
  }
83
99
  }
84
100
 
85
101
  dependencies {
86
- implementation project(':expo-modules-core')
102
+ // Remove this if and it's contents, when support for SDK49 is dropped
103
+ if (!safeExtGet("expoProvidesDefaultConfig", false)) {
104
+ implementation project(':expo-modules-core')
105
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
106
+ }
87
107
 
88
108
  api 'com.facebook.device.yearclass:yearclass:2.1.0'
89
109
  api "androidx.legacy:legacy-support-v4:1.0.0"
90
110
 
91
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
92
111
  }
@@ -123,11 +123,7 @@ class DeviceModule : Module() {
123
123
 
124
124
  private val systemName: String
125
125
  get() {
126
- return if (Build.VERSION.SDK_INT < 23) {
127
- "Android"
128
- } else {
129
- Build.VERSION.BASE_OS.takeIf { it.isNotEmpty() } ?: "Android"
130
- }
126
+ return Build.VERSION.BASE_OS.takeIf { it.isNotEmpty() } ?: "Android"
131
127
  }
132
128
 
133
129
  companion object {
@@ -44,7 +44,7 @@ func getDeviceType() -> Int {
44
44
  }
45
45
 
46
46
  // if it's built for iPad running on a Mac
47
- if #available(iOS 14.0, *) {
47
+ if #available(iOS 14.0, tvOS 14.0, *) {
48
48
  if ProcessInfo.processInfo.isiOSAppOnMac {
49
49
  return DeviceType.desktop.rawValue
50
50
  }
@@ -10,7 +10,7 @@ Pod::Spec.new do |s|
10
10
  s.license = package['license']
11
11
  s.author = package['author']
12
12
  s.homepage = package['homepage']
13
- s.platform = :ios, '13.0'
13
+ s.platforms = { :ios => '13.0', :tvos => '13.0' }
14
14
  s.swift_version = '5.4'
15
15
  s.source = { git: 'https://github.com/expo/expo.git' }
16
16
  s.static_framework = true
@@ -86,6 +86,14 @@ public extension UIDevice {
86
86
  return ExpoDeviceType(modelName: "iPhone 14 Pro", deviceYearClass: 2022)
87
87
  case "iPhone15,3":
88
88
  return ExpoDeviceType(modelName: "iPhone 14 Pro Max", deviceYearClass: 2022)
89
+ case "iPhone15,4":
90
+ return ExpoDeviceType(modelName: "iPhone 15", deviceYearClass: 2023)
91
+ case "iPhone15,5":
92
+ return ExpoDeviceType(modelName: "iPhone 15 Plus", deviceYearClass: 2023)
93
+ case "iPhone16,1":
94
+ return ExpoDeviceType(modelName: "iPhone 15 Pro", deviceYearClass: 2023)
95
+ case "iPhone16,2":
96
+ return ExpoDeviceType(modelName: "iPhone 15 Pro Max", deviceYearClass: 2023)
89
97
  case "iPhone8,4":
90
98
  return ExpoDeviceType(modelName: "iPhone SE", deviceYearClass: 2016)
91
99
  case "iPhone12,8":
@@ -102,6 +110,8 @@ public extension UIDevice {
102
110
  return ExpoDeviceType(modelName: "iPad (8th generation)", deviceYearClass: 2020)
103
111
  case "iPad12,1", "iPad12,2":
104
112
  return ExpoDeviceType(modelName: "iPad (9th generation)", deviceYearClass: 2021)
113
+ case "iPad13,18", "iPad13,19":
114
+ return ExpoDeviceType(modelName: "iPad (10th generation)", deviceYearClass: 2022)
105
115
  case "iPad4,1", "iPad4,2", "iPad4,3":
106
116
  return ExpoDeviceType(modelName: "iPad Air", deviceYearClass: 2013)
107
117
  case "iPad5,3", "iPad5,4":
@@ -132,6 +142,8 @@ public extension UIDevice {
132
142
  return ExpoDeviceType(modelName: "iPad Pro (11-inch) (2nd generation)", deviceYearClass: 2020)
133
143
  case "iPad13,4", "iPad13,5", "iPad13,6", "iPad13,7":
134
144
  return ExpoDeviceType(modelName: "iPad Pro (11-inch) (3rd generation)", deviceYearClass: 2021)
145
+ case "iPad14,3-A", "iPad14,3-B", "iPad14,4-A", "iPad14,4-B":
146
+ return ExpoDeviceType(modelName: "iPad Pro (11-inch) (4rd generation)", deviceYearClass: 2022)
135
147
  case "iPad6,7", "iPad6,8":
136
148
  return ExpoDeviceType(modelName: "iPad Pro (12.9-inch) (1st generation)", deviceYearClass: 2015)
137
149
  case "iPad7,1", "iPad7,2":
@@ -142,6 +154,8 @@ public extension UIDevice {
142
154
  return ExpoDeviceType(modelName: "iPad Pro (12.9-inch) (4th generation)", deviceYearClass: 2020)
143
155
  case "iPad13,8", "iPad13,9", "iPad13,10", "iPad13,11":
144
156
  return ExpoDeviceType(modelName: "iPad Pro (12.9-inch) (5th generation)", deviceYearClass: 2021)
157
+ case "iPad14,5-A", "iPad14,5-B", "iPad14,6-A", "iPad14,6-B":
158
+ return ExpoDeviceType(modelName: "iPad Pro (12.9-inch) (6th generation)", deviceYearClass: 2022)
145
159
  case "AppleTV5,3":
146
160
  return ExpoDeviceType(modelName: "Apple TV HD (4th Generation, Siri)", deviceYearClass: 2015)
147
161
  case "AppleTV6,2":
@@ -160,7 +174,7 @@ public extension UIDevice {
160
174
  case "i386", "x86_64":
161
175
  return ExpoDeviceType(modelName: "Simulator tvOS", deviceYearClass: currentYear)
162
176
  default:
163
- return identifier
177
+ return ExpoDeviceType(modelName: identifier, deviceYearClass: currentYear)
164
178
  }
165
179
  #endif
166
180
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-device",
3
- "version": "5.7.0",
3
+ "version": "5.8.0",
4
4
  "description": "A universal module that gets physical information about the device running the application",
5
5
  "main": "build/Device.js",
6
6
  "types": "build/Device.d.ts",
@@ -41,5 +41,5 @@
41
41
  "peerDependencies": {
42
42
  "expo": "*"
43
43
  },
44
- "gitHead": "ee2c866ba3c7fbc35ff2a3e896041cf15d3bd7c5"
44
+ "gitHead": "da25937e2a99661cbe5eb60ca1d8d6245fc96a50"
45
45
  }