react-native-applovin-max 6.0.1 → 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.
- package/android/build.gradle +3 -3
- package/android/src/main/java/com/applovin/reactnative/AppLovinMAXModule.java +127 -20
- package/ios/AppLovinMAX.m +154 -25
- package/ios/Podfile +1 -1
- package/ios/Podfile.lock +4 -4
- package/package.json +5 -1
- package/react-native-applovin-max.podspec +2 -2
- package/src/AdView.tsx +58 -43
- package/src/AppLovinMAX.ts +8 -10
- package/src/AppOpenAd.ts +28 -31
- package/src/BannerAd.ts +36 -35
- package/src/EventEmitter.ts +9 -9
- package/src/InterstitialAd.ts +31 -32
- package/src/MRecAd.ts +32 -31
- package/src/Privacy.ts +58 -2
- package/src/RewardedAd.ts +31 -34
- package/src/TargetingData.ts +46 -35
- package/src/index.ts +12 -12
- package/src/nativeAd/NativeAdView.tsx +64 -55
- package/src/nativeAd/NativeAdViewComponents.tsx +38 -29
- package/src/nativeAd/NativeAdViewProvider.tsx +16 -13
- package/src/types/AdEvent.ts +2 -13
- package/src/types/AdInfo.ts +6 -18
- package/src/types/AdProps.ts +7 -3
- package/src/types/AdViewProps.ts +4 -5
- package/src/types/AppLovinMAX.ts +14 -8
- package/src/types/AppOpenAd.ts +1 -1
- package/src/types/BannerAd.ts +8 -9
- package/src/types/Configuration.ts +28 -3
- package/src/types/FullscreenAd.ts +19 -19
- package/src/types/InterstitialAd.ts +1 -1
- package/src/types/MRecAd.ts +3 -4
- package/src/types/NativeAd.ts +1 -2
- package/src/types/NativeAdViewProps.ts +1 -2
- package/src/types/Privacy.ts +28 -16
- package/src/types/RewardedAd.ts +4 -5
- package/src/types/TargetingData.ts +1 -2
- package/src/types/ViewAd.ts +20 -20
- package/src/types/index.ts +4 -4
- package/android/src/main/java/com/applovin/mediation/adapters/GoogleAdManagerMediationAdapter.java.saved +0 -1616
- package/android/src/main/java/com/applovin/mediation/adapters/GoogleMediationAdapter.java.old +0 -1788
- package/android/src/main/java/com/applovin/mediation/adapters/MintegralMediationAdapter.java.old +0 -1481
- package/android/src/main/java/com/applovin/mediation/adapters/MintegralMediationAdapter.java.saved +0 -1448
- package/ios/AppLovinMAX.xcworkspace/xcuserdata/hiroshi.watanabe.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
package/android/build.gradle
CHANGED
|
@@ -35,8 +35,8 @@ android {
|
|
|
35
35
|
defaultConfig {
|
|
36
36
|
minSdkVersion 16
|
|
37
37
|
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
|
|
38
|
-
versionCode
|
|
39
|
-
versionName "6.0
|
|
38
|
+
versionCode 6010000
|
|
39
|
+
versionName "6.1.0"
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
flavorDimensions("default")
|
|
@@ -140,5 +140,5 @@ dependencies {
|
|
|
140
140
|
// noinspection GradleDynamicVersion
|
|
141
141
|
api 'com.facebook.react:react-native:+'
|
|
142
142
|
|
|
143
|
-
implementation 'com.applovin:applovin-sdk:
|
|
143
|
+
implementation 'com.applovin:applovin-sdk:12.0.0'
|
|
144
144
|
}
|
|
@@ -7,6 +7,7 @@ import android.content.pm.PackageManager;
|
|
|
7
7
|
import android.graphics.Color;
|
|
8
8
|
import android.graphics.Point;
|
|
9
9
|
import android.graphics.Rect;
|
|
10
|
+
import android.net.Uri;
|
|
10
11
|
import android.os.Bundle;
|
|
11
12
|
import android.text.TextUtils;
|
|
12
13
|
import android.util.Log;
|
|
@@ -41,6 +42,7 @@ import com.applovin.sdk.AppLovinMediationProvider;
|
|
|
41
42
|
import com.applovin.sdk.AppLovinPrivacySettings;
|
|
42
43
|
import com.applovin.sdk.AppLovinSdk;
|
|
43
44
|
import com.applovin.sdk.AppLovinSdkConfiguration;
|
|
45
|
+
import com.applovin.sdk.AppLovinSdkConfiguration.ConsentFlowUserGeography;
|
|
44
46
|
import com.applovin.sdk.AppLovinSdkSettings;
|
|
45
47
|
import com.applovin.sdk.AppLovinSdkUtils;
|
|
46
48
|
import com.facebook.react.bridge.Arguments;
|
|
@@ -79,6 +81,10 @@ public class AppLovinMAXModule
|
|
|
79
81
|
private static final String SDK_TAG = "AppLovinSdk";
|
|
80
82
|
private static final String TAG = "AppLovinMAXModule";
|
|
81
83
|
|
|
84
|
+
private static final String USER_GEOGRAPHY_GDPR = "G";
|
|
85
|
+
private static final String USER_GEOGRAPHY_OTHER = "O";
|
|
86
|
+
private static final String USER_GEOGRAPHY_UNKNOWN = "U";
|
|
87
|
+
|
|
82
88
|
private static final String ON_BANNER_AD_LOADED_EVENT = "OnBannerAdLoadedEvent";
|
|
83
89
|
private static final String ON_BANNER_AD_LOAD_FAILED_EVENT = "OnBannerAdLoadFailedEvent";
|
|
84
90
|
private static final String ON_BANNER_AD_CLICKED_EVENT = "OnBannerAdClickedEvent";
|
|
@@ -143,6 +149,7 @@ public class AppLovinMAXModule
|
|
|
143
149
|
private int lastRotation;
|
|
144
150
|
|
|
145
151
|
// Store these values if pub attempts to set it before initializing
|
|
152
|
+
private List<String> initializationAdUnitIdsToSet;
|
|
146
153
|
private String userIdToSet;
|
|
147
154
|
private List<String> testDeviceAdvertisingIdsToSet;
|
|
148
155
|
private Boolean verboseLoggingToSet;
|
|
@@ -150,6 +157,11 @@ public class AppLovinMAXModule
|
|
|
150
157
|
private Boolean locationCollectionEnabledToSet;
|
|
151
158
|
private final Map<String, String> extraParametersToSet = new HashMap<>( 8 );
|
|
152
159
|
|
|
160
|
+
private Boolean termsAndPrivacyPolicyFlowEnabledToSet;
|
|
161
|
+
private Uri privacyPolicyURLToSet;
|
|
162
|
+
private Uri termsOfServiceURLToSet;
|
|
163
|
+
private String debugUserGeographyToSet;
|
|
164
|
+
|
|
153
165
|
private Integer targetingYearOfBirthToSet;
|
|
154
166
|
private String targetingGenderToSet;
|
|
155
167
|
private Integer targetingMaximumAdContentRatingToSet;
|
|
@@ -286,46 +298,81 @@ public class AppLovinMAXModule
|
|
|
286
298
|
}
|
|
287
299
|
}
|
|
288
300
|
|
|
289
|
-
|
|
290
|
-
sdk = AppLovinSdk.getInstance( sdkKeyToUse, new AppLovinSdkSettings( getReactApplicationContext() ), context );
|
|
291
|
-
sdk.setPluginVersion( "React-Native-" + pluginVersion );
|
|
292
|
-
sdk.setMediationProvider( AppLovinMediationProvider.MAX );
|
|
301
|
+
AppLovinSdkSettings settings = new AppLovinSdkSettings( getReactApplicationContext() );
|
|
293
302
|
|
|
294
|
-
//
|
|
295
|
-
if (
|
|
303
|
+
// Selective init
|
|
304
|
+
if ( initializationAdUnitIdsToSet != null )
|
|
296
305
|
{
|
|
297
|
-
|
|
298
|
-
|
|
306
|
+
settings.setInitializationAdUnitIds( initializationAdUnitIdsToSet );
|
|
307
|
+
initializationAdUnitIdsToSet = null;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
if ( termsAndPrivacyPolicyFlowEnabledToSet != null )
|
|
311
|
+
{
|
|
312
|
+
settings.getTermsAndPrivacyPolicyFlowSettings().setEnabled( termsAndPrivacyPolicyFlowEnabledToSet );
|
|
313
|
+
termsAndPrivacyPolicyFlowEnabledToSet = null;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
if ( privacyPolicyURLToSet != null )
|
|
317
|
+
{
|
|
318
|
+
settings.getTermsAndPrivacyPolicyFlowSettings().setPrivacyPolicyUri( privacyPolicyURLToSet );
|
|
319
|
+
privacyPolicyURLToSet = null;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
if ( termsOfServiceURLToSet != null )
|
|
323
|
+
{
|
|
324
|
+
settings.getTermsAndPrivacyPolicyFlowSettings().setTermsOfServiceUri( termsOfServiceURLToSet );
|
|
325
|
+
termsOfServiceURLToSet = null;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
if ( AppLovinSdkUtils.isValidString( debugUserGeographyToSet ) )
|
|
329
|
+
{
|
|
330
|
+
settings.getTermsAndPrivacyPolicyFlowSettings().setDebugUserGeography( getAppLovinConsentFlowUserGeography( debugUserGeographyToSet ) );
|
|
331
|
+
debugUserGeographyToSet = null;
|
|
299
332
|
}
|
|
300
333
|
|
|
301
334
|
// Set test device ids if needed
|
|
302
335
|
if ( testDeviceAdvertisingIdsToSet != null )
|
|
303
336
|
{
|
|
304
|
-
|
|
337
|
+
settings.setTestDeviceAdvertisingIds( testDeviceAdvertisingIdsToSet );
|
|
305
338
|
testDeviceAdvertisingIdsToSet = null;
|
|
306
339
|
}
|
|
307
340
|
|
|
308
341
|
// Set verbose logging state if needed
|
|
309
342
|
if ( verboseLoggingToSet != null )
|
|
310
343
|
{
|
|
311
|
-
|
|
344
|
+
settings.setVerboseLogging( verboseLoggingToSet );
|
|
312
345
|
verboseLoggingToSet = null;
|
|
313
346
|
}
|
|
314
347
|
|
|
315
348
|
// Set creative debugger enabled if needed.
|
|
316
349
|
if ( creativeDebuggerEnabledToSet != null )
|
|
317
350
|
{
|
|
318
|
-
|
|
351
|
+
settings.setCreativeDebuggerEnabled( creativeDebuggerEnabledToSet );
|
|
319
352
|
creativeDebuggerEnabledToSet = null;
|
|
320
353
|
}
|
|
321
354
|
|
|
322
355
|
// Set location collection enabled if needed
|
|
323
356
|
if ( locationCollectionEnabledToSet != null )
|
|
324
357
|
{
|
|
325
|
-
|
|
358
|
+
settings.setLocationCollectionEnabled( locationCollectionEnabledToSet );
|
|
326
359
|
locationCollectionEnabledToSet = null;
|
|
327
360
|
}
|
|
328
361
|
|
|
362
|
+
setPendingExtraParametersIfNeeded( settings );
|
|
363
|
+
|
|
364
|
+
// Initialize SDK
|
|
365
|
+
sdk = AppLovinSdk.getInstance( sdkKeyToUse, settings, context );
|
|
366
|
+
sdk.setPluginVersion( "React-Native-" + pluginVersion );
|
|
367
|
+
sdk.setMediationProvider( AppLovinMediationProvider.MAX );
|
|
368
|
+
|
|
369
|
+
// Set user id if needed
|
|
370
|
+
if ( AppLovinSdkUtils.isValidString( userIdToSet ) )
|
|
371
|
+
{
|
|
372
|
+
sdk.setUserIdentifier( userIdToSet );
|
|
373
|
+
userIdToSet = null;
|
|
374
|
+
}
|
|
375
|
+
|
|
329
376
|
if ( targetingYearOfBirthToSet != null )
|
|
330
377
|
{
|
|
331
378
|
sdk.getTargetingData().setYearOfBirth( targetingYearOfBirthToSet <= 0 ? null : targetingYearOfBirthToSet );
|
|
@@ -368,8 +415,6 @@ public class AppLovinMAXModule
|
|
|
368
415
|
targetingInterestsToSet = null;
|
|
369
416
|
}
|
|
370
417
|
|
|
371
|
-
setPendingExtraParametersIfNeeded( sdk.getSettings() );
|
|
372
|
-
|
|
373
418
|
sdk.initializeSdk( new AppLovinSdk.SdkInitializationListener()
|
|
374
419
|
{
|
|
375
420
|
@Override
|
|
@@ -404,6 +449,8 @@ public class AppLovinMAXModule
|
|
|
404
449
|
|
|
405
450
|
WritableMap sdkConfiguration = Arguments.createMap();
|
|
406
451
|
sdkConfiguration.putString( "countryCode", configuration.getCountryCode() );
|
|
452
|
+
sdkConfiguration.putString( "consentFlowUserGeography", getRawAppLovinConsentFlowUserGeography( configuration.getConsentFlowUserGeography() ) );
|
|
453
|
+
sdkConfiguration.putBoolean( "isTestModeEnabled", configuration.isTestModeEnabled() );
|
|
407
454
|
promise.resolve( sdkConfiguration );
|
|
408
455
|
}
|
|
409
456
|
} );
|
|
@@ -566,14 +613,46 @@ public class AppLovinMAXModule
|
|
|
566
613
|
}
|
|
567
614
|
}
|
|
568
615
|
|
|
616
|
+
@ReactMethod
|
|
617
|
+
public void setInitializationAdUnitIds(final ReadableArray rawAdUnitIds)
|
|
618
|
+
{
|
|
619
|
+
initializationAdUnitIdsToSet = new ArrayList<>( rawAdUnitIds.size() );
|
|
620
|
+
|
|
621
|
+
// Convert to String List
|
|
622
|
+
for ( Object adUnitId : rawAdUnitIds.toArrayList() )
|
|
623
|
+
{
|
|
624
|
+
initializationAdUnitIdsToSet.add( (String) adUnitId );
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
// MAX Terms and Privacy Policy Flow
|
|
629
|
+
|
|
569
630
|
@ReactMethod
|
|
570
631
|
public void setConsentFlowEnabled(final boolean enabled) { }
|
|
571
632
|
|
|
572
633
|
@ReactMethod
|
|
573
|
-
public void
|
|
634
|
+
public void setTermsAndPrivacyPolicyFlowEnabled(final boolean enabled)
|
|
635
|
+
{
|
|
636
|
+
termsAndPrivacyPolicyFlowEnabledToSet = enabled;
|
|
637
|
+
}
|
|
574
638
|
|
|
575
639
|
@ReactMethod
|
|
576
|
-
public void
|
|
640
|
+
public void setPrivacyPolicyUrl(final String urlString)
|
|
641
|
+
{
|
|
642
|
+
privacyPolicyURLToSet = Uri.parse( urlString );
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
@ReactMethod
|
|
646
|
+
public void setTermsOfServiceUrl(final String urlString)
|
|
647
|
+
{
|
|
648
|
+
termsOfServiceURLToSet = Uri.parse( urlString );
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
@ReactMethod
|
|
652
|
+
public void setConsentFlowDebugUserGeography(final String userGeography)
|
|
653
|
+
{
|
|
654
|
+
debugUserGeographyToSet = userGeography;
|
|
655
|
+
}
|
|
577
656
|
|
|
578
657
|
// Data Passing
|
|
579
658
|
|
|
@@ -1406,7 +1485,7 @@ public class AppLovinMAXModule
|
|
|
1406
1485
|
name = ( MaxAdFormat.MREC == adFormat ) ? ON_MREC_AD_LOADED_EVENT : ON_BANNER_AD_LOADED_EVENT;
|
|
1407
1486
|
|
|
1408
1487
|
String adViewPosition = mAdViewPositions.get( ad.getAdUnitId() );
|
|
1409
|
-
if (
|
|
1488
|
+
if ( AppLovinSdkUtils.isValidString( adViewPosition ) )
|
|
1410
1489
|
{
|
|
1411
1490
|
// Only position ad if not native UI component
|
|
1412
1491
|
positionAdView( ad );
|
|
@@ -2421,18 +2500,46 @@ public class AppLovinMAXModule
|
|
|
2421
2500
|
return AppLovinAdContentRating.NONE;
|
|
2422
2501
|
}
|
|
2423
2502
|
|
|
2503
|
+
private static ConsentFlowUserGeography getAppLovinConsentFlowUserGeography(final String userGeography)
|
|
2504
|
+
{
|
|
2505
|
+
if ( USER_GEOGRAPHY_GDPR.equalsIgnoreCase( userGeography ) )
|
|
2506
|
+
{
|
|
2507
|
+
return ConsentFlowUserGeography.GDPR;
|
|
2508
|
+
}
|
|
2509
|
+
else if ( USER_GEOGRAPHY_OTHER.equalsIgnoreCase( userGeography ) )
|
|
2510
|
+
{
|
|
2511
|
+
return ConsentFlowUserGeography.OTHER;
|
|
2512
|
+
}
|
|
2513
|
+
|
|
2514
|
+
return ConsentFlowUserGeography.UNKNOWN;
|
|
2515
|
+
}
|
|
2516
|
+
|
|
2517
|
+
private static String getRawAppLovinConsentFlowUserGeography(final ConsentFlowUserGeography userGeography)
|
|
2518
|
+
{
|
|
2519
|
+
if ( ConsentFlowUserGeography.GDPR == userGeography )
|
|
2520
|
+
{
|
|
2521
|
+
return USER_GEOGRAPHY_GDPR;
|
|
2522
|
+
}
|
|
2523
|
+
else if ( ConsentFlowUserGeography.OTHER == userGeography )
|
|
2524
|
+
{
|
|
2525
|
+
return USER_GEOGRAPHY_OTHER;
|
|
2526
|
+
}
|
|
2527
|
+
|
|
2528
|
+
return USER_GEOGRAPHY_UNKNOWN;
|
|
2529
|
+
}
|
|
2530
|
+
|
|
2424
2531
|
// AD INFO
|
|
2425
2532
|
|
|
2426
2533
|
public WritableMap getAdInfo(final MaxAd ad)
|
|
2427
2534
|
{
|
|
2428
2535
|
WritableMap adInfo = Arguments.createMap();
|
|
2429
2536
|
adInfo.putString( "adUnitId", ad.getAdUnitId() );
|
|
2430
|
-
adInfo.putString( "creativeId",
|
|
2537
|
+
adInfo.putString( "creativeId", AppLovinSdkUtils.isValidString( ad.getCreativeId() ) ? ad.getCreativeId() : "" );
|
|
2431
2538
|
adInfo.putString( "networkName", ad.getNetworkName() );
|
|
2432
|
-
adInfo.putString( "placement",
|
|
2539
|
+
adInfo.putString( "placement", AppLovinSdkUtils.isValidString( ad.getPlacement() ) ? ad.getPlacement() : "" );
|
|
2433
2540
|
adInfo.putDouble( "revenue", ad.getRevenue() );
|
|
2434
2541
|
adInfo.putMap( "waterfall", createAdWaterfallInfo( ad.getWaterfall() ) );
|
|
2435
|
-
adInfo.putString( "dspName",
|
|
2542
|
+
adInfo.putString( "dspName", AppLovinSdkUtils.isValidString( ad.getDspName() ) ? ad.getDspName() : "" );
|
|
2436
2543
|
|
|
2437
2544
|
return adInfo;
|
|
2438
2545
|
}
|
package/ios/AppLovinMAX.m
CHANGED
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
@property (nonatomic, strong) ALSdkConfiguration *sdkConfiguration;
|
|
38
38
|
|
|
39
39
|
// Store these values if pub attempts to set it before initializing
|
|
40
|
+
@property (nonatomic, strong, nullable) NSArray<NSString *> *initializationAdUnitIdentifiersToSet;
|
|
40
41
|
@property (nonatomic, copy, nullable) NSString *userIdentifierToSet;
|
|
41
42
|
@property (nonatomic, strong, nullable) NSArray<NSString *> *testDeviceIdentifiersToSet;
|
|
42
43
|
@property (nonatomic, strong, nullable) NSNumber *verboseLoggingToSet;
|
|
@@ -45,8 +46,10 @@
|
|
|
45
46
|
@property (nonatomic, strong) NSMutableDictionary<NSString *, NSString *> *extraParametersToSet;
|
|
46
47
|
|
|
47
48
|
@property (nonatomic, strong, nullable) NSNumber *consentFlowEnabledToSet;
|
|
49
|
+
@property (nonatomic, strong, nullable) NSNumber *termsAndPrivacyPolicyFlowEnabledToSet;
|
|
48
50
|
@property (nonatomic, strong, nullable) NSURL *privacyPolicyURLToSet;
|
|
49
51
|
@property (nonatomic, strong, nullable) NSURL *termsOfServiceURLToSet;
|
|
52
|
+
@property (nonatomic, copy, nullable) NSString *debugUserGeographyToSet;
|
|
50
53
|
|
|
51
54
|
@property (nonatomic, strong, nullable) NSNumber *targetingYearOfBirthToSet;
|
|
52
55
|
@property (nonatomic, copy, nullable) NSString *targetingGenderToSet;
|
|
@@ -82,6 +85,16 @@
|
|
|
82
85
|
static NSString *const SDK_TAG = @"AppLovinSdk";
|
|
83
86
|
static NSString *const TAG = @"AppLovinMAX";
|
|
84
87
|
|
|
88
|
+
static NSString *const USER_GEOGRAPHY_GDPR = @"G";
|
|
89
|
+
static NSString *const USER_GEOGRAPHY_OTHER = @"O";
|
|
90
|
+
static NSString *const USER_GEOGRAPHY_UNKNOWN = @"U";
|
|
91
|
+
|
|
92
|
+
static NSString *const APP_TRACKING_STATUS_NOTDETERMINED = @"N";
|
|
93
|
+
static NSString *const APP_TRACKING_STATUS_RESTRICTED = @"R";
|
|
94
|
+
static NSString *const APP_TRACKING_STATUS_DENIED = @"D";
|
|
95
|
+
static NSString *const APP_TRACKING_STATUS_AUTHORIZED = @"A";
|
|
96
|
+
static NSString *const APP_TRACKING_STATUS_UNAVAILABLE = @"U";
|
|
97
|
+
|
|
85
98
|
static NSString *const ON_BANNER_AD_LOADED_EVENT = @"OnBannerAdLoadedEvent";
|
|
86
99
|
static NSString *const ON_BANNER_AD_LOAD_FAILED_EVENT = @"OnBannerAdLoadFailedEvent";
|
|
87
100
|
static NSString *const ON_BANNER_AD_CLICKED_EVENT = @"OnBannerAdClickedEvent";
|
|
@@ -212,54 +225,100 @@ RCT_EXPORT_METHOD(initialize:(NSString *)pluginVersion :(NSString *)sdkKey :(RCT
|
|
|
212
225
|
}
|
|
213
226
|
|
|
214
227
|
ALSdkSettings *settings = [[ALSdkSettings alloc] init];
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
self.consentFlowEnabledToSet = nil;
|
|
220
|
-
self.privacyPolicyURLToSet = nil;
|
|
221
|
-
self.termsOfServiceURLToSet = nil;
|
|
222
|
-
|
|
223
|
-
// Initialize SDK
|
|
224
|
-
self.sdk = [ALSdk sharedWithKey: sdkKey settings: settings];
|
|
225
|
-
[self.sdk setPluginVersion: [@"React-Native-" stringByAppendingString: pluginVersion]];
|
|
226
|
-
[self.sdk setMediationProvider: ALMediationProviderMAX];
|
|
227
|
-
|
|
228
|
-
// Set user id if needed
|
|
229
|
-
if ( [self.userIdentifierToSet al_isValidString] )
|
|
228
|
+
|
|
229
|
+
// Selective init
|
|
230
|
+
if ( self.initializationAdUnitIdentifiersToSet )
|
|
230
231
|
{
|
|
231
|
-
|
|
232
|
-
self.
|
|
232
|
+
settings.initializationAdUnitIdentifiers = self.initializationAdUnitIdentifiersToSet;
|
|
233
|
+
self.initializationAdUnitIdentifiersToSet = nil;
|
|
233
234
|
}
|
|
234
|
-
|
|
235
|
+
|
|
236
|
+
// Deprecated consent flow which automatically moves to the new flow
|
|
237
|
+
if ( self.consentFlowEnabledToSet )
|
|
238
|
+
{
|
|
239
|
+
settings.consentFlowSettings.enabled = self.consentFlowEnabledToSet.boolValue;
|
|
240
|
+
self.consentFlowEnabledToSet = nil;
|
|
241
|
+
|
|
242
|
+
if ( self.privacyPolicyURLToSet )
|
|
243
|
+
{
|
|
244
|
+
settings.consentFlowSettings.privacyPolicyURL = self.privacyPolicyURLToSet;
|
|
245
|
+
self.privacyPolicyURLToSet = nil;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
if (self.termsOfServiceURLToSet )
|
|
249
|
+
{
|
|
250
|
+
settings.consentFlowSettings.termsOfServiceURL = self.termsOfServiceURLToSet;
|
|
251
|
+
self.termsOfServiceURLToSet = nil;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// New terms and privacy policy flow
|
|
256
|
+
if ( self.termsAndPrivacyPolicyFlowEnabledToSet )
|
|
257
|
+
{
|
|
258
|
+
settings.termsAndPrivacyPolicyFlowSettings.enabled = self.termsAndPrivacyPolicyFlowEnabledToSet.boolValue;
|
|
259
|
+
self.termsAndPrivacyPolicyFlowEnabledToSet = nil;
|
|
260
|
+
|
|
261
|
+
if ( self.privacyPolicyURLToSet )
|
|
262
|
+
{
|
|
263
|
+
settings.termsAndPrivacyPolicyFlowSettings.privacyPolicyURL = self.privacyPolicyURLToSet;
|
|
264
|
+
self.privacyPolicyURLToSet = nil;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
if ( self.termsOfServiceURLToSet )
|
|
268
|
+
{
|
|
269
|
+
settings.termsAndPrivacyPolicyFlowSettings.termsOfServiceURL = self.termsOfServiceURLToSet;
|
|
270
|
+
self.termsOfServiceURLToSet = nil;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
if ( self.debugUserGeographyToSet )
|
|
274
|
+
{
|
|
275
|
+
settings.termsAndPrivacyPolicyFlowSettings.debugUserGeography = [self toAppLovinConsentFlowUserGeography: self.debugUserGeographyToSet];
|
|
276
|
+
self.debugUserGeographyToSet = nil;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
235
280
|
// Set test device ids if needed
|
|
236
281
|
if ( self.testDeviceIdentifiersToSet )
|
|
237
282
|
{
|
|
238
|
-
|
|
283
|
+
settings.testDeviceAdvertisingIdentifiers = self.testDeviceIdentifiersToSet;
|
|
239
284
|
self.testDeviceIdentifiersToSet = nil;
|
|
240
285
|
}
|
|
241
286
|
|
|
242
287
|
// Set verbose logging state if needed
|
|
243
288
|
if ( self.verboseLoggingToSet )
|
|
244
289
|
{
|
|
245
|
-
|
|
290
|
+
settings.verboseLoggingEnabled = self.verboseLoggingToSet.boolValue;
|
|
246
291
|
self.verboseLoggingToSet = nil;
|
|
247
292
|
}
|
|
248
293
|
|
|
249
294
|
// Set creative debugger enabled if needed.
|
|
250
295
|
if ( self.creativeDebuggerEnabledToSet )
|
|
251
296
|
{
|
|
252
|
-
|
|
297
|
+
settings.creativeDebuggerEnabled = self.creativeDebuggerEnabledToSet.boolValue;
|
|
253
298
|
self.creativeDebuggerEnabledToSet = nil;
|
|
254
299
|
}
|
|
255
300
|
|
|
256
301
|
// Set location collection enabled if needed
|
|
257
302
|
if ( self.locationCollectionEnabledToSet )
|
|
258
303
|
{
|
|
259
|
-
|
|
304
|
+
settings.locationCollectionEnabled = self.locationCollectionEnabledToSet.boolValue;
|
|
260
305
|
self.locationCollectionEnabledToSet = nil;
|
|
261
306
|
}
|
|
262
307
|
|
|
308
|
+
[self setPendingExtraParametersIfNeeded: settings];
|
|
309
|
+
|
|
310
|
+
// Initialize SDK
|
|
311
|
+
self.sdk = [ALSdk sharedWithKey: sdkKey settings: settings];
|
|
312
|
+
[self.sdk setPluginVersion: [@"React-Native-" stringByAppendingString: pluginVersion]];
|
|
313
|
+
[self.sdk setMediationProvider: ALMediationProviderMAX];
|
|
314
|
+
|
|
315
|
+
// Set user id if needed
|
|
316
|
+
if ( [self.userIdentifierToSet al_isValidString] )
|
|
317
|
+
{
|
|
318
|
+
self.sdk.userIdentifier = self.userIdentifierToSet;
|
|
319
|
+
self.userIdentifierToSet = nil;
|
|
320
|
+
}
|
|
321
|
+
|
|
263
322
|
if ( self.targetingYearOfBirthToSet )
|
|
264
323
|
{
|
|
265
324
|
self.sdk.targetingData.yearOfBirth = self.targetingYearOfBirthToSet.intValue <= 0 ? nil : self.targetingYearOfBirthToSet;
|
|
@@ -302,8 +361,6 @@ RCT_EXPORT_METHOD(initialize:(NSString *)pluginVersion :(NSString *)sdkKey :(RCT
|
|
|
302
361
|
self.targetingInterestsToSet = nil;
|
|
303
362
|
}
|
|
304
363
|
|
|
305
|
-
[self setPendingExtraParametersIfNeeded: self.sdk.settings];
|
|
306
|
-
|
|
307
364
|
[self.sdk initializeSdkWithCompletionHandler:^(ALSdkConfiguration *configuration) {
|
|
308
365
|
|
|
309
366
|
[self log: @"SDK initialized"];
|
|
@@ -311,7 +368,10 @@ RCT_EXPORT_METHOD(initialize:(NSString *)pluginVersion :(NSString *)sdkKey :(RCT
|
|
|
311
368
|
self.sdkConfiguration = configuration;
|
|
312
369
|
self.sdkInitialized = YES;
|
|
313
370
|
|
|
314
|
-
resolve(@{@"countryCode" : self.sdk.configuration.countryCode
|
|
371
|
+
resolve(@{@"countryCode" : self.sdk.configuration.countryCode,
|
|
372
|
+
@"appTrackingStatus" : [self fromAppLovinAppTrackingStatus: self.sdk.configuration.appTrackingTransparencyStatus],
|
|
373
|
+
@"consentFlowUserGeography" : [self fromAppLovinConsentFlowUserGeography: self.sdk.configuration.consentFlowUserGeography],
|
|
374
|
+
@"isTestModeEnabled" : @(self.sdk.configuration.isTestModeEnabled)});
|
|
315
375
|
}];
|
|
316
376
|
}
|
|
317
377
|
|
|
@@ -447,19 +507,38 @@ RCT_EXPORT_METHOD(setExtraParameter:(NSString *)key :(nullable NSString *)value)
|
|
|
447
507
|
}
|
|
448
508
|
}
|
|
449
509
|
|
|
510
|
+
RCT_EXPORT_METHOD(setInitializationAdUnitIds:(NSArray<NSString *> *)adUnitIds)
|
|
511
|
+
{
|
|
512
|
+
self.initializationAdUnitIdentifiersToSet = adUnitIds;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
#pragma mark - MAX Terms and Privacy Policy Flow
|
|
516
|
+
|
|
450
517
|
RCT_EXPORT_METHOD(setConsentFlowEnabled:(BOOL)enabled)
|
|
451
518
|
{
|
|
452
519
|
self.consentFlowEnabledToSet = @(enabled);
|
|
453
520
|
}
|
|
521
|
+
|
|
522
|
+
RCT_EXPORT_METHOD(setTermsAndPrivacyPolicyFlowEnabled:(BOOL)enabled)
|
|
523
|
+
{
|
|
524
|
+
self.termsAndPrivacyPolicyFlowEnabledToSet = @(enabled);
|
|
525
|
+
}
|
|
526
|
+
|
|
454
527
|
RCT_EXPORT_METHOD(setPrivacyPolicyUrl:(NSString *)urlString)
|
|
455
528
|
{
|
|
456
529
|
self.privacyPolicyURLToSet = [NSURL URLWithString: urlString];
|
|
457
530
|
}
|
|
531
|
+
|
|
458
532
|
RCT_EXPORT_METHOD(setTermsOfServiceUrl:(NSString *)urlString)
|
|
459
533
|
{
|
|
460
534
|
self.termsOfServiceURLToSet = [NSURL URLWithString: urlString];
|
|
461
535
|
}
|
|
462
536
|
|
|
537
|
+
RCT_EXPORT_METHOD(setConsentFlowDebugUserGeography:(NSString *)userGeography)
|
|
538
|
+
{
|
|
539
|
+
self.debugUserGeographyToSet = userGeography;
|
|
540
|
+
}
|
|
541
|
+
|
|
463
542
|
#pragma mark - Data Passing
|
|
464
543
|
|
|
465
544
|
RCT_EXPORT_METHOD(setTargetingDataYearOfBirth:(nonnull NSNumber *)yearOfBirth)
|
|
@@ -1971,6 +2050,56 @@ RCT_EXPORT_METHOD(setAppOpenAdLocalExtraParameter:(NSString *)adUnitIdentifier :
|
|
|
1971
2050
|
return ALAdContentRatingNone;
|
|
1972
2051
|
}
|
|
1973
2052
|
|
|
2053
|
+
- (ALConsentFlowUserGeography)toAppLovinConsentFlowUserGeography:(NSString *)userGeography
|
|
2054
|
+
{
|
|
2055
|
+
if ( [USER_GEOGRAPHY_GDPR al_isEqualToStringIgnoringCase: userGeography] )
|
|
2056
|
+
{
|
|
2057
|
+
return ALConsentFlowUserGeographyGDPR;
|
|
2058
|
+
}
|
|
2059
|
+
else if ( [USER_GEOGRAPHY_OTHER al_isEqualToStringIgnoringCase: userGeography] )
|
|
2060
|
+
{
|
|
2061
|
+
return ALConsentFlowUserGeographyOther;
|
|
2062
|
+
}
|
|
2063
|
+
|
|
2064
|
+
return ALConsentFlowUserGeographyUnknown;
|
|
2065
|
+
}
|
|
2066
|
+
|
|
2067
|
+
- (NSString *)fromAppLovinConsentFlowUserGeography:(ALConsentFlowUserGeography)userGeography
|
|
2068
|
+
{
|
|
2069
|
+
if ( ALConsentFlowUserGeographyGDPR == userGeography )
|
|
2070
|
+
{
|
|
2071
|
+
return USER_GEOGRAPHY_GDPR;
|
|
2072
|
+
}
|
|
2073
|
+
else if ( ALConsentFlowUserGeographyOther == userGeography )
|
|
2074
|
+
{
|
|
2075
|
+
return USER_GEOGRAPHY_OTHER;
|
|
2076
|
+
}
|
|
2077
|
+
|
|
2078
|
+
return USER_GEOGRAPHY_UNKNOWN;
|
|
2079
|
+
}
|
|
2080
|
+
|
|
2081
|
+
- (NSString *)fromAppLovinAppTrackingStatus:(ALAppTrackingTransparencyStatus)status
|
|
2082
|
+
{
|
|
2083
|
+
if ( ALAppTrackingTransparencyStatusNotDetermined == status )
|
|
2084
|
+
{
|
|
2085
|
+
return APP_TRACKING_STATUS_NOTDETERMINED;
|
|
2086
|
+
}
|
|
2087
|
+
else if ( ALAppTrackingTransparencyStatusRestricted == status )
|
|
2088
|
+
{
|
|
2089
|
+
return APP_TRACKING_STATUS_RESTRICTED;
|
|
2090
|
+
}
|
|
2091
|
+
else if ( ALAppTrackingTransparencyStatusDenied == status )
|
|
2092
|
+
{
|
|
2093
|
+
return APP_TRACKING_STATUS_DENIED;
|
|
2094
|
+
}
|
|
2095
|
+
else if ( ALAppTrackingTransparencyStatusAuthorized == status )
|
|
2096
|
+
{
|
|
2097
|
+
return APP_TRACKING_STATUS_AUTHORIZED;
|
|
2098
|
+
}
|
|
2099
|
+
|
|
2100
|
+
return APP_TRACKING_STATUS_UNAVAILABLE;
|
|
2101
|
+
}
|
|
2102
|
+
|
|
1974
2103
|
#pragma mark - Ad Info
|
|
1975
2104
|
|
|
1976
2105
|
- (NSDictionary<NSString *, id> *)adInfoForAd:(MAAd *)ad
|
package/ios/Podfile
CHANGED
|
@@ -35,6 +35,6 @@ target 'AppLovinMAX' do
|
|
|
35
35
|
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
|
|
36
36
|
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
|
|
37
37
|
|
|
38
|
-
pod 'AppLovinSDK', '
|
|
38
|
+
pod 'AppLovinSDK', '12.0.0'
|
|
39
39
|
|
|
40
40
|
end
|
package/ios/Podfile.lock
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
PODS:
|
|
2
|
-
- AppLovinSDK (
|
|
2
|
+
- AppLovinSDK (12.0.0)
|
|
3
3
|
- boost-for-react-native (1.63.0)
|
|
4
4
|
- DoubleConversion (1.1.6)
|
|
5
5
|
- FBLazyVector (0.63.5)
|
|
@@ -249,7 +249,7 @@ PODS:
|
|
|
249
249
|
- Yoga (1.14.0)
|
|
250
250
|
|
|
251
251
|
DEPENDENCIES:
|
|
252
|
-
- AppLovinSDK (=
|
|
252
|
+
- AppLovinSDK (= 12.0.0)
|
|
253
253
|
- DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
|
|
254
254
|
- FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
|
|
255
255
|
- FBReactNativeSpec (from `../node_modules/react-native/Libraries/FBReactNativeSpec`)
|
|
@@ -339,7 +339,7 @@ EXTERNAL SOURCES:
|
|
|
339
339
|
:path: "../node_modules/react-native/ReactCommon/yoga"
|
|
340
340
|
|
|
341
341
|
SPEC CHECKSUMS:
|
|
342
|
-
AppLovinSDK:
|
|
342
|
+
AppLovinSDK: 15679e9f576a4d8662e1dc537c9a4ed47d3292a5
|
|
343
343
|
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
|
|
344
344
|
DoubleConversion: cde416483dac037923206447da6e1454df403714
|
|
345
345
|
FBLazyVector: 352a8ca9bbc8e2f097d680747a8c97ecef12d469
|
|
@@ -368,6 +368,6 @@ SPEC CHECKSUMS:
|
|
|
368
368
|
ReactCommon: b9ff54b6dd22ba4a776eda22d7f83ec27544ca35
|
|
369
369
|
Yoga: 0276e9f20976c8568e107cfc1163a8629051adc0
|
|
370
370
|
|
|
371
|
-
PODFILE CHECKSUM:
|
|
371
|
+
PODFILE CHECKSUM: dc95f857ab3004d6fc04e845d974091e28859c7b
|
|
372
372
|
|
|
373
373
|
COCOAPODS: 1.11.3
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-applovin-max",
|
|
3
3
|
"author": "AppLovin Corporation",
|
|
4
|
-
"version": "6.0
|
|
4
|
+
"version": "6.1.0",
|
|
5
5
|
"description": "AppLovin MAX React Native Plugin for Android and iOS",
|
|
6
6
|
"homepage": "https://github.com/AppLovin/AppLovin-MAX-React-Native",
|
|
7
7
|
"license": "MIT",
|
|
@@ -25,6 +25,10 @@
|
|
|
25
25
|
"repository": "https://github.com/AppLovin/AppLovin-MAX-React-Native",
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/react-native": "^0.63.1",
|
|
28
|
+
"@typescript-eslint/eslint-plugin": "^6.11.0",
|
|
29
|
+
"@typescript-eslint/parser": "^6.11.0",
|
|
30
|
+
"eslint": "^8.53.0",
|
|
31
|
+
"eslint-plugin-react": "^7.33.2",
|
|
28
32
|
"react": "^16.13.1",
|
|
29
33
|
"react-native": "^0.63.1"
|
|
30
34
|
},
|
|
@@ -11,10 +11,10 @@ Pod::Spec.new do |s|
|
|
|
11
11
|
s.authors = package["author"]
|
|
12
12
|
|
|
13
13
|
s.platforms = { :ios => "10.0" }
|
|
14
|
-
s.source = { :git => "https://github.com/AppLovin/AppLovin-MAX-React-Native.git", :tag => "
|
|
14
|
+
s.source = { :git => "https://github.com/AppLovin/AppLovin-MAX-React-Native.git", :tag => "release_6_1_0" }
|
|
15
15
|
|
|
16
16
|
s.source_files = "ios/AppLovinMAX*.{h,m}"
|
|
17
17
|
|
|
18
18
|
s.dependency "React"
|
|
19
|
-
s.dependency "AppLovinSDK", "
|
|
19
|
+
s.dependency "AppLovinSDK", "12.0.0"
|
|
20
20
|
end
|