react-native-applovin-max 7.0.1 → 7.1.1

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 (49) hide show
  1. package/android/build.gradle +3 -3
  2. package/android/src/main/java/com/applovin/reactnative/AppLovinMAXAdEvents.java +67 -0
  3. package/android/src/main/java/com/applovin/reactnative/AppLovinMAXAdView.java +10 -6
  4. package/android/src/main/java/com/applovin/reactnative/AppLovinMAXAdViewManager.java +7 -7
  5. package/android/src/main/java/com/applovin/reactnative/AppLovinMAXAdViewUiComponent.java +9 -13
  6. package/android/src/main/java/com/applovin/reactnative/AppLovinMAXModule.java +142 -626
  7. package/android/src/main/java/com/applovin/reactnative/AppLovinMAXNativeAdView.java +6 -6
  8. package/android/src/main/java/com/applovin/reactnative/AppLovinMAXNativeAdViewManager.java +4 -4
  9. package/ios/AppLovinMAX.m +83 -478
  10. package/ios/AppLovinMAXAdView.h +12 -3
  11. package/ios/AppLovinMAXAdView.m +17 -13
  12. package/ios/AppLovinMAXAdViewManager.m +1 -1
  13. package/ios/AppLovinMAXAdViewUIComponent.h +7 -6
  14. package/ios/AppLovinMAXAdViewUIComponent.m +10 -15
  15. package/ios/AppLovinMAXNativeAdView.m +2 -2
  16. package/lib/commonjs/AppLovinMAX.js +19 -3
  17. package/lib/commonjs/AppLovinMAX.js.map +1 -1
  18. package/lib/commonjs/index.js +0 -22
  19. package/lib/commonjs/index.js.map +1 -1
  20. package/lib/module/AppLovinMAX.js +19 -3
  21. package/lib/module/AppLovinMAX.js.map +1 -1
  22. package/lib/module/index.js +0 -1
  23. package/lib/module/index.js.map +1 -1
  24. package/lib/typescript/src/AppLovinMAX.d.ts.map +1 -1
  25. package/lib/typescript/src/index.d.ts +0 -1
  26. package/lib/typescript/src/index.d.ts.map +1 -1
  27. package/lib/typescript/src/types/AdProps.d.ts +6 -6
  28. package/lib/typescript/src/types/AppLovinMAX.d.ts +18 -6
  29. package/lib/typescript/src/types/AppLovinMAX.d.ts.map +1 -1
  30. package/package.json +1 -1
  31. package/react-native-applovin-max.podspec +2 -2
  32. package/src/AppLovinMAX.ts +24 -3
  33. package/src/index.ts +0 -1
  34. package/src/types/AdProps.ts +6 -6
  35. package/src/types/AppLovinMAX.ts +20 -7
  36. package/lib/commonjs/TargetingData.js +0 -179
  37. package/lib/commonjs/TargetingData.js.map +0 -1
  38. package/lib/commonjs/types/TargetingData.js +0 -6
  39. package/lib/commonjs/types/TargetingData.js.map +0 -1
  40. package/lib/module/TargetingData.js +0 -175
  41. package/lib/module/TargetingData.js.map +0 -1
  42. package/lib/module/types/TargetingData.js +0 -2
  43. package/lib/module/types/TargetingData.js.map +0 -1
  44. package/lib/typescript/src/TargetingData.d.ts +0 -26
  45. package/lib/typescript/src/TargetingData.d.ts.map +0 -1
  46. package/lib/typescript/src/types/TargetingData.d.ts +0 -43
  47. package/lib/typescript/src/types/TargetingData.d.ts.map +0 -1
  48. package/src/TargetingData.ts +0 -212
  49. package/src/types/TargetingData.ts +0 -50
