rapidoreach 1.0.9 copy "rapidoreach: ^1.0.9" to clipboard
rapidoreach: ^1.0.9 copied to clipboard

PlatformAndroidiOS
outdated

Monetize your users through rewarded surveys!

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:rapidoreach/RapidoReach.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    RapidoReach.instance
        .init(apiToken: 'e8ad9ecc9dd75f140cd662565da0954e', userId: '22992929');
    RapidoReach.instance.setOnRewardListener(onRapidoReachReward);
    RapidoReach.instance.setRewardCenterClosed(onRapidoReachRewardCenterClosed);
    RapidoReach.instance.setRewardCenterOpened(onRapidoReachRewardCenterOpened);
    RapidoReach.instance
        .setSurveyAvaiableListener(onRapidoReachSurveyAvailable);
    RapidoReach.instance.setNavBarText(text: 'RapidoReach');
    RapidoReach.instance.setNavBarColor(color: '#211548');
    RapidoReach.instance.setNavBarTextColor(textColor: '#FFFFFF');
    super.initState();
  }

  void onRapidoReachReward(int? quantity) {
    debugPrint('ROR: $quantity');
  }

  void onRapidoReachSurveyAvailable(int? survey) {
    debugPrint('ROR: $survey');
  }

  void onRapidoReachRewardCenterClosed() {
    debugPrint('ROR: closed');
  }

  void onRapidoReachRewardCenterOpened() {
    debugPrint('ROR: opened');
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
            child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            ElevatedButton(
              child: const Text("Launch RapidoReach"),
              onPressed: () => RapidoReach.instance.show(),
            ),
            ElevatedButton(
              child: const Text("Launch RapidoReach Placement"),
              onPressed: () => RapidoReach.instance.show(),
            )
          ],
        )),
      ),
    );
  }
}
5
likes
130
points
108
downloads

Publisher

verified publisherrapidoreach.com

Weekly Downloads

Monetize your users through rewarded surveys!

Homepage

Documentation

API reference

License

unknown (license)

Dependencies

flutter

More

Packages that depend on rapidoreach

Packages that implement rapidoreach