A Flutter plugin to integrate Pubscale Offerwall SDK into your Android and iOS apps. This plugin enables in-app monetization through offerwalls—allowing users to earn rewards by completing offers.
Add the plugin to your pubspec.yaml:
dependencies:
pubscale_offerwall_plugin: ^0.0.4Then run:
flutter pub get-
Min SDK Version
EnsureminSdkVersionis set to 21 or higher inandroid/app/build.gradle. -
Permissions
Add internet permission inAndroidManifest.xml:<uses-permission android:name="android.permission.INTERNET"/>
-
Deployment Target
Set the platform version to at least 11.0 inios/Podfile. -
IDFA Permission (Optional)
Add toInfo.plist:<key>NSUserTrackingUsageDescription</key> <string>This identifier will be used to personalize offers.</string>
-
Run:
cd ios pod install
import 'package:pubscale_offerwall_plugin/pubscale_offerwall_plugin.dart';final plugin = PubscaleOfferwallPlugin();
plugin.initializeOfferwall(
'YOUR_APP_ID', // from Pubscale dashboard
'UNIQUE_USER_ID', // user identifier
sandbox: false, // true for testing
fullscreen: false, // true for full-screen mode
);plugin.offerwallEvents.listen((event) {
switch (event['event']) {
case 'offerwall_init_success':
print('Initialized');
break;
case 'offerwall_reward':
print('Reward: ${event['amount']} ${event['currency']}');
break;
case 'offerwall_launch_failed':
print('Launch failed: ${event['error']}');
break;
}
});plugin.launchOfferwall();| Event | Description |
|---|---|
offerwall_init_success |
Initialization succeeded |
offerwall_init_failed |
Initialization failed (with error) |
offerwall_showed |
Offerwall launched successfully |
offerwall_closed |
User closed the offerwall |
offerwall_reward |
User earned a reward (amount, currency, token) |
offerwall_launch_failed |
Launch failed (with error) |
You can find a working demo under the example/ directory. Run it with:
flutter runPubscale provides monetization solutions via SDKs and APIs to boost app revenues through gamified experiences. Visit pubscale.com for more info.
MIT