react-native-google-mobile-ads 4.2.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.
Files changed (83) hide show
  1. package/RNGoogleMobileAds.podspec +16 -9
  2. package/__tests__/consent.test.ts +17 -9
  3. package/android/build.gradle +4 -3
  4. package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsConsentModule.java +111 -168
  5. package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsModule.java +1 -1
  6. package/docs/common-reasons-for-ads-not-showing.mdx +26 -24
  7. package/docs/displaying-ads-hook.mdx +99 -0
  8. package/docs/displaying-ads.mdx +3 -4
  9. package/docs/european-user-consent.mdx +67 -156
  10. package/docs/index.mdx +16 -16
  11. package/docs/migrating-to-v5.mdx +63 -0
  12. package/docs.json +4 -2
  13. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsConsentModule.h +0 -1
  14. package/ios/RNGoogleMobileAds/RNGoogleMobileAdsConsentModule.m +83 -124
  15. package/ios_config.sh +8 -0
  16. package/lib/commonjs/AdsConsent.js +58 -98
  17. package/lib/commonjs/AdsConsent.js.map +1 -1
  18. package/lib/commonjs/AdsConsentPurposes.js +47 -0
  19. package/lib/commonjs/AdsConsentPurposes.js.map +1 -0
  20. package/lib/commonjs/AdsConsentSpecialFeatures.js +39 -0
  21. package/lib/commonjs/AdsConsentSpecialFeatures.js.map +1 -0
  22. package/lib/commonjs/AdsConsentStatus.js +4 -3
  23. package/lib/commonjs/AdsConsentStatus.js.map +1 -1
  24. package/lib/commonjs/hooks/useAppOpenAd.js +51 -0
  25. package/lib/commonjs/hooks/useAppOpenAd.js.map +1 -0
  26. package/lib/commonjs/hooks/useFullScreenAd.js +120 -0
  27. package/lib/commonjs/hooks/useFullScreenAd.js.map +1 -0
  28. package/lib/commonjs/hooks/useInterstitialAd.js +51 -0
  29. package/lib/commonjs/hooks/useInterstitialAd.js.map +1 -0
  30. package/lib/commonjs/hooks/useRewardedAd.js +51 -0
  31. package/lib/commonjs/hooks/useRewardedAd.js.map +1 -0
  32. package/lib/commonjs/index.js +40 -0
  33. package/lib/commonjs/index.js.map +1 -1
  34. package/lib/commonjs/types/AdStates.js +6 -0
  35. package/lib/commonjs/types/AdStates.js.map +1 -0
  36. package/lib/commonjs/version.js +1 -1
  37. package/lib/commonjs/version.js.map +1 -1
  38. package/lib/module/AdsConsent.js +56 -98
  39. package/lib/module/AdsConsent.js.map +1 -1
  40. package/lib/module/AdsConsentPurposes.js +39 -0
  41. package/lib/module/AdsConsentPurposes.js.map +1 -0
  42. package/lib/module/AdsConsentSpecialFeatures.js +31 -0
  43. package/lib/module/AdsConsentSpecialFeatures.js.map +1 -0
  44. package/lib/module/AdsConsentStatus.js +4 -3
  45. package/lib/module/AdsConsentStatus.js.map +1 -1
  46. package/lib/module/hooks/useAppOpenAd.js +38 -0
  47. package/lib/module/hooks/useAppOpenAd.js.map +1 -0
  48. package/lib/module/hooks/useFullScreenAd.js +109 -0
  49. package/lib/module/hooks/useFullScreenAd.js.map +1 -0
  50. package/lib/module/hooks/useInterstitialAd.js +38 -0
  51. package/lib/module/hooks/useInterstitialAd.js.map +1 -0
  52. package/lib/module/hooks/useRewardedAd.js +38 -0
  53. package/lib/module/hooks/useRewardedAd.js.map +1 -0
  54. package/lib/module/index.js +5 -0
  55. package/lib/module/index.js.map +1 -1
  56. package/lib/module/types/AdStates.js +2 -0
  57. package/lib/module/types/AdStates.js.map +1 -0
  58. package/lib/module/version.js +1 -1
  59. package/lib/module/version.js.map +1 -1
  60. package/lib/typescript/AdsConsentPurposes.d.ts +148 -0
  61. package/lib/typescript/AdsConsentSpecialFeatures.d.ts +22 -0
  62. package/lib/typescript/AdsConsentStatus.d.ts +10 -6
  63. package/lib/typescript/hooks/useAppOpenAd.d.ts +9 -0
  64. package/lib/typescript/hooks/useFullScreenAd.d.ts +5 -0
  65. package/lib/typescript/hooks/useInterstitialAd.d.ts +9 -0
  66. package/lib/typescript/hooks/useRewardedAd.d.ts +9 -0
  67. package/lib/typescript/index.d.ts +6 -1
  68. package/lib/typescript/types/AdStates.d.ts +85 -0
  69. package/lib/typescript/types/AdsConsent.interface.d.ts +229 -180
  70. package/lib/typescript/version.d.ts +1 -1
  71. package/package.json +10 -4
  72. package/src/AdsConsent.ts +91 -135
  73. package/src/AdsConsentPurposes.ts +182 -0
  74. package/src/AdsConsentSpecialFeatures.ts +48 -0
  75. package/src/AdsConsentStatus.ts +11 -6
  76. package/src/hooks/useAppOpenAd.ts +46 -0
  77. package/src/hooks/useFullScreenAd.ts +104 -0
  78. package/src/hooks/useInterstitialAd.ts +46 -0
  79. package/src/hooks/useRewardedAd.ts +46 -0
  80. package/src/index.ts +5 -0
  81. package/src/types/AdStates.ts +87 -0
  82. package/src/types/AdsConsent.interface.ts +230 -187
  83. package/src/version.ts +1 -1
