dcoupon_sdk_flutter_package 4.5.0 copy "dcoupon_sdk_flutter_package: ^4.5.0" to clipboard
dcoupon_sdk_flutter_package: ^4.5.0 copied to clipboard

outdated

dcoupon sdk flutter plugin project. Support flutter (Android/iOS) applications to integrate dcoupon web services for flutter projects.

dcoupon_sdk_flutter_package #

A Flutter package for dcoupon SDK. dcoupon SDK allows our clients to log in their users into the dcoupon service, so users can benefit from accessing dcoupon service from 3rd party apps, without needing to use an additional login for dcoupon.

Usage #

To use this plugin, add dcoupon_sdk_flutter_package as a dependency in your pubspec.yaml file.

MUST DO: Set up dcoupon SDK #

To start using dcoupon SDK methods, you need to provide contents of a json file to the SDK.

  1. Add a json file to your app with the following:
{
  "com.dcoupon.sdk.ClientToken": "<YOUR_CLIENT_TOKEN_HERE>",
  "com.dcoupon.sdk.ClientSecretKey": "<YOUR_CLIENT_SECRET_KEY_HERE>",
  "com.dcoupon.sdk.ClientCountry": "<YOUR_CLIENT_COUNTRY_2_LETTER_CODE_HERE>",
  "com.dcoupon.sdk.ClientDomain": "<YOUR_CLIENT_DOMAIN_HERE>",
}
  1. Read the json
var jsonContents = await rootBundle.loadString("lib/assets/config/your_json_name.json");
  1. Configure the SDK with the json contents
final dcoupon = Dcoupon(context: context);
//---OR---
final dcoupon = Dcoupon()
dcoupon.setContext(context) //Can assign context later

await dcoupon.loadConfig(jsonContents);

Example #

Future<void> login() async {
    // do login
    dcoupon
        .login(
      externalId,
      email: email, //optional
      referralCode: referralCode, //optional
    )
        .then((response) async {
      //User authenticated in dcoupon, you can call other methods
      DcouponListener response = await dcoupon.getCoupons(
                offset: int.parse(start),
                limit: int.parse(limit),
                sortBy: sortBy,
                companyTokens: companyTokens,
                retailerTokens: retailerTokens,
            )

    }).catchError((ex) {
      print("example.app.login.catchError: " + ex.toString());
    });
  }

API reference #

You can check the API reference in this page or go to dcoupon SDK API reference

1
likes
0
pub points
15%
popularity

Publisher

verified publisherdcoupon.com

dcoupon sdk flutter plugin project. Support flutter (Android/iOS) applications to integrate dcoupon web services for flutter projects.

Homepage

License

unknown (LICENSE)

Dependencies

collection, crypto, cupertino_icons, dartz, dio, equatable, flutter, flutter_html, flutter_localizations, get_it, google_fonts, html_unescape, intl, ntp, webview_flutter

More

Packages that depend on dcoupon_sdk_flutter_package