β‘SDK Initialization
π§βπ» Integration Guide
1. Flutter Implementation
In your main.dart file:
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
static const platform = MethodChannel('com.example.offerwall_app');
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text('AdJump Example')),
body: Center(
child: ElevatedButton(
onPressed: () {
_launchOfferWall();
},
child: Text('Launch OfferWall'),
),
),
),
);
}
Future<void> _launchOfferWall() async {
try {
final Map<String, String> params = {
'accountId': 'YOUR_ACCOUNT_ID',
'appId': 'YOUR_APP_ID',
'userId': 'USER_ID',
};
await platform.invokeMethod('launchOfferWall', params);
} on PlatformException catch (e) {
print("Failed to show offer wall: '${e.message}'.");
}
}
}2. Android Implementation
In your MainActivity.kt:
π Configuration
Replace the placeholder values in your Flutter code with your actual Adjump credentials:
YOUR_ACCOUNT_ID: Your Adjump account identifierYOUR_APP_ID: Your application identifierUSER_ID: The user identifier for the current session
Make sure the method channel name matches in both Flutter and Android code:
π§ͺ Testing
Make sure you're running on a physical Android device or emulator with internet access
Log output and Toast messages will indicate:
SDK initialization status
Offerwall availability
Any errors that occur during the process
β FAQ
Q: Does it support iOS? A: No, this SDK currently supports Android only.
Q: Where do I get my accountId, appId, and userId?
A: These are provided by the Adjump platform once you're onboarded.
Q: What happens if the credentials are invalid? A: The SDK will show an error message through a Toast notification and log the error details.
Last updated