@@ -1,3 +1,4 @@
1
+ import { TCModel } from '@iabtcf/core';
1
2
  import { AdsConsentDebugGeography } from '../AdsConsentDebugGeography';
2
3
  import { AdsConsentStatus } from '../AdsConsentStatus';
3
4
  /**
@@ -9,246 +10,122 @@ import { AdsConsentStatus } from '../AdsConsentStatus';
9
10
  * It is recommended that you determine the status of a user's consent at every app launch. The user consent status is held
10
11
  * on the device until a condition changes which requires the user to consent again, such as a change in publishers.
11
12
  *
12
- * For more information, see [here](https://developers.google.com/admob/android/eu-consent#delay_app_measurement_optional).
13
+ * For more information, see [here](https://developers.google.com/admob/ump/android/quick-start#delay_app_measurement_optional).
13
14
  */
14
- /**
15
- * A AdProvider interface returned from `AdsConsent.getProviders`.
16
- */
17
- export interface AdProvider {
18
- /**
19
- * A provider company ID.
20
- */
21
- companyId: string;
22
- /**
23
- * A provider company name.
24
- */
25
- companyName: string;
26
- /**
27
- * A fully formed URL for the privacy policy of the provider.
28
- */
29
- privacyPolicyUrl: string;
30
- }
31
15
  export interface AdsConsentInterface {
32
16
  /**
33
- * Requests user consent for a given list of publisher IDs.
34
- *
35
- * The list of publisher IDs can be obtained from the settings panel on the Google Mobile Ads console. If the list of
36
- * publisher IDs has changed since the last time a user provided consent, their consent status will be reset to
37
- * 'UNKNOWN' and they must provide consent again.
38
- *
39
- * If the request fails with the error "Could not parse Event FE preflight response", this means the state of your
40
- * Google Mobile Ads account is not complete. Ensure you have validated your account and have setup valid payment
41
- * information. This error is also thrown when a Publisher ID is invalid.
42
- *
43
- * The response from this method provides request location and consent status properties.
17
+ * Requests user consent information.
44
18
  *
45
- * If request location is within the EEA or unknown, and the consent status is also unknown, you
46
- * must request consent via the `showForm()` method or your own means.
47
- *
48
- * If the consent status is not unknown, the user has already previously provided consent for the current publisher
49
- * scope.
19
+ * The response from this method provides information about consent form availability and consent status.
50
20
  *
51
21
  * #### Example
52
22
  *
53
23
  * ```js
54
24
  * import { AdsConsent } from 'react-native-google-mobile-ads';
55
25
  *
56
- * const consent = await AdsConsent.requestInfoUpdate(['pub-6189033257628554']);
57
- * console.log('User location within EEA or Unknown:', consent.isRequestLocationInEeaOrUnknown);
58
- * console.log('User consent status:', consent.status);
26
+ * const consentInfo = await AdsConsent.requestInfoUpdate();
27
+ * console.log('A consent form is available:', consentInfo.isConsentFormAvailable);
28
+ * console.log('User consent status:', consentInfo.status);
59
29
  * ```
60
- *
61
- * @param publisherIds A list of publisher IDs found on your Google Mobile Ads dashboard.
30
+ * @param options An AdsConsentInfoOptions interface.
62
31
  */
63
- requestInfoUpdate(publisherIds: string[]): Promise<AdsConsentInfo>;
32
+ requestInfoUpdate(options?: AdsConsentInfoOptions): Promise<AdsConsentInfo>;
64
33
  /**
65
34
  * Shows a Google-rendered user consent form.
66
35
  *
67
- * The Google-rendered consent form is a full-screen configurable form that displays over your app content. The form
68
- * allows the following configuration options:
69
- *
70
- *
71
- * 1. Consent to view personalized ads (via `withPersonalizedAds`).
72
- * 2. Consent to view non-personalized ads (via `withNonPersonalizedAds`).
73
- * 3. Use a paid version of the app instead of viewing ads (via `withAdFree`).
74
- *
75
- * Every consent form requires a privacy policy URL which outlines the usage of your application.
76
- *
77
- * You should review the consent text carefully: what appears by default is a message that might be appropriate if
78
- * you use Google to monetize your app.
79
- *
80
- * If providing an ad-free version of your app, ensure you handle this once the form has been handled by the user
81
- * via the `userPrefersAdFree` property. The users preference on consent is automatically forwarded onto the Google
82
- * Mobile SDKs and saved.
83
- *
84
- * If the user is outside of the EEA, the request form will error.
85
- *
86
36
  * #### Example
87
37
  *
88
38
  * ```js
89
39
  * import { AdsConsent, AdsConsentStatus } from 'react-native-google-mobile-ads';
90
40
  *
91
41
  * async function requestConsent() {
92
- * const consent = await AdsConsent.requestInfoUpdate(['pub-6189033257628554']);
42
+ * const consentInfo = await AdsConsent.requestInfoUpdate();
93
43
  *
94
44
  * // Check if user requires consent
95
- * if (consent.isRequestLocationInEeaOrUnknown && consent.status === AdsConsentStatus.UNKNOWN) {
45
+ * if (
46
+ * consentInfo.isConsentFormAvailable &&
47
+ * (consentInfo.status === AdsConsentStatus.UNKNOWN ||
48
+ * consentInfo.status === AdsConsentStatus.REQUIRED)) {
96
49
  * // Show a Google-rendered form
97
- * const result = await AdsConsent.showForm({
98
- * privacyPolicy: 'https://invertase.io/privacy-policy',
99
- * withPersonalizedAds: true,
100
- * withNonPersonalizedAds: true,
101
- * withAdFree: true,
102
- * });
103
- *
104
- * console.log('User accepted personalized: ', result.status === AdsConsentStatus.PERSONALIZED);
105
- * console.log('User accepted non-personalized: ', result.status === AdsConsentStatus.NON_PERSONALIZED);
106
- * console.log('User prefers Ad Free version of app: ', result.userPrefersAdFree);
50
+ * const formResult = await AdsConsent.showForm();
51
+ *
52
+ * console.log('User consent obtained: ', formResult.status === AdsConsentStatus.OBTAINED);
107
53
  * }
108
54
  * }
109
55
  *
110
56
  * ```
111
- *
112
- * @param options An AdsConsentFormOptions interface to control the Google-rendered form.
113
- */
114
- showForm(options: AdsConsentFormOptions): Promise<AdsConsentFormResult>;
115
- /**
116
- * Returns a list of ad providers currently in use for the given Google Mobile Ads App ID.
117
- *
118
- * If requesting consent from the user via your own method, this list of ad providers must be shown to the user
119
- * for them to accept consent.
120
- *
121
- * #### Example
122
- *
123
- * ```js
124
- * import { AdsConsent } from 'react-native-google-mobile-ads';
125
- *
126
- * const providers = await AdsConsent.getAdProviders();
127
- * ```
128
57
  */
129
- getAdProviders(): Promise<AdProvider[]>;
58
+ showForm(): Promise<AdsConsentFormResult>;
130
59
  /**
131
- * Sets the debug geography to locally test consent.
132
- *
133
- * If debugging on an emulator (where location cannot be determined) or outside of the EEA,
134
- * it is possible set your own location to test how your app handles different scenarios.
60
+ * Returns the value stored under the `IABTCF_TCString` key
61
+ * in NSUserDefaults (iOS) / SharedPreferences (Android) as
62
+ * defined by the IAB Europe Transparency & Consent Framework.
135
63
  *
136
- * If using a real device, ensure you have set it as a test device via `addTestDevice()` otherwise this method will have
137
- * no effect.
64
+ * More information available here:
65
+ * https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework/blob/master/TCFv2/IAB%20Tech%20Lab%20-%20CMP%20API%20v2.md#in-app-details
138
66
  *
139
67
  * #### Example
140
68
  *
141
69
  * ```js
142
- * import { AdsConsent, AdsConsentDebugGeography } from 'react-native-google-mobile-ads';
143
- *
144
- * // Set disabled
145
- * await AdsConsentDebugGeography.setDebugGeography(AdsConsentDebugGeography.DISABLED);
70
+ * import { AdsConsent } from '@invertase/react-native-google-ads';
146
71
  *
147
- * // Set within EEA
148
- * await AdsConsentDebugGeography.setDebugGeography(AdsConsentDebugGeography.EEA);
149
- *
150
- * // Set outside EEA
151
- * await AdsConsentDebugGeography.setDebugGeography(AdsConsentDebugGeography.NOT_EEA);
72
+ * const tcString = await AdsConsent.getTCString();
152
73
  * ```
153
- *
154
- * @param geography The debug geography location.
155
74
  */
156
- setDebugGeography(geography: AdsConsentDebugGeography): Promise<void>;
75
+ getTCString(): Promise<string>;
157
76
  /**
158
- * Manually update the consent status of the user.
159
- *
160
- * This method is used when providing your own means of user consent. If using the Google-rendered form via `showForm()`,
161
- * the consent status is automatically set and calling this method is not required.
162
- *
163
- * This method can also be used to reset the consent status, by setting it to `AdsConsentStatus.UNKNOWN`, which may be useful in certain circumstances.
77
+ * Returns the TC Model of the saved IAB TCF 2.0 String.
164
78
  *
165
79
  * #### Example
166
80
  *
167
81
  * ```js
168
- * import { AdsConsent, AdsConsentStatus } from 'react-native-google-mobile-ads';
82
+ * import { AdsConsent } from '@invertase/react-native-google-ads';
169
83
  *
170
- * // User accepted personalized ads
171
- * await AdsConsent.setStatus(AdsConsentStatus.PERSONALIZED);
84
+ * const tcModel = await AdsConsent.getTCModel();
172
85
  * ```
173
- *
174
- * @param status The user consent status.
175
86
  */
176
- setStatus(status: AdsConsentStatus): Promise<void>;
87
+ getTCModel(): Promise<TCModel>;
177
88
  /**
178
- * Returns the current consent status of the user.
179
- *
180
- * > The user consent status may change at any time, therefore don't reuse old values locally and always request the current value at any time consent is required.
89
+ * Provides information about a user's consent choices.
181
90
  *
182
91
  * #### Example
183
92
  *
184
93
  * ```js
185
- * import { AdsConsent } from 'react-native-google-mobile-ads';
94
+ * import { AdsConsent } from '@invertase/react-native-google-ads';
186
95
  *
187
- * const status = await AdsConsent.getStatus();
96
+ * const { storeAndAccessInformationOnDevice } = await AdsConsent.getUserChoices();
188
97
  * ```
189
98
  */
190
- getStatus(): Promise<AdsConsentStatus>;
99
+ getUserChoices(): Promise<AdsConsentUserChoices>;
191
100
  /**
192
- * If a publisher is aware that the user is under the age of consent, all ad requests must set TFUA (Tag For Users
193
- * Under the Age of consent in Europe). This setting takes effect for all future ad requests.
194
- *
195
- * Once the TFUA setting is enabled, the Google-rendered consent form will fail to load. All ad requests that include
196
- * TFUA will be made ineligible for personalized advertising and remarketing. TFUA disables requests to third-party
197
- * ad technology providers, such as ad measurement pixels and third-party ad servers.
198
- *
199
- * To remove TFUA from ad requests, set the value to `false`.
101
+ * Resets the UMP SDK state.
200
102
  *
201
103
  * #### Example
202
104
  *
203
105
  * ```js
204
- * import { AdsConsent } from 'react-native-google-mobile-ads';
106
+ * import { AdsConsent } from '@invertase/react-native-google-ads';
205
107
  *
206
- * // User is under age of consent
207
- * await AdsConsent.setTagForUnderAgeOfConsent(true);
108
+ * AdsConsent.reset();
208
109
  * ```
209
- *
210
- * @param tag The boolean value to tag for under age consent.
211
110
  */
212
- setTagForUnderAgeOfConsent(tag: boolean): Promise<void>;
213
- /**
214
- * If using a real device to test, ensure the device ID is provided to the Google Mobile Ads SDK so any mock debug locations
215
- * can take effect.
216
- *
217
- * Emulators are automatically on the allowlist and should require no action.
218
- *
219
- * If you are seeing real ad activity from a test device, examine logcat / console
220
- * during execution in association with google mobile ads test device documentation to
221
- * configure your device correctly.
222
- *
223
- * @param deviceIds An array of testing device ID.
224
- */
225
- addTestDevices(deviceIds: string[]): Promise<void>;
111
+ reset(): void;
226
112
  }
