expo-tracking-transparency 5.0.0 → 5.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.
package/CHANGELOG.md CHANGED
@@ -10,6 +10,12 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 5.1.0 — 2024-11-29
14
+
15
+ ### 🎉 New features
16
+
17
+ - Added support for tvOS. ([#33157](https://github.com/expo/expo/pull/33157) by [@msynowski](https://github.com/msynowski))
18
+
13
19
  ## 5.0.0 — 2024-10-22
14
20
 
15
21
  ### 🛠 Breaking changes
@@ -1,7 +1,7 @@
1
1
  apply plugin: 'com.android.library'
2
2
 
3
3
  group = 'host.exp.exponent'
4
- version = '5.0.0'
4
+ version = '5.1.0'
5
5
 
6
6
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
7
7
  apply from: expoModulesCorePlugin
@@ -14,7 +14,7 @@ android {
14
14
  namespace "expo.modules.trackingtransparency"
15
15
  defaultConfig {
16
16
  versionCode 1
17
- versionName "5.0.0"
17
+ versionName "5.1.0"
18
18
  }
19
19
  }
20
20
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-tracking-transparency",
3
- "platforms": ["ios", "android"],
3
+ "platforms": ["apple", "android"],
4
4
  "ios": {
5
5
  "modulesClassNames": ["TrackingTransparencyModule"]
6
6
  },
@@ -11,7 +11,8 @@ Pod::Spec.new do |s|
11
11
  s.author = package['author']
12
12
  s.homepage = package['homepage']
13
13
  s.platforms = {
14
- :ios => '15.1'
14
+ :ios => '15.1',
15
+ :tvos => '15.1',
15
16
  }
16
17
  s.swift_version = '5.4'
17
18
  s.source = { git: 'https://github.com/expo/expo.git' }
@@ -9,45 +9,36 @@ public class TrackingTransparencyPermissionRequester: NSObject, EXPermissionsReq
9
9
  }
10
10
 
11
11
  public func requestPermissions(resolver resolve: @escaping EXPromiseResolveBlock, rejecter reject: EXPromiseRejectBlock) {
12
- if #available(iOS 14, *) {
13
- ATTrackingManager.requestTrackingAuthorization() { [weak self] _ in
14
- resolve(self?.getPermissions());
15
- }
16
- } else {
17
- resolve(self.getPermissions());
12
+ ATTrackingManager.requestTrackingAuthorization { [weak self] _ in
13
+ resolve(self?.getPermissions())
18
14
  }
19
15
  }
20
16
 
21
17
  public func getPermissions() -> [AnyHashable: Any] {
22
18
  var status: EXPermissionStatus
23
-
24
- if #available(iOS 14, *) {
25
- var systemStatus: ATTrackingManager.AuthorizationStatus
26
-
27
- let trackingUsageDescription = Bundle.main.object(forInfoDictionaryKey: "NSUserTrackingUsageDescription")
28
- if trackingUsageDescription == nil {
29
- EXFatal(EXErrorWithMessage("""
30
- This app is missing 'NSUserTrackingUsageDescription' so tracking transparency will fail. \
31
- Ensure that this key exists in app's Info.plist.
32
- """))
33
- systemStatus = .denied
34
- } else {
35
- systemStatus = ATTrackingManager.trackingAuthorizationStatus
36
- }
37
-
38
- switch systemStatus {
39
- case .authorized:
40
- status = EXPermissionStatusGranted
41
- case .restricted,
42
- .denied:
43
- status = EXPermissionStatusDenied
44
- case .notDetermined:
45
- fallthrough
46
- @unknown default:
47
- status = EXPermissionStatusUndetermined
48
- }
19
+
20
+ var systemStatus: ATTrackingManager.AuthorizationStatus
21
+
22
+ let trackingUsageDescription = Bundle.main.object(forInfoDictionaryKey: "NSUserTrackingUsageDescription")
23
+ if trackingUsageDescription == nil {
24
+ EXFatal(EXErrorWithMessage("""
25
+ This app is missing 'NSUserTrackingUsageDescription' so tracking transparency will fail. \
26
+ Ensure that this key exists in app's Info.plist.
27
+ """))
28
+ systemStatus = .denied
49
29
  } else {
30
+ systemStatus = ATTrackingManager.trackingAuthorizationStatus
31
+ }
32
+
33
+ switch systemStatus {
34
+ case .authorized:
50
35
  status = EXPermissionStatusGranted
36
+ case .restricted, .denied:
37
+ status = EXPermissionStatusDenied
38
+ case .notDetermined:
39
+ fallthrough
40
+ @unknown default:
41
+ status = EXPermissionStatusUndetermined
51
42
  }
52
43
 
53
44
  return [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-tracking-transparency",
3
- "version": "5.0.0",
3
+ "version": "5.1.0",
4
4
  "description": "An Expo library for requesting permission to track the users on devices using iOS 14.5 and higher.",
5
5
  "main": "build/TrackingTransparency.js",
6
6
  "types": "build/TrackingTransparency.d.ts",
@@ -39,5 +39,5 @@
39
39
  "jest": {
40
40
  "preset": "expo-module-scripts"
41
41
  },
42
- "gitHead": "685ebb8a213326cb33c80281ca8756b374ccb63d"
42
+ "gitHead": "728158f99d680cf64fb06f08301d3806c18c6f63"
43
43
  }