-
Notifications
You must be signed in to change notification settings - Fork 148
Feature: Tracking API and Advertiser ID collection management #266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
db4f70d
e18bd9e
e11b77d
6e18806
9b8e033
5b04aeb
8baae84
96a65a6
e5c7144
6014968
e182cca
5f1abbf
82a3d0c
be2a393
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| #Thu Dec 10 14:52:09 CET 2020 | ||
| distributionBase=GRADLE_USER_HOME | ||
| distributionPath=wrapper/dists | ||
| zipStoreBase=GRADLE_USER_HOME | ||
| zipStorePath=wrapper/dists | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-3.5.1-all.zip | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we make sure this make the library usable for RN lower than 0.64?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, according to the rn upgrade helper, RN 0.63 uses
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. mhm, I see that 6.2 is used on RN 0.63, so it's not too bad. Would be cool to test on lower RN versions (but up to 0.61 max). Will require a major bump anyway
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 0.61 uses gradle 5, 0.62 uses gradle 6 - I don't have a lot of android experience, but shouldn't it build either way? |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| import { NativeModules } from 'react-native'; | ||
| import { NativeModules, Platform } from 'react-native'; | ||
|
|
||
| const { CTKAdSettingsManager } = NativeModules; | ||
|
|
||
|
|
@@ -10,6 +10,8 @@ type SDKLogLevel = | |
| | 'error' | ||
| | 'notification'; | ||
|
|
||
| export type TrackingStatus = 'unavailable' | 'denied' | 'authorized' | 'restricted' | 'not-determined'; | ||
|
|
||
| export default { | ||
| /** | ||
| * Contains hash of the device id | ||
|
|
@@ -53,5 +55,33 @@ export default { | |
| */ | ||
| setUrlPrefix(urlPrefix: string) { | ||
| CTKAdSettingsManager.setUrlPrefix(urlPrefix); | ||
| }, | ||
|
|
||
| /** | ||
| * Requests permission to track the user. | ||
| * | ||
| * Requires a [`NSUserTrackingUsageDescription`](https://developer.apple.com/documentation/bundleresources/information_property_list/nsusertrackingusagedescription) in your `Info.plist` | ||
| * | ||
| * @platform iOS 14 | ||
| */ | ||
| async requestTrackingPermission(): Promise<TrackingStatus> { | ||
| if (Platform.OS !== 'ios') return 'unavailable'; | ||
| return await CTKAdSettingsManager.requestTrackingPermission(); | ||
| }, | ||
| /** | ||
| * Gets the current tracking status. | ||
| * | ||
| * @platform iOS 14 | ||
| */ | ||
| async getTrackingStatus(): Promise<TrackingStatus> { | ||
| if (Platform.OS !== 'ios') return 'unavailable'; | ||
| return await CTKAdSettingsManager.getTrackingStatus(); | ||
| }, | ||
|
|
||
| /** | ||
| * Enable or disable the automatic Advertiser ID Collection. On iOS 14 it is recommended to only enable automatic Advertiser ID Collection when the user has granted permission to track. (@see `requestTrackingPermission()`) | ||
| */ | ||
| setAdvertiserIDCollectionEnabled(enabled: boolean): void { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yup, let's make sure this is documented in the README or so
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alright, everything's documented in the README now |
||
| CTKAdSettingsManager.setAdvertiserIDCollectionEnabled(enabled); | ||
| } | ||
| }; | ||

Uh oh!
There was an error while loading. Please reload this page.