227
113
  /**
228
- * The options used to show on the Google-rendered consent form. At least one of `withAdFree`, `withPersonalizedAds` and `WithNonPersonalizedAds` needs to be set to `true`.
114
+ * The options used when requesting consent information.
229
115
  */
230
- export interface AdsConsentFormOptions {
116
+ export interface AdsConsentInfoOptions {
231
117
  /**
232
- * A fully formed HTTP or HTTPS privacy policy URL for your application.
233
- *
234
- * Users will have the option to visit this web page before consenting to ads.
118
+ * Sets the debug geography to locally test consent.
235
119
  */
236
- privacyPolicy: string;
120
+ debugGeography?: AdsConsentDebugGeography;
237
121
  /**
238
122
  * Set to `true` to provide the option for the user to accept being shown personalized ads, defaults to `false`.
239
123
  */
240
- withPersonalizedAds?: boolean;
241
- /**
242
- * Set to `true` to provide the option for the user to accept being shown non-personalized ads, defaults to `false`.
243
- */
244
- withNonPersonalizedAds?: boolean;
124
+ tagForUnderAgeOfConsent?: boolean;
245
125
  /**
246
- * Set to `true` to provide the option for the user to choose an ad-free version of your app, defaults to `false`.
247
- *
248
- * If the user chooses this option, you must handle it as required (e.g. navigating to a paid version of the app,
249
- * or a subscribe view).
126
+ * An array of test device IDs to allow.
250
127
  */
251
- withAdFree?: boolean;
128
+ testDeviceIdentifiers?: string[];
252
129
  }
253
130
  /**
254
131
  * The result of a Google-rendered consent form.
@@ -257,15 +134,12 @@ export interface AdsConsentFormResult {
257
134
  /**
258
135
  * The consent status of the user after closing the consent form.
259
136
  *
260
- * - UNKNOWN: The form was unable to determine the users consent status.
261
- * - NON_PERSONALIZED: The user has accepted non-personalized ads.
262
- * - PERSONALIZED: The user has accepted personalized ads.
137
+ * - `UNKNOWN`: Unknown consent status.
138
+ * - `REQUIRED`: User consent required but not yet obtained.
139
+ * - `NOT_REQUIRED`: User consent not required.
140
+ * - `OBTAINED`: User consent already obtained.
263
141
  */
264
142
  status: AdsConsentStatus;
265
- /**
266
- * If `true`, the user requested an ad-free version of your application.
267
- */
268
- userPrefersAdFree: boolean;
269
143
  }
