react-native-applovin-max 5.7.2 → 6.0.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 (52) hide show
  1. package/README.md +1 -1
  2. package/android/build.gradle +2 -2
  3. package/android/src/main/java/com/applovin/mediation/adapters/GoogleAdManagerMediationAdapter.java.saved +1616 -0
  4. package/android/src/main/java/com/applovin/mediation/adapters/{GoogleMediationAdapter.java.saved → GoogleMediationAdapter.java.old} +126 -49
  5. package/android/src/main/java/com/applovin/mediation/adapters/MintegralMediationAdapter.java.old +1481 -0
  6. package/ios/AppLovinMAX.m +1 -9
  7. package/ios/AppLovinMAX.xcodeproj/project.pbxproj +4 -4
  8. package/ios/AppLovinMAX.xcworkspace/xcuserdata/hiroshi.watanabe.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  9. package/ios/AppLovinMAXNativeAdView.m +8 -1
  10. package/ios/Podfile +2 -2
  11. package/ios/Podfile.lock +5 -5
  12. package/package.json +2 -1
  13. package/react-native-applovin-max.podspec +2 -2
  14. package/src/AdView.tsx +251 -0
  15. package/src/AppLovinMAX.ts +24 -0
  16. package/src/AppOpenAd.ts +128 -0
  17. package/src/BannerAd.ts +175 -0
  18. package/src/EventEmitter.ts +27 -0
  19. package/src/InterstitialAd.ts +128 -0
  20. package/src/MRecAd.ts +147 -0
  21. package/src/Privacy.ts +6 -0
  22. package/src/RewardedAd.ts +144 -0
  23. package/src/TargetingData.ts +214 -0
  24. package/src/index.ts +21 -0
  25. package/src/nativeAd/NativeAdView.tsx +162 -0
  26. package/src/nativeAd/NativeAdViewComponents.tsx +185 -0
  27. package/src/nativeAd/NativeAdViewProvider.tsx +35 -0
  28. package/src/types/AdEvent.ts +26 -0
  29. package/src/types/AdInfo.ts +348 -0
  30. package/src/types/AdProps.ts +60 -0
  31. package/src/types/AdViewProps.ts +36 -0
  32. package/src/types/AppLovinMAX.ts +87 -0
  33. package/src/types/AppOpenAd.ts +3 -0
  34. package/src/types/BannerAd.ts +47 -0
  35. package/src/types/Configuration.ts +11 -0
  36. package/src/types/FullscreenAd.ts +141 -0
  37. package/src/types/InterstitialAd.ts +3 -0
  38. package/src/types/MRecAd.ts +13 -0
  39. package/src/types/NativeAd.ts +50 -0
  40. package/src/types/NativeAdViewProps.ts +17 -0
  41. package/src/types/Privacy.ts +74 -0
  42. package/src/types/RewardedAd.ts +20 -0
  43. package/src/types/TargetingData.ts +51 -0
  44. package/src/types/ViewAd.ts +162 -0
  45. package/src/types/index.ts +4 -0
  46. package/src/AppLovinMAXAdView.js +0 -231
  47. package/src/AppLovinMAXEventListeners.js +0 -419
  48. package/src/NativeAdComponents.js +0 -208
  49. package/src/NativeAdView.js +0 -164
  50. package/src/NativeAdViewProvider.js +0 -19
  51. package/src/TargetingData.js +0 -104
  52. package/src/index.js +0 -291