@@ -1,212 +0,0 @@
1
- import { NativeModules } from 'react-native';
2
- import type { TargetingDataType } from './types/TargetingData';
3
-
4
- const { AppLovinMAX } = NativeModules;
5
-
6
- type NativeTargetingDataType = {
7
- setTargetingDataYearOfBirth(value: number): void;
8
- getTargetingDataYearOfBirth(): Promise<number>;
9
- setTargetingDataGender(value: string): void;
10
- getTargetingDataGender(): Promise<string>;
11
- setTargetingDataMaximumAdContentRating(value: number): void;
12
- getTargetingDataMaximumAdContentRating(): Promise<number>;
13
- setTargetingDataEmail(value: string | null): void;
14
- getTargetingDataEmail(): Promise<string | null>;
15
- setTargetingDataPhoneNumber(value: string | null): void;
16
- getTargetingDataPhoneNumber(): Promise<string | null>;
17
- setTargetingDataKeywords(value: string[] | null): void;
18
- getTargetingDataKeywords(): Promise<string[] | null>;
19
- setTargetingDataInterests(value: string[] | null): void;
20
- getTargetingDataInterests(): Promise<string[] | null>;
21
- clearAllTargetingData(): void;
22
- };
23
-
24
- const nativeMethods: NativeTargetingDataType = AppLovinMAX;
25
-
26
- /**
27
- * This enumeration represents content ratings for the ads shown to users.
28
- */
29
- export enum AdContentRating {
30
- NONE = 0,
31
- ALL_AUDIENCES = 1,
32
- EVERYONE_OVER_TWELVE = 2,
33
- MATURE_AUDIENCES = 3,
34
- }
35
-
36
- /**
37
- * This enumeration represents gender.
38
- */
39
- export enum UserGender {
40
- UNKNOWN = 'U',
41
- FEMALE = 'F',
42
- MALE = 'M',
43
- OTHER = 'O',
44
- }
45
-
46
- /**
47
- * Defines additional data for the publisher to send to AppLovin.
48
- *
49
- * @see {@link https://support.applovin.com/hc/en-us/articles/13964925614733-Data-and-Keyword-Passing}
50
- */
51
- export const TargetingData: TargetingDataType = {
52
- /**
53
- * Sets the year of birth of the user. Set this to 0 to clear this value.
54
- */
55
- set yearOfBirth(value: number | Promise<number>) {
56
- if (typeof value === 'number') {
57
- nativeMethods.setTargetingDataYearOfBirth(value);
58
- } else {
59
- printError('TargetingData.yearOfBirth', 'number', typeof value);
60
- }
61
- },
62
-
63
- /**
64
- * Gets the year of birth of the user.
65
- */
66
- get yearOfBirth(): number | Promise<number> {
67
- return nativeMethods.getTargetingDataYearOfBirth();
68
- },
69
-
70
- /**
71
- * Sets the gender of the user. Set this to {@link UserGender.Unknown} to clear this value.
72
- */
73
- set gender(value: UserGender | Promise<UserGender>) {
74
- if (value === UserGender.UNKNOWN || value === UserGender.FEMALE || value === UserGender.MALE || value === UserGender.OTHER) {
75
- nativeMethods.setTargetingDataGender(value);
76
- } else {
77
- printError('TargetingData.gender', 'UserGender', typeof value);
78
- }
79
- },
80
-
81
- /**
82
- * Gets the gender of the user.
83
- */
84
- get gender(): UserGender | Promise<UserGender> {
85
- return nativeMethods.getTargetingDataGender().then((value: string) => {
86
- return value as UserGender;
87
- });
88
- },
89
-
90
- /**
91
- * Sets the maximum ad content rating shown to the user. The levels are based on IQG Media
92
- * Ratings: 1=All Audiences, 2=Everyone Over 12, 3=Mature Audiences.
93
- * Set this to {@link AdContentRating.None} to clear this value.
94
- */
95
- set maximumAdContentRating(value: AdContentRating | Promise<AdContentRating>) {
96
- if (
97
- value === AdContentRating.NONE ||
98
- value === AdContentRating.ALL_AUDIENCES ||
99
- value === AdContentRating.EVERYONE_OVER_TWELVE ||
100
- value === AdContentRating.MATURE_AUDIENCES
101
- ) {
102
- nativeMethods.setTargetingDataMaximumAdContentRating(value);
103
- } else {
104
- printError('TargetingData.maximumAdContentRating', 'AdContentRating', typeof value);
105
- }
106
- },
107
-
108
- /**
109
- * Gets the maximum ad content rating shown to the user. The levels are based on IQG Media
110
- * Ratings: 1=All Audiences, 2=Everyone Over 12, 3=Mature Audiences.
111
- */
112
- get maximumAdContentRating(): AdContentRating | Promise<AdContentRating> {
113
- return nativeMethods.getTargetingDataMaximumAdContentRating().then((value: number) => {
114
- return value as AdContentRating;
115
- });
116
- },
117
-
118
- /**
119
- * Sets the email of the user. Set this to null to clear this value.
120
- */
121
- set email(value: string | null | Promise<string | null>) {
122
- if (value === null) {
123
- nativeMethods.setTargetingDataEmail(null);
124
- } else if (typeof value === 'string') {
125
- nativeMethods.setTargetingDataEmail(value as string);
126
- } else {
127
- printError('TargetingData.email', 'string or null', typeof value);
128
- }
129
- },
130
-
131
- /**
132
- * Gets the email of the user.
133
- */
134
- get email(): string | null | Promise<string | null> {
135
- return nativeMethods.getTargetingDataEmail();
136
- },
137
-
138
- /**
139
- * Sets the phone number of the user. Set this to null to clear this value.
140
- */
141
- set phoneNumber(value: string | null | Promise<string | null>) {
142
- if (value === null) {
143
- nativeMethods.setTargetingDataPhoneNumber(null);
144
- } else if (typeof value === 'string') {
145
- nativeMethods.setTargetingDataPhoneNumber(value as string);
146
- } else {
147
- printError('TargetingData.phoneNumber', 'string or null', typeof value);
148
- }
149
- },
150
-
151
- /**
152
- * Gets the phone number of the user.
153
- */
154
- get phoneNumber(): string | null | Promise<string | null> {
155
- return nativeMethods.getTargetingDataPhoneNumber();
156
- },
157
-
158
- /**
159
- * Sets the keywords describing the application. Set this to null to clear this value.
160
- */
161
- set keywords(value: string[] | null | Promise<string[] | null>) {
162
- if (value === null) {
163
- nativeMethods.setTargetingDataKeywords(null);
164
- } else if (isStringArray(value)) {
165
- nativeMethods.setTargetingDataKeywords(value as string[]);
166
- } else {
167
- printError('TargetingData.keywords', 'string[] or null', typeof value);
168
- }
169
- },
170
-
171
- /**
172
- * Gets the keywords describing the application.
173
- */
174
- get keywords(): string[] | null | Promise<string[] | null> {
175
- return nativeMethods.getTargetingDataKeywords();
176
- },
177
-
178
- /**
179
- * Sets the interests of the user. Set this to null to clear this value.
180
- */
181
- set interests(value: string[] | null | Promise<string[] | null>) {
182
- if (value === null) {
183
- nativeMethods.setTargetingDataInterests(null);
184
- } else if (isStringArray(value)) {
185
- nativeMethods.setTargetingDataInterests(value as string[]);
186
- } else {
187
- printError('TargetingData.interests', 'string[] or null', typeof value);
188
- }
189
- },
190
-
191
- /**
192
- * Gets the interests of the user.
193
- */
194
- get interests(): string[] | null | Promise<string[] | null> {
195
- return nativeMethods.getTargetingDataInterests();
196
- },
197
-
198
- /**
199
- * Clears all saved data from this class.
200
- */
201
- clearAll(): void {
202
- nativeMethods.clearAllTargetingData();
203
- },
204
- };
205
-
206
- const isStringArray = (strs: object): boolean => {
207
- return Array.isArray(strs) && strs.every((value) => typeof value === 'string');
208
- };
209
-
210
- const printError = (fieldName: string, correctType: string, wrongType: string) => {
211
- console.error('Cannot set value to ' + fieldName + ' with unsupported type: ' + wrongType + '. Value has to be of type ' + correctType + '.');
212
- };
@@ -1,50 +0,0 @@
1
- import type { AdContentRating, UserGender } from '../TargetingData';
2
-
3
- /**
4
- * Defines additional data for the publisher to send to AppLovin.
5
- *
6
- * @see {@link https://support.applovin.com/hc/en-us/articles/13964925614733-Data-and-Keyword-Passing}
7
- */
8
- export type TargetingDataType = {
9
- /**
10
- * Sets the year of birth of the user. Set this to 0 to clear this value.
11
- */
12
- yearOfBirth: number | Promise<number>;
13
-
14
- /**
15
- * Sets the gender of the user. Set this to {@link UserGender.Unknown} to clear this value.
16
- */
17
- gender: UserGender | Promise<UserGender>;
18
-
19
- /**
20
- * Sets the maximum ad content rating shown to the user. The levels are based on IQG Media
21
- * Ratings: 1=All Audiences, 2=Everyone Over 12, 3=Mature Audiences.
22
- * Set this to {@link AdContentRating.None} to clear this value.
23
- */
24
- maximumAdContentRating: AdContentRating | Promise<AdContentRating>;
25
-
26
- /**
27
- * Sets the email of the user. Set this to null to clear this value.
28
- */
29
- email: string | null | Promise<string | null>;
30
-
31
- /**
32
- * Sets the phone number of the user. Set this to null to clear this value.
33
- */
34
- phoneNumber: string | null | Promise<string | null>;
35
-
36
- /**
37
- * Sets the keywords describing the application. Set this to null to clear this value.
38
- */
39
- keywords: string[] | null | Promise<string[] | null>;
40
-
41
- /**
42
- * Sets the interests of the user. Set this to null to clear this value.
43
- */
44
- interests: string[] | null | Promise<string[] | null>;
45
-
46
- /**
47
- * Clears all saved data from this class.
48
- */
49
- clearAll(): void;
50
- };