270
144
  /**
271
145
  * The result of requesting info about a users consent status.
@@ -274,13 +148,188 @@ export interface AdsConsentInfo {
274
148
  /**
275
149
  * The consent status of the user.
276
150
  *
277
- * - UNKNOWN: The consent status is unknown and the user must provide consent to show ads if they are within the EEA or location is also unknown.
278
- * - NON_PERSONALIZED: The user has accepted non-personalized ads.
279
- * - PERSONALIZED: The user has accepted personalized ads.
151
+ * - `UNKNOWN`: Unknown consent status.
152
+ * - `REQUIRED`: User consent required but not yet obtained.
153
+ * - `NOT_REQUIRED`: User consent not required.
154
+ * - `OBTAINED`: User consent already obtained.
280
155
  */
281
156
  status: AdsConsentStatus;
282
157
  /**
283
- * If `true` the user is within the EEA or their location could not be determined.
158
+ * If `true` a consent form is available.
159
+ */
160
+ isConsentFormAvailable: boolean;
161
+ }
162
+ /**
163
+ * The options used when requesting consent information.
164
+ *
165
+ * https://vendor-list.consensu.org/v2/vendor-list.json
166
+ * https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework
167
+ */
168
+ export interface AdsConsentUserChoices {
169
+ /**
170
+ * Your device can be identified based on a scan of your device's
171
+ * unique combination of characteristics.
172
+ *
173
+ * Vendors can:
174
+ * - Create an identifier using data collected via actively scanning a device for
175
+ * - specific characteristics, e.g. installed fonts or screen resolution.
176
+ * - Use such an identifier to re-identify a device.
177
+ */
178
+ activelyScanDeviceCharacteristicsForIdentification: boolean;
179
+ /**
180
+ * Market research can be used to learn more about the audiences who visit sites/apps and view ads.
181
+ *
182
+ * To apply market research to generate audience insights vendors can:
183
+ * - Provide aggregate reporting to advertisers or their representatives about
184
+ * the audiences reached by their ads, through panel-based and similarly derived insights.
185
+ * - Provide aggregate reporting to publishers about the audiences that were served or
186
+ * interacted with content and/or ads on their property by applying
187
+ * panel-based and similarly derived insights.
188
+ * - Associate offline data with an online user for the purposes of
189
+ * market research to generate audience insights if vendors have declared to match and
190
+ * combine offline data sources (Feature 1)
191
+ * - Combine this information with other information previously collected including from
192
+ * across websites and apps.
193
+ *
194
+ * Vendors cannot:
195
+ * - Measure the performance and effectiveness of ads that a specific user was served or
196
+ * interacted with, without a Legal Basis to measure ad performance.
197
+ * - Measure which content a specific user was served and how they interacted with it,
198
+ * without a Legal Basis to measure content performance.
199
+ */
200
+ applyMarketResearchToGenerateAudienceInsights: boolean;
201
+ /**
202
+ * A profile can be built about you and your interests to show you personalised ads
203
+ * that are relevant to you.
204
+ *
205
+ * To create a personalised ads profile vendors can:
206
+ * - Collect information about a user, including a user's activity, interests,
207
+ * demographic information, or location, to create or edit a user profile for use
208
+ * in personalised advertising.
209
+ * - Combine this information with other information previously collected,
210
+ * including from across websites and apps, to create or edit a user profile
211
+ * for use in personalised advertising.
212
+ */
213
+ createAPersonalisedAdsProfile: boolean;
214
+ /**
215
+ * A profile can be built about you and your interests to show you personalised content
216
+ * that is relevant to you.
217
+ *
218
+ * To create a personalised content profile vendors can:
219
+ * - Collect information about a user, including a user's activity, interests, visits to
220
+ * sites or apps, demographic information, or location, to create or edit a user profile
221
+ * for personalising content.
222
+ * - Combine this information with other information previously collected,
223
+ * including from across websites and apps, to create or edit a user profile for use
224
+ * in personalising content.
225
+ */
226
+ createAPersonalisedContentProfile: boolean;
227
+ /**
228
+ * Your data can be used to improve existing systems and software,
229
+ * and to develop new products
230
+ *
231
+ * To develop new products and improve products vendors can:
232
+ * - Use information to improve their existing products with new features and
233
+ * to develop new products
234
+ * - Create new models and algorithms through machine learning
235
+ *
236
+ * Vendors cannot:
237
+ * - Conduct any other data processing operation allowed under
238
+ * a different purpose under this purpose
239
+ */
240
+ developAndImproveProducts: boolean;
241
+ /**
242
+ * The performance and effectiveness of ads that you see or interact with can be measured.
243
+ *
244
+ * To measure ad performance vendors can:
245
+ * - Measure whether and how ads were delivered to and interacted with by a user
246
+ * - Provide reporting about ads including their effectiveness and performance
247
+ * - Provide reporting about users who interacted with ads using data observed during
248
+ * the course of the user's interaction with that ad
249
+ * - Provide reporting to publishers about the ads displayed on their property
250
+ * - Measure whether an ad is serving in a suitable editorial environment (brand-safe) context
251
+ * - Determine the percentage of the ad that had the opportunity to be seen and
252
+ * the duration of that opportunity
253
+ * - Combine this information with other information previously collected,
254
+ * including from across websites and apps
255
+ *
256
+ * Vendors cannot:
257
+ * - Apply panel- or similarly-derived audience insights data to ad measurement data
258
+ * without a Legal Basis to apply market research to generate audience insights (Purpose 9)
259
+ */
260
+ measureAdPerformance: boolean;
261
+ /**
262
+ * The performance and effectiveness of content that you see or interact with can be measured.
263
+ *
264
+ * To measure content performance vendors can:
265
+ * - Measure and report on how content was delivered to and interacted with by users.
266
+ * - Provide reporting, using directly measurable or known information, about users who
267
+ * interacted with the content
268
+ * - Combine this information with other information previously collected,
269
+ * including from across websites and apps.
270
+ *
271
+ * Vendors cannot:
272
+ * - Measure whether and how ads (including native ads) were delivered to and
273
+ * interacted with by a user.
274
+ * - Apply panel- or similarly derived audience insights data to ad measurement
275
+ * data without a Legal Basis to apply market research to generate audience insights (Purpose 9)
276
+ */
277
+ measureContentPerformance: boolean;
278
+ /**
279
+ * Ads can be shown to you based on the content you’re viewing,
280
+ * the app you’re using, your approximate location, or your device type.
281
+ *
282
+ * To do basic ad selection vendors can:
283
+ * - Use real-time information about the context in which the ad will be shown,
284
+ * to show the ad, including information about the content and the device, such as:
285
+ * device type and capabilities, user agent, URL, IP address
286
+ * - Use a user’s non-precise geolocation data
287
+ * - Control the frequency of ads shown to a user.
288
+ * - Sequence the order in which ads are shown to a user.
289
+ * - Prevent an ad from serving in an unsuitable editorial (brand-unsafe) context
290
+ *
291
+ * Vendors cannot:
292
+ * - Create a personalised ads profile using this information for the selection of
293
+ * future ads without a separate legal basis to create a personalised ads profile.
294
+ * - N.B. Non-precise means only an approximate location involving at least a radius
295
+ * of 500 meters is permitted.
296
+ */
297
+ selectBasicAds: boolean;
298
+ /**
299
+ * Personalised ads can be shown to you based on a profile about you.
300
+ *
301
+ * To select personalised ads vendors can:
302
+ * - Select personalised ads based on a user profile or other historical user data,
303
+ * including a user’s prior activity, interests, visits to sites or apps, location,
304
+ * or demographic information.
305
+ */
306
+ selectPersonalisedAds: boolean;
307
+ /**
308
+ * Personalised content can be shown to you based on a profile about you.
309
+ *
310
+ * To select personalised content vendors can:
311
+ * - Select personalised content based on a user profile or other historical user data,
312
+ * including a user’s prior activity, interests, visits to sites or apps, location,
313
+ * or demographic information.
314
+ */
315
+ selectPersonalisedContent: boolean;
316
+ /**
317
+ * Cookies, device identifiers, or other information can be stored or
318
+ * accessed on your device for the purposes presented to you.
319
+ *
320
+ * Vendors can:
321
+ * - Store and access information on the device such as cookies and
322
+ * device identifiers presented to a user.
323
+ */
324
+ storeAndAccessInformationOnDevice: boolean;
325
+ /**
326
+ * Your precise geolocation data can be used in support of one or more purposes.
327
+ * This means your location can be accurate to within several meters.
328
+ *
329
+ * Vendors can:
330
+ * - Collect and process precise geolocation data in support of one or more purposes.
331
+ * - Precise geolocation means that there are no restrictions on the precision of
332
+ * a user's location; this can be accurate to within several meters.
284
333
  */
285
- isRequestLocationInEeaOrUnknown: boolean;
334
+ usePreciseGeolocationData: boolean;
286
335
  }
