anagog_flutter 1.17.1 copy "anagog_flutter: ^1.17.1" to clipboard
anagog_flutter: ^1.17.1 copied to clipboard

Anagog SDK Flutter plugin. Use our Flutter plugin to integrate our SDK in your Flutter apps.

example/lib/main.dart

import 'package:anagog_flutter/anagog_flutter.dart';
import 'package:flutter/material.dart';

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String _sdkVersion = 'Unknown';

  @override
  void initState() {
    super.initState();
    AnagogFlutter.instance.getJedAIVersion().then((value) {
      //Get SDK Version
      setState(() {
        _sdkVersion = value;
      });
    });

    AnagogFlutter.instance.obtainEventStream().listen((event) {
      //Listen to SDK Events
      switch (event) {
        case ON_CAMPAIGN_TRIGGERED:
          {
            //Handle campaign triggered event
            break;
          }
        case ON_NOTIFICATION_CLICK:
          {
            //Handle notificaiton click
            break;
          }
        case ON_SNAPSHOT_REPORT:
          {
            //Handle snapshot report
            break;
          }
      }
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Anadod Flutter Plugin'),
        ),
        body: Center(
          child: Column(
            children: [
              Text('Anagog SDK Version: $_sdkVersion'),
              TextButton(
                onPressed: () => AnagogFlutter.instance
                    .syncCampaigns(), //Run SyncCampaign API
                child: Text("Download Campaigns"),
              )
            ],
          ),
        ),
      ),
    );
  }
}
3
likes
150
points
435
downloads

Publisher

verified publisheranagog.com

Weekly Downloads

Anagog SDK Flutter plugin. Use our Flutter plugin to integrate our SDK in your Flutter apps.

Homepage

Documentation

API reference

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on anagog_flutter