react-native-applovin-max 6.0.2 → 6.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.
@@ -27,20 +27,20 @@ const nativeMethods: NativeTargetingDataType = AppLovinMAX;
27
27
  * This enumeration represents content ratings for the ads shown to users.
28
28
  */
29
29
  export enum AdContentRating {
30
- None = 0,
31
- AllAudiences = 1,
32
- EveryoneOverTwelve = 2,
33
- MatureAudiences = 3,
30
+ NONE = 0,
31
+ ALL_AUDIENCES = 1,
32
+ EVERYONE_OVER_TWELVE = 2,
33
+ MATURE_AUDIENCES = 3,
34
34
  }
35
35
 
36
36
  /**
37
37
  * This enumeration represents gender.
38
38
  */
39
39
  export enum UserGender {
40
- Unknown = 'U',
41
- Female = 'F',
42
- Male = 'M',
43
- Other = 'O',
40
+ UNKNOWN = 'U',
41
+ FEMALE = 'F',
42
+ MALE = 'M',
43
+ OTHER = 'O',
44
44
  }
45
45
 
46
46
  /**
@@ -72,10 +72,10 @@ export const TargetingData: TargetingDataType = {
72
72
  */
73
73
  set gender(value: UserGender | Promise<UserGender>) {
74
74
  if (
75
- value === UserGender.Unknown ||
76
- value === UserGender.Female ||
77
- value === UserGender.Male ||
78
- value === UserGender.Other
75
+ value === UserGender.UNKNOWN ||
76
+ value === UserGender.FEMALE ||
77
+ value === UserGender.MALE ||
78
+ value === UserGender.OTHER
79
79
  ) {
80
80
  nativeMethods.setTargetingDataGender(value);
81
81
  } else {
@@ -99,10 +99,10 @@ export const TargetingData: TargetingDataType = {
99
99
  */
100
100
  set maximumAdContentRating(value: AdContentRating | Promise<AdContentRating>) {
101
101
  if (
102
- value === AdContentRating.None ||
103
- value === AdContentRating.AllAudiences ||
104
- value === AdContentRating.EveryoneOverTwelve ||
105
- value === AdContentRating.MatureAudiences
102
+ value === AdContentRating.NONE ||
103
+ value === AdContentRating.ALL_AUDIENCES ||
104
+ value === AdContentRating.EVERYONE_OVER_TWELVE ||
105
+ value === AdContentRating.MATURE_AUDIENCES
106
106
  ) {
107
107
  nativeMethods.setTargetingDataMaximumAdContentRating(value);
108
108
  } else {
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { default, AppLovinMAX } from './AppLovinMAX';
2
- export { Privacy } from './Privacy';
2
+ export { Privacy, ConsentFlowUserGeography, AppTrackingStatus } from './Privacy';
3
3
  export { TargetingData, AdContentRating, UserGender } from './TargetingData';
4
4
  export { InterstitialAd } from './InterstitialAd';
5
5
  export { RewardedAd } from './RewardedAd';
@@ -1,4 +1,5 @@
1
- import React, { forwardRef, useContext, useImperativeHandle, useRef, useState, useEffect, useCallback } from 'react';
1
+ import * as React from 'react';
2
+ import { forwardRef, useContext, useImperativeHandle, useRef, useState, useEffect, useCallback } from 'react';
2
3
  import { NativeModules, requireNativeComponent, UIManager, findNodeHandle } from 'react-native';
3
4
  import type { ViewProps } from 'react-native';
4
5
  import { NativeAdViewContext, NativeAdViewProvider } from './NativeAdViewProvider';
@@ -1,4 +1,5 @@
1
- import React, { useContext, useRef, useEffect } from 'react';
1
+ import * as React from 'react';
2
+ import { useContext, useRef, useEffect } from 'react';
2
3
  import type { ReactNode } from 'react';
3
4
  import { findNodeHandle, Text, Image, View, TouchableOpacity, StyleSheet } from 'react-native';
4
5
  import type { ViewProps, ImageProps, TextStyle, StyleProp, TextProps } from 'react-native';
@@ -1,4 +1,5 @@
1
- import React, { useState, createContext } from 'react';
1
+ import * as React from 'react';
2
+ import { useState, createContext } from 'react';
2
3
  import type { NativeMethods } from 'react-native';
3
4
  import type { NativeAd } from '../types/NativeAd';
4
5
  import type { NativeAdViewProps } from '../types/NativeAdViewProps';
@@ -17,6 +17,13 @@ export type AppLovinMAXType = {
17
17
  */
18
18
  initialize(sdkKey: string): Promise<Configuration>;
19
19
 
20
+ /**
21
+ * Sets a list of the ad units for the SDK to initialize only those networks.
22
+ *
23
+ * @param adUnitIds Ad units to be initialized with the SDK.
24
+ */
25
+ setInitializationAdUnitIds(adUnitIds: string[]): void;
26
+
20
27
  /**
21
28
  * Presents the mediation debugger UI.
22
29
  */
@@ -1,3 +1,5 @@
1
+ import type { ConsentFlowUserGeography, AppTrackingStatus } from '../Privacy';
2
+
1
3
  /**
2
4
  * Encapsulates data for the AppLovinMAX SDK configuration.
3
5
  */
@@ -6,4 +8,29 @@ export type Configuration = {
6
8
  * The country code of this user.
7
9
  */
8
10
  countryCode: string;
11
+
12
+ /**
13
+ * The user's geography used to determine the type of consent flow shown to the user. If no
14
+ * such determination could be made, {@link ConsentFlowUserGeography.UNKNOWN} will be returned.
15
+ */
16
+ consentFlowUserGeography: ConsentFlowUserGeography;
17
+
18
+ /**
19
+ * Indicates whether or not the user authorizes access to app-related data that can be used for
20
+ * tracking the user or the device.
21
+ *
22
+ * Note: available only on iOS
23
+ */
24
+ appTrackingStatus?: AppTrackingStatus;
25
+
26
+ /**
27
+ * Whether or not test mode is enabled for this session.
28
+ *
29
+ * @return {boolean} true in one of the following cases:
30
+ * 1. {@link AppLovinMAX.setTestDeviceAdvertisingIds()} was called with current device's GAID prior to SDK initialization.
31
+ * 2. Current device was registered as a test device through MAX dashboard -> MAX Test Devices prior to SDK initialization.
32
+ * 3. Test mode was manually enabled for this session through the Mediation Debugger during the last session.
33
+ * 4. Current device is an emulator.
34
+ */
35
+ isTestModeEnabled: boolean;
9
36
  };
@@ -1,3 +1,5 @@
1
+ import type { ConsentFlowUserGeography } from '../Privacy';
2
+
1
3
  export type PrivacyType = {
2
4
  /**********************************************************************************/
3
5
  /* Privacy */
@@ -44,11 +46,20 @@ export type PrivacyType = {
44
46
  /**********************************************************************************/
45
47
 
46
48
  /**
49
+ * @deprecated Use {@link setTermsAndPrivacyPolicyFlowEnabled()} instead.
50
+ *
47
51
  * Enables the MAX Terms Flow.
48
52
  *
49
53
  * @param enabled true to enable the MAX Terms Flow.
50
54
  */
51
- setConsentFlowEnabled(enabled: boolean): Promise<void>;
55
+ setConsentFlowEnabled(enabled: boolean): void;
56
+
57
+ /**
58
+ * Enables the MAX Terms and Privacy Policy Flow.
59
+ *
60
+ * @param enabled true to enable the MAX Terms and Privacy Policy Flow.
61
+ */
62
+ setTermsAndPrivacyPolicyFlowEnabled(enabled: boolean): void;
52
63
 
53
64
  /**
54
65
  * The URL of your company’s privacy policy, as a string. This is required in order to enable
@@ -56,7 +67,7 @@ export type PrivacyType = {
56
67
  *
57
68
  * @param urlString The URL string to point your company’s privacy policy.
58
69
  */
59
- setPrivacyPolicyUrl(urlString: string): Promise<void>;
70
+ setPrivacyPolicyUrl(urlString: string): void;
60
71
 
61
72
  /**
62
73
  * The URL of your company’s terms of service, as a string. This is optional; you can enable
@@ -64,5 +75,12 @@ export type PrivacyType = {
64
75
  *
65
76
  * @param urlString The URL string to point your company’s terms of service.
66
77
  */
67
- setTermsOfServiceUrl(urlString: string): Promise<void>;
78
+ setTermsOfServiceUrl(urlString: string): void;
79
+
80
+ /**
81
+ * Set debug user geography. You may use this to test CMP flow by setting this to {@link ConsentFlowUserGeography.GDPR}.
82
+ *
83
+ * @note The debug geography is used only when the app is in debug mode.
84
+ */
85
+ setConsentFlowDebugUserGeography(userGeography: ConsentFlowUserGeography): void;
68
86
  };