@@ -1 +1 @@
1
- export declare const version = "4.2.0";
1
+ export declare const version = "5.1.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-google-mobile-ads",
3
- "version": "4.2.0",
3
+ "version": "5.1.0",
4
4
  "author": "Invertase <oss@invertase.io> (http://invertase.io)",
5
5
  "description": "React Native Google Mobile Ads is an easy way to monetize mobile apps with targeted, in-app advertising.",
6
6
  "main": "lib/commonjs/index.js",
@@ -41,14 +41,16 @@
41
41
  ],
42
42
  "sdkVersions": {
43
43
  "ios": {
44
- "googleAds": "8.13.0"
44
+ "googleMobileAds": "8.13.0",
45
+ "googleUmp": "2.0.0"
45
46
  },
46
47
  "android": {
47
48
  "minSdk": 16,
48
49
  "targetSdk": 30,
49
50
  "compileSdk": 31,
50
51
  "buildTools": "31.0.0",
51
- "googleAds": "19.8.0"
52
+ "googleMobileAds": "20.5.0",
53
+ "googleUmp": "2.0.0"
52
54
  }
53
55
  },
54
56
  "react-native-builder-bob": {
@@ -70,7 +72,7 @@
70
72
  "lint:ios:check": "clang-format --glob=\"ios/**/*.{h,cpp,m,mm}\" --style=Google -n -Werror",
71
73
  "lint:ios:fix": "clang-format -i --glob=\"ios/**/*.{h,cpp,m,mm}\" --style=Google",
72
74
  "lint:markdown:check": "prettier --check \"docs/**/*.md[x]\"",
73
- "lint:markdown:fix": "prettier --write \"docs/**/*.md\"",
75
+ "lint:markdown:fix": "prettier --write \"docs/**/*.md[x]\"",
74
76
  "lint:report": "eslint --output-file=eslint-report.json --format=json . --ext .js,.jsx,.ts,.tsx",
75
77
  "lint:spellcheck": "spellchecker --quiet --files=\"docs/**/*.md\" --dictionaries=\"./.spellcheck.dict.txt\" --reports=\"spelling.json\" --plugins spell indefinite-article repeated-words syntax-mentions syntax-urls frontmatter",
76
78
  "tsc:compile": "tsc --project . --noEmit",
@@ -96,6 +98,10 @@
96
98
  "tests:ios:test-cover-reuse": "cd example && node_modules/.bin/nyc yarn detox test --configuration ios.sim.debug --reuse --loglevel warn",
97
99
  "tests:ios:pod:install": "cd example && cd ios && rm -rf example.xcworkspace && rm -f Podfile.lock && pod install --repo-update && cd .."
98
100
  },
101
+ "dependencies": {
102
+ "@iabtcf/core": "^1.4.0",
103
+ "use-deep-compare-effect": "^1.8.1"
104
+ },
99
105
  "devDependencies": {
100
106
  "@babel/core": "^7.16.0",
101
107
  "@babel/preset-env": "^7.16.4",