Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Third party custom adapter big bug!! #759

Open
v5huang opened this issue Dec 13, 2024 · 5 comments
Open

Third party custom adapter big bug!! #759

v5huang opened this issue Dec 13, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@v5huang
Copy link

v5huang commented Dec 13, 2024

MAX SDK Version

12.4.0+

Device/Platform Info

all android device

Current Behavior

Call "setMediationProvider(AppLovinMediationProvider.MAX)" when init sdk, third party custom adapter cannot get the custom parameters, parameters.getCustomParameters() is null

Expected Behavior

Call "setMediationProvider(AppLovinMediationProvider.MAX)" when init sdk, third party custom adapter cannot get the custom parameters, parameters.getCustomParameters() is null

How to Reproduce

Call "setMediationProvider(AppLovinMediationProvider.MAX)" when init sdk, third party custom adapter cannot get the custom parameters, parameters.getCustomParameters() is null

Reproducible in the demo app?

Yes

Additional Info

No response

@v5huang v5huang added the bug Something isn't working label Dec 13, 2024
@applovinAsh
Copy link
Contributor

@v5huang - can you confirm that you have set the custom parameters in the ad unit? Can you provide the ad unit ID and/or the AppLovin account email?

@applovinAsh applovinAsh self-assigned this Dec 13, 2024
@v5huang
Copy link
Author

v5huang commented Dec 16, 2024

1: Initialize the max sdk
AppLovinSdkInitializationConfiguration initConfig = AppLovinSdkInitializationConfiguration.builder
(AdConfig.MAX_APP_KEY, this.getApplicationContext() )
.setMediationProvider(AppLovinMediationProvider.MAX)
.build();

// Initialize the AppLovin SDK
AppLovinSdk.getInstance( this ).initialize(initConfig, configuration -> {
Log.i(TAG, "AppLovinSdk-init:" );
} );
2: When configuring AD slots, json parameters are added to custom params

3: In the custom adapter, in the initialize method, the parameter value is not retrieved via getCustomParameters()
Bundle bundle = parameters.getCustomParameters();
String sid = bundle.getString("sid");
String token = bundle.getString("token");
String debug = bundle.getString("isdebug");

The sid,token, and debug values are all null

1: When configuring AD slots, json parameters are added to custom params
(https://github.com/user-attachments/assets/b648f045-c4f2-47ef-9f05-e04c8519d3ca)

2: max sdk init
private void initSdk() {
// Max 13版本及以上
AppLovinSdkInitializationConfiguration initConfig = AppLovinSdkInitializationConfiguration.builder
(AdConfig.MAX_APP_KEY, this.getApplicationContext() )
.setMediationProvider(AppLovinMediationProvider.MAX)
.build();

// Initialize the AppLovin SDK
AppLovinSdk.getInstance( this ).initialize(initConfig, configuration -> {
    Log.i(TAG, "AppLovinSdk-init:" );
} );

}
3: In the custom adapter
@OverRide
public void initialize(MaxAdapterInitializationParameters parameters, Activity activity, final OnCompletionListener onCompletionListener) {
Log.d(TAG, "initialize alx sdk……");
Log.d(TAG, "applovin-adapter-version:" + ADAPTER_VERSION);

Bundle bundle = parameters.getCustomParameters();
String sid = bundle.getString("sid");
String token = bundle.getString("token");
String debug = bundle.getString("isdebug");

}

@v5huang
Copy link
Author

v5huang commented Dec 16, 2024

//Max
public static final String MAX_APP_KEY = "****";
public static final String MAX_BANNER_AD = "d784fd2128f4d859";
public static final String MAX_INTERSTITIAL_AD = "8309f13fe976b315";
public static final String MAX_REWARD_VIDEO_AD = "03cae3773972a7ee";
public static final String MAX_NATIVE_AD = "2ad8ef4685641135";

@v5huang
Copy link
Author

v5huang commented Dec 16, 2024

big bug

@jplianghu
Copy link
Contributor

@v5huang
It looks like you have a boolean parameter "isdebug": true configured in your custom parameters, but in your app, you use bundle.getString("isdebug"); to retrieve the boolean value, which might cause an exception.

Could you please fix this (for example, call bundle.getBoolean( "isdebug")) and try again? If you still encounter errors, please share the verbose log with us so I can help you investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants