expo-tracking-transparency 1.1.2 โ 2.0.3
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 +24 -2
- package/build/ExpoTrackingTransparency.d.ts +1 -1
- package/build/ExpoTrackingTransparency.js +1 -1
- package/build/ExpoTrackingTransparency.js.map +1 -1
- package/build/TrackingTransparency.d.ts +20 -3
- package/build/TrackingTransparency.js +22 -3
- package/build/TrackingTransparency.js.map +1 -1
- package/expo-module.config.json +7 -0
- package/ios/EXTrackingTransparency/EXTrackingPermissionRequester.m +3 -3
- package/ios/EXTrackingTransparency/EXTrackingTransparencyModule.h +3 -3
- package/ios/EXTrackingTransparency/EXTrackingTransparencyModule.m +8 -8
- package/ios/EXTrackingTransparency/TrackingTransparencyModule.swift +29 -0
- package/ios/EXTrackingTransparency.podspec +10 -3
- package/ios/Info-generated.plist +22 -0
- package/package.json +5 -5
- package/plugin/build/withTrackingTransparency.js +2 -1
- package/src/ExpoTrackingTransparency.ts +1 -1
- package/src/TrackingTransparency.ts +31 -4
package/CHANGELOG.md
CHANGED
|
@@ -10,14 +10,36 @@
|
|
|
10
10
|
|
|
11
11
|
### ๐ก Others
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## 2.0.3 โ 2021-10-21
|
|
14
14
|
|
|
15
15
|
_This version does not introduce any user-facing changes._
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## 2.0.2 โ 2021-10-15
|
|
18
18
|
|
|
19
19
|
_This version does not introduce any user-facing changes._
|
|
20
20
|
|
|
21
|
+
## 2.0.1 โ 2021-10-01
|
|
22
|
+
|
|
23
|
+
_This version does not introduce any user-facing changes._
|
|
24
|
+
|
|
25
|
+
## 2.0.0 โ 2021-09-28
|
|
26
|
+
|
|
27
|
+
### ๐ Breaking changes
|
|
28
|
+
|
|
29
|
+
- Dropped support for iOS 11.0 ([#14383](https://github.com/expo/expo/pull/14383) by [@cruzach](https://github.com/cruzach))
|
|
30
|
+
|
|
31
|
+
### ๐ New features
|
|
32
|
+
|
|
33
|
+
- Add `useTrackingPermissions` hook from modules factory. ([#13864](https://github.com/expo/expo/pull/13864) by [@bycedric](https://github.com/bycedric))
|
|
34
|
+
|
|
35
|
+
### ๐ Bug fixes
|
|
36
|
+
|
|
37
|
+
- Fix building errors from use_frameworks! in Podfile. ([#14523](https://github.com/expo/expo/pull/14523) by [@kudo](https://github.com/kudo))
|
|
38
|
+
|
|
39
|
+
### ๐ก Others
|
|
40
|
+
|
|
41
|
+
- Updated `@expo/config-plugins` ([#14443](https://github.com/expo/expo/pull/14443) by [@EvanBacon](https://github.com/EvanBacon))
|
|
42
|
+
|
|
21
43
|
## 1.1.0 โ 2021-06-16
|
|
22
44
|
|
|
23
45
|
### ๐ก Others
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("
|
|
1
|
+
declare const _default: import("expo-modules-core").ProxyNativeModule;
|
|
2
2
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoTrackingTransparency.js","sourceRoot":"","sources":["../src/ExpoTrackingTransparency.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ExpoTrackingTransparency.js","sourceRoot":"","sources":["../src/ExpoTrackingTransparency.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,eAAe,kBAAkB,CAAC,wBAAwB,CAAC","sourcesContent":["import { NativeModulesProxy } from 'expo-modules-core';\n\nexport default NativeModulesProxy.ExpoTrackingTransparency;\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PermissionResponse, PermissionStatus, PermissionExpiration } from 'expo-modules-core';
|
|
1
|
+
import { PermissionResponse, PermissionStatus, PermissionExpiration, PermissionHookOptions } from 'expo-modules-core';
|
|
2
2
|
/**
|
|
3
3
|
* Requests the user to authorize or deny access to app-related data that can be used for tracking
|
|
4
4
|
* the user or the device. Examples of data used for tracking include email address, device ID,
|
|
@@ -22,7 +22,7 @@ import { PermissionResponse, PermissionStatus, PermissionExpiration } from 'expo
|
|
|
22
22
|
export declare function requestTrackingPermissionsAsync(): Promise<PermissionResponse>;
|
|
23
23
|
/**
|
|
24
24
|
* Checks whether or not the user has authorized the app to access app-related data that can be used
|
|
25
|
-
* for tracking the user or the device. See `
|
|
25
|
+
* for tracking the user or the device. See `requestTrackingPermissionsAsync` for more details.
|
|
26
26
|
*
|
|
27
27
|
* On Android, web, and iOS 13 and below, this method always returns that the permission was
|
|
28
28
|
* granted.
|
|
@@ -37,6 +37,23 @@ export declare function requestTrackingPermissionsAsync(): Promise<PermissionRes
|
|
|
37
37
|
* ```
|
|
38
38
|
*/
|
|
39
39
|
export declare function getTrackingPermissionsAsync(): Promise<PermissionResponse>;
|
|
40
|
+
/**
|
|
41
|
+
* Check or request the user to authorize or deny access to app-related data that can be used for tracking
|
|
42
|
+
* the user or the device. Examples of data used for tracking include email address, device ID,
|
|
43
|
+
* advertising ID, etc. On iOS 14.5 and above, if the user denies this permission, any attempt to
|
|
44
|
+
* collect the IDFA will return a string of 0s.
|
|
45
|
+
*
|
|
46
|
+
* The system remembers the userโs choice and doesnโt prompt again unless a user uninstalls and then
|
|
47
|
+
* reinstalls the app on the device.
|
|
48
|
+
*
|
|
49
|
+
* On Android, web, and iOS 13 and below, this method always returns that the permission was
|
|
50
|
+
* granted.
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* const [status, requestPermission] = useTrackingPermissions();
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export declare const useTrackingPermissions: (options?: PermissionHookOptions<object> | undefined) => [PermissionResponse | null, () => Promise<PermissionResponse>, () => Promise<PermissionResponse>];
|
|
40
57
|
/**
|
|
41
58
|
* Returns whether the TrackingTransparency API is available on the current device.
|
|
42
59
|
*
|
|
@@ -45,4 +62,4 @@ export declare function getTrackingPermissionsAsync(): Promise<PermissionRespons
|
|
|
45
62
|
* resolve to `granted`.
|
|
46
63
|
*/
|
|
47
64
|
export declare function isAvailable(): boolean;
|
|
48
|
-
export { PermissionResponse, PermissionStatus, PermissionExpiration };
|
|
65
|
+
export { PermissionResponse, PermissionStatus, PermissionExpiration, PermissionHookOptions };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { UnavailabilityError } from '
|
|
2
|
-
import { PermissionStatus } from 'expo-modules-core';
|
|
1
|
+
import { PermissionStatus, UnavailabilityError, createPermissionHook, } from 'expo-modules-core';
|
|
3
2
|
import { Platform } from 'react-native';
|
|
4
3
|
import ExpoTrackingTransparency from './ExpoTrackingTransparency';
|
|
5
4
|
const androidAndWebPermissionsResponse = {
|
|
@@ -39,7 +38,7 @@ export async function requestTrackingPermissionsAsync() {
|
|
|
39
38
|
}
|
|
40
39
|
/**
|
|
41
40
|
* Checks whether or not the user has authorized the app to access app-related data that can be used
|
|
42
|
-
* for tracking the user or the device. See `
|
|
41
|
+
* for tracking the user or the device. See `requestTrackingPermissionsAsync` for more details.
|
|
43
42
|
*
|
|
44
43
|
* On Android, web, and iOS 13 and below, this method always returns that the permission was
|
|
45
44
|
* granted.
|
|
@@ -62,6 +61,26 @@ export async function getTrackingPermissionsAsync() {
|
|
|
62
61
|
}
|
|
63
62
|
return await ExpoTrackingTransparency.getPermissionsAsync();
|
|
64
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Check or request the user to authorize or deny access to app-related data that can be used for tracking
|
|
66
|
+
* the user or the device. Examples of data used for tracking include email address, device ID,
|
|
67
|
+
* advertising ID, etc. On iOS 14.5 and above, if the user denies this permission, any attempt to
|
|
68
|
+
* collect the IDFA will return a string of 0s.
|
|
69
|
+
*
|
|
70
|
+
* The system remembers the userโs choice and doesnโt prompt again unless a user uninstalls and then
|
|
71
|
+
* reinstalls the app on the device.
|
|
72
|
+
*
|
|
73
|
+
* On Android, web, and iOS 13 and below, this method always returns that the permission was
|
|
74
|
+
* granted.
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* const [status, requestPermission] = useTrackingPermissions();
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export const useTrackingPermissions = createPermissionHook({
|
|
81
|
+
getMethod: getTrackingPermissionsAsync,
|
|
82
|
+
requestMethod: requestTrackingPermissionsAsync,
|
|
83
|
+
});
|
|
65
84
|
/**
|
|
66
85
|
* Returns whether the TrackingTransparency API is available on the current device.
|
|
67
86
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrackingTransparency.js","sourceRoot":"","sources":["../src/TrackingTransparency.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"TrackingTransparency.js","sourceRoot":"","sources":["../src/TrackingTransparency.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAGhB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAElE,MAAM,gCAAgC,GAAuB;IAC3D,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,IAAI;IACjB,MAAM,EAAE,gBAAgB,CAAC,OAAO;CACjC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,KAAK,UAAU,+BAA+B;IACnD,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,EAAE;QACzB,OAAO,OAAO,CAAC,OAAO,CAAC,gCAAgC,CAAC,CAAC;KAC1D;IAED,IAAI,CAAC,wBAAwB,CAAC,uBAAuB,EAAE;QACrD,MAAM,IAAI,mBAAmB,CAAC,sBAAsB,EAAE,yBAAyB,CAAC,CAAC;KAClF;IACD,OAAO,MAAM,wBAAwB,CAAC,uBAAuB,EAAE,CAAC;AAClE,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,2BAA2B;IAC/C,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,EAAE;QACzB,OAAO,OAAO,CAAC,OAAO,CAAC,gCAAgC,CAAC,CAAC;KAC1D;IAED,IAAI,CAAC,wBAAwB,CAAC,mBAAmB,EAAE;QACjD,MAAM,IAAI,mBAAmB,CAAC,sBAAsB,EAAE,qBAAqB,CAAC,CAAC;KAC9E;IACD,OAAO,MAAM,wBAAwB,CAAC,mBAAmB,EAAE,CAAC;AAC9D,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,oBAAoB,CAAC;IACzD,SAAS,EAAE,2BAA2B;IACtC,aAAa,EAAE,+BAA+B;CAC/C,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO,CACL,QAAQ,CAAC,EAAE,KAAK,KAAK;QACrB,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE;QAC/C,wBAAwB,CACzB,CAAC;AACJ,CAAC;AAED,OAAO,EAAsB,gBAAgB,EAA+C,CAAC","sourcesContent":["import {\n PermissionResponse,\n PermissionStatus,\n PermissionExpiration,\n PermissionHookOptions,\n UnavailabilityError,\n createPermissionHook,\n} from 'expo-modules-core';\nimport { Platform } from 'react-native';\n\nimport ExpoTrackingTransparency from './ExpoTrackingTransparency';\n\nconst androidAndWebPermissionsResponse: PermissionResponse = {\n granted: true,\n expires: 'never',\n canAskAgain: true,\n status: PermissionStatus.GRANTED,\n};\n\n/**\n * Requests the user to authorize or deny access to app-related data that can be used for tracking\n * the user or the device. Examples of data used for tracking include email address, device ID,\n * advertising ID, etc. On iOS 14.5 and above, if the user denies this permission, any attempt to\n * collect the IDFA will return a string of 0s.\n *\n * The system remembers the userโs choice and doesnโt prompt again unless a user uninstalls and then\n * reinstalls the app on the device.\n *\n * On Android, web, and iOS 13 and below, this method always returns that the permission was\n * granted.\n * @example\n * ```typescript\n * const { granted } = await requestTrackingPermissionsAsync();\n *\n * if (granted) {\n * // Your app is authorized to track the user or their device\n * }\n * ```\n */\nexport async function requestTrackingPermissionsAsync(): Promise<PermissionResponse> {\n if (Platform.OS !== 'ios') {\n return Promise.resolve(androidAndWebPermissionsResponse);\n }\n\n if (!ExpoTrackingTransparency.requestPermissionsAsync) {\n throw new UnavailabilityError('TrackingTransparency', 'requestPermissionsAsync');\n }\n return await ExpoTrackingTransparency.requestPermissionsAsync();\n}\n\n/**\n * Checks whether or not the user has authorized the app to access app-related data that can be used\n * for tracking the user or the device. See `requestTrackingPermissionsAsync` for more details.\n *\n * On Android, web, and iOS 13 and below, this method always returns that the permission was\n * granted.\n *\n * @example\n * ```typescript\n * const { granted } = await getTrackingPermissionsAsync();\n *\n * if (granted) {\n * // Your app is authorized to track the user or their device\n * }\n * ```\n */\nexport async function getTrackingPermissionsAsync(): Promise<PermissionResponse> {\n if (Platform.OS !== 'ios') {\n return Promise.resolve(androidAndWebPermissionsResponse);\n }\n\n if (!ExpoTrackingTransparency.getPermissionsAsync) {\n throw new UnavailabilityError('TrackingTransparency', 'getPermissionsAsync');\n }\n return await ExpoTrackingTransparency.getPermissionsAsync();\n}\n\n/**\n * Check or request the user to authorize or deny access to app-related data that can be used for tracking\n * the user or the device. Examples of data used for tracking include email address, device ID,\n * advertising ID, etc. On iOS 14.5 and above, if the user denies this permission, any attempt to\n * collect the IDFA will return a string of 0s.\n *\n * The system remembers the userโs choice and doesnโt prompt again unless a user uninstalls and then\n * reinstalls the app on the device.\n *\n * On Android, web, and iOS 13 and below, this method always returns that the permission was\n * granted.\n * @example\n * ```ts\n * const [status, requestPermission] = useTrackingPermissions();\n * ```\n */\nexport const useTrackingPermissions = createPermissionHook({\n getMethod: getTrackingPermissionsAsync,\n requestMethod: requestTrackingPermissionsAsync,\n});\n\n/**\n * Returns whether the TrackingTransparency API is available on the current device.\n *\n * @returns Currently this is `true` on iOS 14 and above only. On devices where the\n * Tracking Transparency API is unavailable, the get and request permissions methods will always\n * resolve to `granted`.\n */\nexport function isAvailable(): boolean {\n return (\n Platform.OS === 'ios' &&\n parseInt(Platform.Version.toString(), 10) >= 14 &&\n ExpoTrackingTransparency\n );\n}\n\nexport { PermissionResponse, PermissionStatus, PermissionExpiration, PermissionHookOptions };\n"]}
|
|
@@ -39,12 +39,12 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
- (void)requestPermissionsWithResolver:(
|
|
42
|
+
- (void)requestPermissionsWithResolver:(EXPromiseResolveBlock)resolve rejecter:(EXPromiseRejectBlock)reject
|
|
43
43
|
{
|
|
44
44
|
if (@available(iOS 14, *)) {
|
|
45
|
-
|
|
45
|
+
EX_WEAKIFY(self)
|
|
46
46
|
[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
|
|
47
|
-
|
|
47
|
+
EX_STRONGIFY(self)
|
|
48
48
|
resolve([self getPermissions]);
|
|
49
49
|
}];
|
|
50
50
|
} else {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// Copyright 2021-present 650 Industries. All rights reserved.
|
|
2
2
|
|
|
3
|
-
#import <
|
|
4
|
-
#import <
|
|
3
|
+
#import <ExpoModulesCore/EXExportedModule.h>
|
|
4
|
+
#import <ExpoModulesCore/EXModuleRegistryConsumer.h>
|
|
5
5
|
|
|
6
6
|
NS_ASSUME_NONNULL_BEGIN
|
|
7
7
|
|
|
8
|
-
@interface EXTrackingTransparencyModule :
|
|
8
|
+
@interface EXTrackingTransparencyModule : EXExportedModule <EXModuleRegistryConsumer>
|
|
9
9
|
@end
|
|
10
10
|
|
|
11
11
|
NS_ASSUME_NONNULL_END
|
|
@@ -16,17 +16,17 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
16
16
|
|
|
17
17
|
@implementation EXTrackingTransparencyModule
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
EX_EXPORT_MODULE(ExpoTrackingTransparency);
|
|
20
20
|
|
|
21
|
-
- (void)setModuleRegistry:(
|
|
21
|
+
- (void)setModuleRegistry:(EXModuleRegistry *)moduleRegistry
|
|
22
22
|
{
|
|
23
23
|
_permissionsManager = [moduleRegistry getModuleImplementingProtocol:@protocol(EXPermissionsInterface)];
|
|
24
24
|
[EXPermissionsMethodsDelegate registerRequesters:@[[EXTrackingPermissionRequester new]] withPermissionsManager:_permissionsManager];
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
getPermissionsAsync:(
|
|
29
|
-
rejecter:(
|
|
27
|
+
EX_EXPORT_METHOD_AS(getPermissionsAsync,
|
|
28
|
+
getPermissionsAsync:(EXPromiseResolveBlock)resolve
|
|
29
|
+
rejecter:(EXPromiseRejectBlock)reject)
|
|
30
30
|
{
|
|
31
31
|
[EXPermissionsMethodsDelegate getPermissionWithPermissionsManager:_permissionsManager
|
|
32
32
|
withRequester:[EXTrackingPermissionRequester class]
|
|
@@ -34,9 +34,9 @@ UM_EXPORT_METHOD_AS(getPermissionsAsync,
|
|
|
34
34
|
reject:reject];
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
requestPermissionsAsync:(
|
|
39
|
-
rejecter:(
|
|
37
|
+
EX_EXPORT_METHOD_AS(requestPermissionsAsync,
|
|
38
|
+
requestPermissionsAsync:(EXPromiseResolveBlock)resolve
|
|
39
|
+
rejecter:(EXPromiseRejectBlock)reject)
|
|
40
40
|
{
|
|
41
41
|
[EXPermissionsMethodsDelegate askForPermissionWithPermissionsManager:_permissionsManager
|
|
42
42
|
withRequester:[EXTrackingPermissionRequester class]
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import ExpoModulesCore
|
|
2
|
+
|
|
3
|
+
public class TrackingTransparencyModule: Module {
|
|
4
|
+
public func definition() -> ModuleDefinition {
|
|
5
|
+
name("ExpoTrackingTransparency")
|
|
6
|
+
|
|
7
|
+
onCreate {
|
|
8
|
+
EXPermissionsMethodsDelegate.register([EXTrackingPermissionRequester()], withPermissionsManager: self.appContext?.permissions)
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
method("getPermissionsAsync") { (promise: Promise) in
|
|
12
|
+
EXPermissionsMethodsDelegate.getPermissionWithPermissionsManager(
|
|
13
|
+
self.appContext?.permissions,
|
|
14
|
+
withRequester: EXTrackingPermissionRequester.self,
|
|
15
|
+
resolve: promise.resolver,
|
|
16
|
+
reject: promise.legacyRejecter
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
method("requestPermissionsAsync") { (promise: Promise) in
|
|
21
|
+
EXPermissionsMethodsDelegate.askForPermission(
|
|
22
|
+
withPermissionsManager: self.appContext?.permissions,
|
|
23
|
+
withRequester: EXTrackingPermissionRequester.self,
|
|
24
|
+
resolve: promise.resolver,
|
|
25
|
+
reject: promise.legacyRejecter
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -10,15 +10,22 @@ 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
|
+
s.platform = :ios, '12.0'
|
|
14
|
+
s.swift_version = '5.4'
|
|
14
15
|
s.source = { git: 'https://github.com/expo/expo.git' }
|
|
16
|
+
s.static_framework = true
|
|
15
17
|
|
|
16
|
-
s.dependency '
|
|
18
|
+
s.dependency 'ExpoModulesCore'
|
|
19
|
+
|
|
20
|
+
# Swift/Objective-C compatibility
|
|
21
|
+
s.pod_target_xcconfig = {
|
|
22
|
+
'DEFINES_MODULE' => 'YES'
|
|
23
|
+
}
|
|
17
24
|
|
|
18
25
|
if !$ExpoUseSources&.include?(package['name']) && ENV['EXPO_USE_SOURCE'].to_i == 0 && File.exist?("#{s.name}.xcframework") && Gem::Version.new(Pod::VERSION) >= Gem::Version.new('1.10.0')
|
|
19
26
|
s.source_files = "#{s.name}/**/*.h"
|
|
20
27
|
s.vendored_frameworks = "#{s.name}.xcframework"
|
|
21
28
|
else
|
|
22
|
-
s.source_files = "#{s.name}/**/*.{h,m}"
|
|
29
|
+
s.source_files = "#{s.name}/**/*.{h,m,swift}"
|
|
23
30
|
end
|
|
24
31
|
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>CFBundleDevelopmentRegion</key>
|
|
6
|
+
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
|
7
|
+
<key>CFBundleExecutable</key>
|
|
8
|
+
<string>$(EXECUTABLE_NAME)</string>
|
|
9
|
+
<key>CFBundleIdentifier</key>
|
|
10
|
+
<string>expo.tracking.transparency</string>
|
|
11
|
+
<key>CFBundleInfoDictionaryVersion</key>
|
|
12
|
+
<string>6.0</string>
|
|
13
|
+
<key>CFBundleName</key>
|
|
14
|
+
<string>EXTrackingTransparency</string>
|
|
15
|
+
<key>CFBundlePackageType</key>
|
|
16
|
+
<string>FMWK</string>
|
|
17
|
+
<key>CFBundleShortVersionString</key>
|
|
18
|
+
<string>1.1.0</string>
|
|
19
|
+
<key>CFBundleVersion</key>
|
|
20
|
+
<string>1</string>
|
|
21
|
+
</dict>
|
|
22
|
+
</plist>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-tracking-transparency",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.3",
|
|
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",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
},
|
|
29
29
|
"author": "650 Industries, Inc.",
|
|
30
30
|
"license": "MIT",
|
|
31
|
-
"homepage": "https://docs.expo.
|
|
31
|
+
"homepage": "https://docs.expo.dev/versions/latest/sdk/module-template",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@expo/config-plugins": "^
|
|
34
|
-
"expo-modules-core": "~0.
|
|
33
|
+
"@expo/config-plugins": "^4.0.2",
|
|
34
|
+
"expo-modules-core": "~0.4.4"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"expo-module-scripts": "^2.0.0"
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"jest": {
|
|
40
40
|
"preset": "expo-module-scripts/ios"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "4fa0497a180ae707fa860cb03858630ab7af19f4"
|
|
43
43
|
}
|
|
@@ -8,7 +8,7 @@ const withTrackingTransparency = (config, props) => {
|
|
|
8
8
|
config = exports.withUserTrackingPermission(config, props);
|
|
9
9
|
return config;
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
const withUserTrackingPermission = (config, { userTrackingPermission } = {}) => {
|
|
12
12
|
if (!config.ios)
|
|
13
13
|
config.ios = {};
|
|
14
14
|
if (!config.ios.infoPlist)
|
|
@@ -19,4 +19,5 @@ exports.withUserTrackingPermission = (config, { userTrackingPermission } = {}) =
|
|
|
19
19
|
exports.DEFAULT_NSUserTrackingUsageDescription;
|
|
20
20
|
return config;
|
|
21
21
|
};
|
|
22
|
+
exports.withUserTrackingPermission = withUserTrackingPermission;
|
|
22
23
|
exports.default = config_plugins_1.createRunOncePlugin(withTrackingTransparency, pkg.name, pkg.version);
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
PermissionResponse,
|
|
3
|
+
PermissionStatus,
|
|
4
|
+
PermissionExpiration,
|
|
5
|
+
PermissionHookOptions,
|
|
6
|
+
UnavailabilityError,
|
|
7
|
+
createPermissionHook,
|
|
8
|
+
} from 'expo-modules-core';
|
|
3
9
|
import { Platform } from 'react-native';
|
|
4
10
|
|
|
5
11
|
import ExpoTrackingTransparency from './ExpoTrackingTransparency';
|
|
@@ -44,7 +50,7 @@ export async function requestTrackingPermissionsAsync(): Promise<PermissionRespo
|
|
|
44
50
|
|
|
45
51
|
/**
|
|
46
52
|
* Checks whether or not the user has authorized the app to access app-related data that can be used
|
|
47
|
-
* for tracking the user or the device. See `
|
|
53
|
+
* for tracking the user or the device. See `requestTrackingPermissionsAsync` for more details.
|
|
48
54
|
*
|
|
49
55
|
* On Android, web, and iOS 13 and below, this method always returns that the permission was
|
|
50
56
|
* granted.
|
|
@@ -69,6 +75,27 @@ export async function getTrackingPermissionsAsync(): Promise<PermissionResponse>
|
|
|
69
75
|
return await ExpoTrackingTransparency.getPermissionsAsync();
|
|
70
76
|
}
|
|
71
77
|
|
|
78
|
+
/**
|
|
79
|
+
* Check or request the user to authorize or deny access to app-related data that can be used for tracking
|
|
80
|
+
* the user or the device. Examples of data used for tracking include email address, device ID,
|
|
81
|
+
* advertising ID, etc. On iOS 14.5 and above, if the user denies this permission, any attempt to
|
|
82
|
+
* collect the IDFA will return a string of 0s.
|
|
83
|
+
*
|
|
84
|
+
* The system remembers the userโs choice and doesnโt prompt again unless a user uninstalls and then
|
|
85
|
+
* reinstalls the app on the device.
|
|
86
|
+
*
|
|
87
|
+
* On Android, web, and iOS 13 and below, this method always returns that the permission was
|
|
88
|
+
* granted.
|
|
89
|
+
* @example
|
|
90
|
+
* ```ts
|
|
91
|
+
* const [status, requestPermission] = useTrackingPermissions();
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
export const useTrackingPermissions = createPermissionHook({
|
|
95
|
+
getMethod: getTrackingPermissionsAsync,
|
|
96
|
+
requestMethod: requestTrackingPermissionsAsync,
|
|
97
|
+
});
|
|
98
|
+
|
|
72
99
|
/**
|
|
73
100
|
* Returns whether the TrackingTransparency API is available on the current device.
|
|
74
101
|
*
|
|
@@ -84,4 +111,4 @@ export function isAvailable(): boolean {
|
|
|
84
111
|
);
|
|
85
112
|
}
|
|
86
113
|
|
|
87
|
-
export { PermissionResponse, PermissionStatus, PermissionExpiration };
|
|
114
|
+
export { PermissionResponse, PermissionStatus, PermissionExpiration, PermissionHookOptions };
|