ovatu / zettle_flutter

A Flutter wrapper to use the Zettle SDK. With this plugin, your app can easily and accept card payments on Android and iOS using Zettle account / readers.
MIT License
2 stars 9 forks source link

Issue when I call init function in iOS #1

Closed mahmoudalaa97 closed 2 years ago

mahmoudalaa97 commented 2 years ago

i was using the Zettle SDK and I configure the init like documentation but when I call the Zettle.init() it's not work

class ZettleService extends GetxService implements BaseTerminal {
 @override
  Future<void> init(
      { TerminalService? terminalService}) async {
    // TODO: implement init
    try {
      await Zettle.init("i was use clientID", "",
          "OAuth Redirect URL here  ");
    } catch (ex) {
      print(ex.toString());
    }
  }
}

the console output: flutter: Exception: Zettle SDK is not initialized. You should call Zettle.init(iosClientId, androidClientId, redirectUrl)

Flutter doctor:

[✓] Flutter (Channel stable, 2.10.1, on macOS 12.4 21F79 darwin-x64, locale en-EG)
    • Flutter version 2.10.1 at /Users/java/Documents/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision db747aa133 (4 months ago), 2022-02-09 13:57:35 -0600
    • Engine revision ab46186b24
    • Dart version 2.16.1
    • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/java/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_HOME = /Users/java/Library/Android/sdk
    • ANDROID_SDK_ROOT = :/Users/java/Android/sdk:/Users/java/Android/sdk
    • Java binary at: /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java
    • Java version Java(TM) SE Runtime Environment (build 1.8.0_301-b09)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)

[✓] IntelliJ IDEA Community Edition (version 2021.1.3)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 66.0.3
    • Dart plugin version 213.7306

[✓] VS Code (version 1.67.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.40.0

[✓] Connected device (3 available)
    • Rami Selim’s iPad (mobile)   • f43eab918b6b7c83e8df813f97ef4ead55912b7e • ios            • iOS 15.3.1 19D52
    • iPad Pro (9.7-inch) (mobile) • 3CD7E55E-01B4-4338-B60B-8411142D72D6     • ios            • com.apple.CoreSimulator.SimRuntime.iOS-15-4 (simulator)
    • Chrome (web)                 • chrome                                   • web-javascript • Google Chrome 102.0.5005.61
    ! Error: Rami Selim’s iPad is busy: Fetching debug symbols for Rami Selim’s iPad. Xcode will continue when Rami Selim’s iPad is finished. (code -10)

[✓] HTTP Host Availability
    • All required HTTP hosts are available
mahmoudalaa97 commented 2 years ago

This issue is fixed by calling the init only one time ✅, I was called the init two times so because this is crashed to me ⚠️

Thank you 🙏