expo-tracking-transparency 4.0.0 → 4.0.2

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,14 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 4.0.2 — 2024-04-29
14
+
15
+ _This version does not introduce any user-facing changes._
16
+
17
+ ## 4.0.1 — 2024-04-23
18
+
19
+ _This version does not introduce any user-facing changes._
20
+
13
21
  ## 4.0.0 — 2024-04-18
14
22
 
15
23
  ### 🐛 Bug fixes
@@ -1,7 +1,7 @@
1
1
  apply plugin: 'com.android.library'
2
2
 
3
3
  group = 'host.exp.exponent'
4
- version = '4.0.0'
4
+ version = '4.0.2'
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 "4.0.0"
17
+ versionName "4.0.2"
18
18
  }
19
19
  }
20
20
 
@@ -1 +1 @@
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,aAAa,GAAG,wBAAwB,CAAC,gBAAgB,EAAE,CAAC;IAClE,IAAI,aAAa,KAAK,sCAAsC,EAAE,CAAC;QAC7D,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,aAAa,CAAC;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AQ,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\n/**\n * Gets the advertising ID, a UUID string intended only for advertising. Use this string for\n * frequency capping, attribution, conversion events, estimating the number of unique users,\n * advertising fraud detection, and debugging.\n *\n * As a best practice, don't store the advertising ID. Instead, call this function each time your\n * app needs to use the advertising ID. Users can change whether they allow app tracking and can\n * reset their advertising ID at any time in their system settings. Check your app's authorization\n * using `getTrackingPermissionsAsync()` to determine the user's intent.\n *\n * On Android, this function returns the \"Android Advertising ID\"\n * ([AAID](https://developers.google.com/android/reference/com/google/android/gms/ads/identifier/AdvertisingIdClient.Info#public-string-getid)).\n * On Android devices that support multiple users, including guest users, it's possible for your app\n * to obtain different advertising IDs on the same device. These different IDs correspond to\n * different users who could be signed in on that device. See Google's documentation for more\n * information: [Get a user-resettable advertising\n * ID](https://developer.android.com/training/articles/ad-id).\n *\n * On iOS, this function returns the \"Identifier for Advertisers\"\n * ([IDFA](https://developer.apple.com/documentation/adsupport/asidentifiermanager/advertisingidentifier)),\n * a string that's unique to each device. On devices running iOS 14.5 and newer, your app must\n * request tracking authorization using `requestTrackingPermissionsAsync()` before it can get the\n * advertising identifier.\n *\n * @return Returns either a UUID `string` or `null`. It returns null in the following cases:\n * - On Android, when `isLimitAdTrackingEnabled()` is `true`\n * - In the iOS simulator, regardless of any settings\n * - On devices running iOS 14.5 and later if you haven't received permission using\n * `requestTrackingPermissionsAsync()`\n * - On iOS, if you've requested permission and the user declines\n * - On iOS, when a profile or configuration restricts access to the advertising identifier, such as\n * when the user has turned off the system-wide \"Allow Apps to Request to Track\" setting\n *\n * @example\n * ```ts\n * TrackingTransparency.getAdvertisingId();\n * // \"E9228286-4C4E-4789-9D95-15827DCB291B\"\n * ```\n */\nexport function getAdvertisingId(): string | null {\n const advertisingId = ExpoTrackingTransparency.getAdvertisingId();\n if (advertisingId === '00000000-0000-0000-0000-000000000000') {\n return null;\n }\n return advertisingId;\n}\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"]}
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,aAAa,GAAG,wBAAwB,CAAC,gBAAgB,EAAE,CAAC;IAClE,IAAI,aAAa,KAAK,sCAAsC,EAAE;QAC5D,OAAO,IAAI,CAAC;KACb;IACD,OAAO,a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;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\n/**\n * Gets the advertising ID, a UUID string intended only for advertising. Use this string for\n * frequency capping, attribution, conversion events, estimating the number of unique users,\n * advertising fraud detection, and debugging.\n *\n * As a best practice, don't store the advertising ID. Instead, call this function each time your\n * app needs to use the advertising ID. Users can change whether they allow app tracking and can\n * reset their advertising ID at any time in their system settings. Check your app's authorization\n * using `getTrackingPermissionsAsync()` to determine the user's intent.\n *\n * On Android, this function returns the \"Android Advertising ID\"\n * ([AAID](https://developers.google.com/android/reference/com/google/android/gms/ads/identifier/AdvertisingIdClient.Info#public-string-getid)).\n * On Android devices that support multiple users, including guest users, it's possible for your app\n * to obtain different advertising IDs on the same device. These different IDs correspond to\n * different users who could be signed in on that device. See Google's documentation for more\n * information: [Get a user-resettable advertising\n * ID](https://developer.android.com/training/articles/ad-id).\n *\n * On iOS, this function returns the \"Identifier for Advertisers\"\n * ([IDFA](https://developer.apple.com/documentation/adsupport/asidentifiermanager/advertisingidentifier)),\n * a string that's unique to each device. On devices running iOS 14.5 and newer, your app must\n * request tracking authorization using `requestTrackingPermissionsAsync()` before it can get the\n * advertising identifier.\n *\n * @return Returns either a UUID `string` or `null`. It returns null in the following cases:\n * - On Android, when `isLimitAdTrackingEnabled()` is `true`\n * - In the iOS simulator, regardless of any settings\n * - On devices running iOS 14.5 and later if you haven't received permission using\n * `requestTrackingPermissionsAsync()`\n * - On iOS, if you've requested permission and the user declines\n * - On iOS, when a profile or configuration restricts access to the advertising identifier, such as\n * when the user has turned off the system-wide \"Allow Apps to Request to Track\" setting\n *\n * @example\n * ```ts\n * TrackingTransparency.getAdvertisingId();\n * // \"E9228286-4C4E-4789-9D95-15827DCB291B\"\n * ```\n */\nexport function getAdvertisingId(): string | null {\n const advertisingId = ExpoTrackingTransparency.getAdvertisingId();\n if (advertisingId === '00000000-0000-0000-0000-000000000000') {\n return null;\n }\n return advertisingId;\n}\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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-tracking-transparency",
3
- "version": "4.0.0",
3
+ "version": "4.0.2",
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,7 +28,7 @@
28
28
  },
29
29
  "author": "650 Industries, Inc.",
30
30
  "license": "MIT",
31
- "homepage": "https://docs.expo.dev/versions/latest/sdk/module-template",
31
+ "homepage": "https://docs.expo.dev/versions/latest/sdk/tracking-transparency",
32
32
  "devDependencies": {
33
33
  "expo-module-scripts": "^3.0.0"
34
34
  },
@@ -38,5 +38,5 @@
38
38
  "jest": {
39
39
  "preset": "expo-module-scripts"
40
40
  },
41
- "gitHead": "4165b8d72e1b9a1889c2767534cc619e21468110"
41
+ "gitHead": "4a7cf0d0baf6dfc595d93f604945d2142e705a36"
42
42
  }