mobilepay_appswitch 0.9.0

  • Example
  • Installing
  • Versions
  • 65

Flutter plugin for MobilePay AppSwitch SDK

This is an unofficial Flutter plugin wrapping the MobilePay AppSwitch libraries for iOS and Android to enable Flutter apps to use the MobilePay AppSwitch SDK.

This plugin is not developed, published or otherwise affiliated with Danske Bank or MobilePay, but is a private project released "as-is" to the public by the author.


For iOS support add the following to your info.plist. Replace mobilepayappswitchexample with your own URL Scheme.



Some pararmeters are not supported like accepted url. But the essentials should work well.

And iOS is not supported... yet.

[0.9.0] - 6. september 2018

  • Support for iOS 9.0 and above

[0.8.1] - 30. august 2018

  • Fixed pubspec.yaml to allow higher Flutter versions

[0.8.0] - 28. august 2018

  • Added support for settings capture type

[0.0.2] - 24. august 2018

  • Fixed wrong return type in init.

[0.0.1] - 24. august 2018

  • Support on Android for essential SDK features.


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

void main() => runApp(new MyApp());

class MyApp extends StatefulWidget {
  _MyAppState createState() => new _MyAppState();

class _MyAppState extends State<MyApp> {
  initState() {

  initAppSwitch() async {
    await MobilepayAppswitch.init(
      merchantId: "APPDK0000000000", 
      country: Country.DENMARK,
      urlScheme: 'mobilepayappswitchexample');

  Widget build(BuildContext context) {
    return new MaterialApp(home: PaymentTest());

class PaymentTest extends StatelessWidget {
  makePayment(BuildContext context, double price) async {
    PaymentResponse paymentResponse =
        await MobilepayAppswitch.makePayment(orderId: "TESTINGS_ID", price: price);

    if (paymentResponse.success) {
          context: context,
          builder: (_) => AlertDialog(
                content: Text("yay"),
                title: Text("Payment successful"),
    } else {
          context: context,
          builder: (_) => AlertDialog(
                title: Text("Failed to complete payment"),
                content: Text("${paymentResponse.error.errorMessage}\nError code: ${paymentResponse.error.errorCode}"),

  Widget build(BuildContext context) {
    return Scaffold(
      appBar: new AppBar(
        title: new Text('Plugin example app'),
      body: new Center(
        child: RaisedButton(
            onPressed: () => makePayment(context, 10.0),
            child: Text("Make payment")),

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  mobilepay_appswitch: ^0.9.0

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:mobilepay_appswitch/mobilepay_appswitch.dart';
Version Uploaded Documentation Archive
0.9.0 Sep 6, 2018 Go to the documentation of mobilepay_appswitch 0.9.0 Download mobilepay_appswitch 0.9.0 archive
0.8.1 Aug 29, 2018 Go to the documentation of mobilepay_appswitch 0.8.1 Download mobilepay_appswitch 0.8.1 archive
0.8.0 Aug 28, 2018 Go to the documentation of mobilepay_appswitch 0.8.0 Download mobilepay_appswitch 0.8.0 archive
0.0.2 Aug 24, 2018 Go to the documentation of mobilepay_appswitch 0.0.2 Download mobilepay_appswitch 0.0.2 archive
0.0.1 Aug 24, 2018 Go to the documentation of mobilepay_appswitch 0.0.1 Download mobilepay_appswitch 0.0.1 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Oct 26, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0-dev.7.1.flutter-b99bcfd309
  • pana: 0.12.5
  • Flutter: 0.10.1


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Maintenance suggestions

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8