Offerwall SDK
1.0.10
1.0.10
  • 👋Welcome to PubScale Offerwall SDK
  • Basic Integration
    • Setting up your app
    • Android Integration
    • React Native
    • Unity
    • Web
    • iOS
    • API
  • 🦉Server-to-Server (S2S) Callback Configuration
  • Sandbox Environment
    • 🩺Sandbox Environment
  • 🔮Samples
  • FAQs
Powered by GitBook
On this page

Was this helpful?

  1. Flutter

Flutter integration

1. Add this to your pubspec.yaml file

Add the below line inside the dependencies block in your pubspec.yaml file

dependencies:
    flutter_custom_tabs: ^2.1.0

2. Rebuild the project

3. Launch the offerwall

Add the below code into the widget where you want to launch the offerwall from

void launchOfferwall(String appId, String userId, {String? gaID, String? idfa}) async {
  final uri = Uri.parse("https://wow.pubscale.com/").replace(queryParameters: {
    'app_id': appId,
    'user_id': userId,
    if (gaID != null && gaID.isNotEmpty) 'ga_id': gaID,
    if (idfa != null && idfa.isNotEmpty) 'idfa': idfa,
  });

  await launchUrlInCustomTabs(uri);
}

Future<void> launchUrlInCustomTabs(Uri uri) async {
  final theme = Theme.of(context);
  try {
    await launchUrl(
      uri,
      options: LaunchOptions(
        barColor: theme.colorScheme.surface,
        onBarColor: theme.colorScheme.onSurface,
        barFixingEnabled: false,
      ),
    );
  } catch (e) {
      // If the URL launch fails, an exception will be thrown. (For example, if no browser app is installed on the Android device.)
    debugPrint(e.toString());
  }
}

To launch the offerwall, simply call the launchOfferwall() method with the pubscale app id and your app's user id as the parameters.

launchOfferwall("OFFERWALL_APP_ID", "USER_ID");

Last updated 1 month ago

Was this helpful?

⬇️