@@ -0,0 +1,141 @@
1
+ import type { AdEventListener } from "./AdEvent";
2
+ import type { AdInfo, AdLoadFailedInfo, AdRevenueInfo, AdDisplayFailedInfo } from "./AdInfo";
3
+
4
+ /**
5
+ * Defines a full-screen ad (i.e Intestitial / Rewarded / AppOpen)
6
+ */
7
+ export type FullscreenAdType = {
8
+
9
+ /**
10
+ * Whether or not this ad is ready to be shown.
11
+ *
12
+ * @param adUnitId The ad unit ID of the ad to check whether it is ready to be shown.
13
+ */
14
+ isAdReady(adUnitId: string): Promise<boolean>;
15
+
16
+ /**
17
+ * Loads an interstitial ad.
18
+ *
19
+ * @param adUnitId The ad unit ID to load an ad for.
20
+ */
21
+ loadAd(adUnitId: string): void;
22
+
23
+ /**
24
+ * Shows the loaded interstitial ad, optionallly for a given placement and custom data to tie ad
25
+ * events to.
26
+ *
27
+ * @param adUnitId The ad unit ID of the ad to show.
28
+ * @param placement The placement to tie the showing ad's events to.
29
+ * @param customData The custom data to tie the showing ad's events to. Maximum size is 8KB.
30
+ */
31
+ showAd(adUnitId: string, placement?: string | null, customData?: string | null): void;
32
+
33
+ /**
34
+ * Sets an extra key/value parameter for the ad.
35
+ *
36
+ * @param adUnitId The ad unit ID of the ad to set a parameter for.
37
+ * @param key Parameter key.
38
+ * @param value Parameter value.
39
+ */
40
+ setExtraParameter(adUnitId: string, key: string, value: string | null): void;
41
+
42
+ /**
43
+ * Sets a local extra parameter to pass to the adapter instances.
44
+ *
45
+ * @param adUnitId The ad unit ID of the ad to set a local parameter for.
46
+ * @param key Parameter key.
47
+ * @param value Parameter value.
48
+ */
49
+ setLocalExtraParameter(adUnitId: string, key: string, value: any): void;
50
+
51
+ /**
52
+ * Adds the specified event listener to receive {@link AdInfo} when a full-screen ad loads a new ad.
53
+ *
54
+ * @param listener Listener to be notified.
55
+ */
56
+ addAdLoadedEventListener(listener: AdEventListener<AdInfo>): void;
57
+
58
+ /**
59
+ * Removes the event listener to receive {@link AdInfo} when a full-screen ad loads a new ad.
60
+ */
61
+ removeAdLoadedEventListener(): void;
62
+
63
+ /**
64
+ * Adds the specified event listener to receive {@link AdLoadFailedInfo} when a full-screen ad
65
+ * could not load a new ad.
66
+ *
67
+ * @param listener Listener to be notified.
68
+ */
69
+ addAdLoadFailedEventListener(listener: AdEventListener<AdLoadFailedInfo>): void;
70
+
71
+ /**
72
+ * Removes the event listener to receive {@ link adLoadFailedInfo} when a full-screen ad could
73
+ * not load a new ad.
74
+ */
75
+ removeAdLoadFailedEventListener(): void;
76
+
77
+ /**
78
+ * Adds the specified event listener to receive {@link AdInfo} when the user clicks the ad.
79
+ *
80
+ * @param listener Listener to be notified.
81
+ */
82
+ addAdClickedEventListener(listener: AdEventListener<AdInfo>): void;
83
+
84
+ /**
85
+ * Removes the event listener to receive {@link AdInfo} when the user clicks the ad.
86
+ */
87
+ removeAdClickedEventListener(): void;
88
+
89
+ /**
90
+ * Adds the specified event listener to receive {@link AdInfo} when a full-screen ad displays the ad.
91
+ *
92
+ * @param listener Listener to be notified.
93
+ */
94
+ addAdDisplayedEventListener(listener: AdEventListener<AdInfo>): void;
95
+
96
+ /**
97
+ * Removes the event listener to receive {@link AdInfo} when a full-screen ad displays the ad.
98
+ */
99
+ removeAdDisplayedEventListener(): void;
100
+
101
+ /**
102
+ * Adds the specified event listener to receive {@link AdDisplayFailedInfo} when a full-screen
103
+ * ad fails to display the ad.
104
+ *
105
+ * @param listener Listener to be notified.
106
+ */
107
+ addAdFailedToDisplayEventListener(listener: AdEventListener<AdDisplayFailedInfo>): void;
108
+
109
+ /**
110
+ * Removes the event listener to receive {@link AdDisplayFailedInfo} when a full-screen ad
111
+ * fails to display the ad.
112
+ */
113
+ removeAdFailedToDisplayEventListener(): void;
114
+
115
+ /**
116
+ * Adds the specified event listener to receive {@link AdInfo} when a full-screen ad hides the
117
+ * ad.
118
+ *
119
+ * @param listener Listener to be notified.
120
+ */
121
+ addAdHiddenEventListener(listener: AdEventListener<AdInfo>): void;
122
+
123
+ /**
124
+ * Removes the event listener to receive {@link AdInfo} when a full-screen ad hides the ad.
125
+ */
126
+ removeAdHiddenEventListener(): void;
127
+
128
+ /**
129
+ * Adds the specified event listener to receive {@link AdRevenueInfo} when a full-screen ad
130
+ * pays ad revenue to the publisher.
131
+ *
132
+ * @param listener Listener to be notified.
133
+ */
134
+ addAdRevenuePaidListener(listener: AdEventListener<AdRevenueInfo>): void;
135
+
136
+ /**
137
+ * Removes the event listener to receive {@link AdRevenueInfo} when a full-screen ad pays
138
+ * ad revenue to the publisher.
139
+ */
140
+ removeAdRevenuePaidListener(): void;
141
+ };
@@ -0,0 +1,3 @@
1
+ import type { FullscreenAdType } from "./FullscreenAd";
2
+
3
+ export type InterstitialAdType = FullscreenAdType;
@@ -0,0 +1,13 @@
1
+ import type { ViewAdType } from "./ViewAd";
2
+ import type { AdViewPosition } from "../AdView";
3
+
4
+ export type MRecAdType = ViewAdType & {
5
+
6
+ /**
7
+ * Creates a MREC at the specified position.
8
+ *
9
+ * @param adUnitId The Ad Unit ID to to load ads for.
10
+ * @param position {@link AdViewPosition} position.
11
+ */
12
+ createAd(adUnitId: string, position: AdViewPosition): void;
13
+ };
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Represents a native ad for rendering `NativeAdView`. Internal use only.
3
+ */
4
+ export type NativeAd = {
5
+
6
+ /**
7
+ * The native ad title text.
8
+ */
9
+ title?: string | null;
10
+
11
+ /**
12
+ * The native ad advertiser text.
13
+ */
14
+ advertiser?: string | null;
15
+
16
+ /**
17
+ * The native ad body text.
18
+ */
19
+ body?: string | null;
20
+
21
+ /**
22
+ * The native ad CTA button text.
23
+ */
24
+ callToAction?: string | null;
25
+
26
+ /**
27
+ * Whether or not this has an image icon.
28
+ */
29
+ image?: boolean;
30
+
31
+ /**
32
+ * The URL string of the icon.
33
+ */
34
+ url?: string | null;
35
+
36
+ /**
37
+ * The star rating of the native ad.
38
+ */
39
+ starRating?: number | null;
40
+
41
+ /**
42
+ * Whether or not the Options view is available.
43
+ */
44
+ isOptionsViewAvailable: boolean;
45
+
46
+ /**
47
+ * Whether or not the Media view is available.
48
+ */
49
+ isMediaViewAvailable: boolean;
50
+ };
@@ -0,0 +1,17 @@
1
+ import type { AdProps } from "./AdProps";
2
+
3
+ /**
4
+ * A handler of {@link NativeAdView}.
5
+ */
6
+ export type NativeAdViewHandler = {
7
+
8
+ /**
9
+ * Loads a native ad.
10
+ */
11
+ loadAd(): void;
12
+ };
13
+
14
+ /**
15
+ * Represents a {@link NativeAdView}.
16
+ */
17
+ export type NativeAdViewProps = AdProps;
@@ -0,0 +1,74 @@
1
+ export type PrivacyType = {
2
+
3
+ /**********************************************************************************/
4
+ /* Privacy */
5
+ /**********************************************************************************/
6
+
7
+ /**
8
+ * Shows the user consent dialog to the user by using a dialog in the AppLovinMAX SDK.
9
+ */
10
+ showConsentDialog(): Promise<void>;
11
+
12
+ /**
13
+ * Sets whether or not the user provided consent for information-sharing with AppLovin.
14
+ *
15
+ * @param hasUserConsent true if the user provided consent for information sharing.
16
+ */
17
+ setHasUserConsent(hasUserConsent: boolean): void;
18
+
19
+ /**
20
+ * Checks if user set consent for information sharing.
21
+ */
22
+ hasUserConsent(): Promise<boolean>;
23
+
24
+ /**
25
+ * Marks the user as age-restricted (i.e. under 16).
26
+ *
27
+ * @param isAgeRestrictedUser true if the user is age restricted (i.e. under 16).
28
+ */
29
+ setIsAgeRestrictedUser(isAgeRestrictedUser: boolean): void;
30
+
31
+ /**
32
+ * Checks if the user is age-restricted.
33
+ */
34
+ isAgeRestrictedUser(): Promise<boolean>;
35
+
36
+ /**
37
+ * Sets whether or not the user opted out of the sale of their personal information.
38
+ *
39
+ * @param doNotSell true if the user opted out of the sale of their personal information.
40
+ */
41
+ setDoNotSell(doNotSell: boolean): void;
42
+
43
+ /**
44
+ * Checks if the user opted out of the sale of their personal information.
45
+ */
46
+ isDoNotSell(): Promise<boolean>;
47
+
48
+ /**********************************************************************************/
49
+ /* TERM FLow */
50
+ /**********************************************************************************/
51
+
52
+ /**
53
+ * Enables the MAX Terms Flow.
54
+ *
55
+ * @param enabled true to enable the MAX Terms Flow.
56
+ */
57
+ setConsentFlowEnabled(enabled: boolean): Promise<void>;
58
+
59
+ /**
60
+ * The URL of your company’s privacy policy, as a string. This is required in order to enable
61
+ * the Terms Flow.
62
+ *
63
+ * @param urlString The URL string to point your company’s privacy policy.
64
+ */
65
+ setPrivacyPolicyUrl(urlString: string): Promise<void>;
66
+
67
+ /**
68
+ * The URL of your company’s terms of service, as a string. This is optional; you can enable
69
+ * the Terms Flow with or without it.
70
+ *
71
+ * @param urlString The URL string to point your company’s terms of service.
72
+ */
73
+ setTermsOfServiceUrl(urlString: string): Promise<void>;
74
+ };
@@ -0,0 +1,20 @@
1
+ import type { AdEventListener } from "./AdEvent";
2
+ import type { AdRewardInfo } from "./AdInfo";
3
+ import type { FullscreenAdType } from "./FullscreenAd";
4
+
5
+ export type RewardedAdType = FullscreenAdType & {
6
+
7
+ /**
8
+ * Adds the specified event listener to receive {@link AdRewardInfo} when {@link RewardedAd}
9
+ * rewards the user.
10
+ *
11
+ * @param listener Listener to be notified.
12
+ */
13
+ addAdReceivedRewardEventListener(listener: AdEventListener<AdRewardInfo>): void;
14
+
15
+ /**
16
+ * Removes the event listener to receive {@link AdRewardInfo} when {@link RewardedAd} rewards
17
+ * the user.
18
+ */
19
+ removeAdReceivedRewardEventListener(): void;
20
+ };
@@ -0,0 +1,51 @@
1
+ import type { AdContentRating, UserGender } from "src/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
+ /**
11
+ * Sets the year of birth of the user. Set this to 0 to clear this value.
12
+ */
13
+ yearOfBirth: number | Promise<number>;
14
+
15
+ /**
16
+ * Sets the gender of the user. Set this to {@link UserGender.Unknown} to clear this value.
17
+ */
18
+ gender: UserGender | Promise<UserGender>;
19
+
20
+ /**
21
+ * Sets the maximum ad content rating shown to the user. The levels are based on IQG Media
22
+ * Ratings: 1=All Audiences, 2=Everyone Over 12, 3=Mature Audiences.
23
+ * Set this to {@link AdContentRating.None} to clear this value.
24
+ */
25
+ maximumAdContentRating: AdContentRating | Promise<AdContentRating>;
26
+
27
+ /**
28
+ * Sets the email of the user. Set this to null to clear this value.
29
+ */
30
+ email: string | null | Promise<string | null>;
31
+
32
+ /**
33
+ * Sets the phone number of the user. Set this to null to clear this value.
34
+ */
35
+ phoneNumber: string | null | Promise<string | null>;
36
+
37
+ /**
38
+ * Sets the keywords describing the application. Set this to null to clear this value.
39
+ */
40
+ keywords: string[] | null | Promise<string[] | null>;
41
+
42
+ /**
43
+ * Sets the interests of the user. Set this to null to clear this value.
44
+ */
45
+ interests: string[] | null | Promise<string[] | null>;
46
+
47
+ /**
48
+ * Clears all saved data from this class.
49
+ */
50
+ clearAll(): void;
51
+ };
@@ -0,0 +1,162 @@
1
+ import type { AdEventListener } from "./AdEvent";
2
+ import type { AdInfo, AdLoadFailedInfo, AdRevenueInfo } from "./AdInfo";
3
+ import type { AdViewPosition } from "../AdView";
4
+
5
+ /**
6
+ * Define a view-based ad (i.e. Banner / MREC)
7
+ */
8
+ export type ViewAdType = {
9
+
10
+ /**
11
+ * Destroys the banner/MREC.
12
+ *
13
+ * @param adUnitId The ad unit ID of the ad to destroy.
14
+ */
15
+ destroyAd(adUnitId: string): void;
16
+
17
+ /**
18
+ * Shows the banner/MREC.
19
+ *
20
+ * @param adUnitId The ad unit ID of the ad to show.
21
+ */
22
+ showAd(adUnitId: string): void;
23
+
24
+ /**
25
+ * Hides the banner/MREC.
26
+ *
27
+ * @param adUnitId The ad unit ID of the ad to hide.
28
+ */
29
+ hideAd(adUnitId: string): void;
30
+
31
+ /**
32
+ * Sets a placement to tie the showing ad’s events to.
33
+ *
34
+ * @param adUnitId The ad unit ID of the ad to set a placement for.
35
+ * @param placement The placement to tie the showing ad's events to.
36
+ */
37
+ setPlacement(adUnitId: string, placement: string | null): void;
38
+
39
+ /**
40
+ * Sets custom data to tie the showing ad’s events to.
41
+ *
42
+ * @param adUnitId The ad unit ID of the ad to set custom data for.
43
+ * @param customData The custom data to tie the showing ad's events to. Maximum size is 8KB.
44
+ */
45
+ setCustomData(adUnitId: string, customData: string | null): void;
46
+
47
+ /**
48
+ * Updates the banner/mrec position.
49
+ *
50
+ * @param adUnitId The ad unit ID of the ad to update the position of.
51
+ * @param bannerPosition {@link AdViewPosition} position.
52
+ */
53
+ updatePosition(adUnitId: string, bannerPosition: AdViewPosition): void;
54
+
55
+ /**
56
+ * Sets an extra key/value parameter for the ad.
57
+ *
58
+ * @param adUnitId The ad unit ID of the ad to set a parameter for.
59
+ * @param key Key parameter.
60
+ * @param value Value parameter.
61
+ */
62
+ setExtraParameter(adUnitId: string, key: string, value: string | null): void;
63
+
64
+ /**
65
+ * Set a local extra parameter to pass to the adapter instances.
66
+ *
67
+ * @param adUnitId The ad unit ID of the ad to set a local parameter for.
68
+ * @param key Key parameter.
69
+ * @param value Value parameter.
70
+ */
71
+ setLocalExtraParameter(adUnitId: string, key: string, value: any): void;
72
+
73
+ /**
74
+ * Starts or resumes auto-refreshing of the banner/mrec.
75
+ *
76
+ * @param adUnitId The ad unit ID of the ad to start or resume auto-refreshing.
77
+ */
78
+ startAutoRefresh(adUnitId: string): void;
79
+
80
+ /**
81
+ * Pauses auto-refreshing of the banner/mrec.
82
+ *
83
+ * @param adUnitId The ad unit ID of the ad to stop auto-refreshing.
84
+ */
85
+ stopAutoRefresh(adUnitId: string): void;
86
+
87
+ /**
88
+ * Adds the specified event listener to receive {@link AdInfo} when a view-base ad loads a new ad.
89
+ *
90
+ * @param listener Listener to be notified.
91
+ */
92
+ addAdLoadedEventListener(listener: AdEventListener<AdInfo>): void;
93
+
94
+ /**
95
+ * Removes the event listener to receive {@link AdInfo} when a view-base ad loads a new ad.
96
+ */
97
+ removeAdLoadedEventListener(): void;
98
+
99
+ /**
100
+ * Adds the specified event listener to receive {@link AdLoadFailedInfo} when a view-base ad
101
+ * could not load a new ad.
102
+ *
103
+ * @param listener Listener to be notified.
104
+ */
105
+ addAdLoadFailedEventListener(listener: AdEventListener<AdLoadFailedInfo>): void;
106
+
107
+ /**
108
+ * Removes the event listener to receive {@link AdLoadFailedInfo} when a view-base ad could not
109
+ * load a new ad.
110
+ */
111
+ removeAdLoadFailedEventListener(): void;
112
+
113
+ /**
114
+ * Adds the specified event listener to receive {@link AdInfo} when the user clicks the ad.
115
+ *
116
+ * @param listener Listener to be notified.
117
+ */
118
+ addAdClickedEventListener(listener: AdEventListener<AdInfo>): void;
119
+
120
+ /**
121
+ * Removes the event listener to receive {@link AdInfo} when the user clicks the ad.
122
+ */
123
+ removeAdClickedEventListener(): void;
124
+
125
+ /**
126
+ * Adds the specified event listener to receive {@link AdInfo} when a view-base ad collapses the ad.
127
+ *
128
+ * @param listener Listener to be notified.
129
+ */
130
+ addAdCollapsedEventListener(listener: AdEventListener<AdInfo>): void;
131
+
132
+ /**
133
+ * Removes the event listener to receive {@link AdInfo} when a view-base ad collapses the ad.
134
+ */
135
+ removeAdCollapsedEventListener(): void;
136
+
137
+ /**
138
+ * Adds the specified event listener to receive {@link AdInfo} when a view-base ad expands the ad.
139
+ *
140
+ * @param listener Listener to be notified.
141
+ */
142
+ addAdExpandedEventListener(listener: AdEventListener<AdInfo>): void;
143
+
144
+ /**
145
+ * Removes the event listener to receive {@link AdInfo} when a view-base ad expands the ad.
146
+ */
147
+ removeAdExpandedEventListener(): void;
148
+
149
+ /**
150
+ * Adds the specified event listener to receive {@link AdRevenueInfo} when a view-base ad pays
151
+ * ad revenue to the publisher.
152
+ *
153
+ * @param listener Listener to be notified.
154
+ */
155
+ addAdRevenuePaidListener(listener: AdEventListener<AdRevenueInfo>): void;
156
+
157
+ /**
158
+ * Removes the event listener to receive {@link AdRevenueInfo} when when a view-base ad pays ad
159
+ * revenue to the publisher.
160
+ */
161
+ removeAdRevenuePaidListener(): void;
162
+ };
@@ -0,0 +1,4 @@
1
+ export * from "./Configuration";
2
+ export * from "./AdInfo";
3
+ export * from "./AdViewProps";
4
+ export * from "./NativeAdViewProps";