├── .pubignore ├── ios ├── Assets │ └── .gitkeep ├── Classes │ ├── OtplessFlutterPlugin.h │ ├── OtplessFlutterPlugin.m │ ├── Strings.swift │ ├── WhatsAppHandler.swift │ └── SwiftOtplessFlutterPlugin.swift ├── .gitignore └── otpless_flutter.podspec ├── android ├── settings.gradle ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ └── kotlin │ │ └── com │ │ └── otpless │ │ └── otplessflutter │ │ ├── utility.kt │ │ └── OtplessFlutterPlugin.kt ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitignore ├── build.gradle ├── gradlew.bat └── gradlew ├── example ├── ios │ ├── Runner │ │ ├── Runner-Bridging-Header.h │ │ ├── Assets.xcassets │ │ │ ├── LaunchImage.imageset │ │ │ │ ├── LaunchImage.png │ │ │ │ ├── LaunchImage@2x.png │ │ │ │ ├── LaunchImage@3x.png │ │ │ │ ├── README.md │ │ │ │ └── Contents.json │ │ │ └── AppIcon.appiconset │ │ │ │ ├── Icon-App-20x20@1x.png │ │ │ │ ├── Icon-App-20x20@2x.png │ │ │ │ ├── Icon-App-20x20@3x.png │ │ │ │ ├── Icon-App-29x29@1x.png │ │ │ │ ├── Icon-App-29x29@2x.png │ │ │ │ ├── Icon-App-29x29@3x.png │ │ │ │ ├── Icon-App-40x40@1x.png │ │ │ │ ├── Icon-App-40x40@2x.png │ │ │ │ ├── Icon-App-40x40@3x.png │ │ │ │ ├── Icon-App-60x60@2x.png │ │ │ │ ├── Icon-App-60x60@3x.png │ │ │ │ ├── Icon-App-76x76@1x.png │ │ │ │ ├── Icon-App-76x76@2x.png │ │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ │ ├── Icon-App-83.5x83.5@2x.png │ │ │ │ └── Contents.json │ │ ├── Runner.entitlements │ │ ├── AppDelegate.swift │ │ ├── Base.lproj │ │ │ ├── Main.storyboard │ │ │ └── LaunchScreen.storyboard │ │ └── Info.plist │ ├── Flutter │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ └── AppFrameworkInfo.plist │ ├── Runner.xcodeproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ │ └── IDEWorkspaceChecks.plist │ │ ├── xcshareddata │ │ │ └── xcschemes │ │ │ │ ├── Runner.xcscheme │ │ │ │ └── ReleaseScheme.xcscheme │ │ └── project.pbxproj │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ └── IDEWorkspaceChecks.plist │ ├── .gitignore │ ├── Podfile.lock │ └── Podfile ├── android │ ├── app │ │ ├── src │ │ │ ├── main │ │ │ │ ├── res │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── drawable │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ ├── drawable-v21 │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ ├── values │ │ │ │ │ │ └── styles.xml │ │ │ │ │ └── values-night │ │ │ │ │ │ └── styles.xml │ │ │ │ ├── kotlin │ │ │ │ │ └── com │ │ │ │ │ │ └── example │ │ │ │ │ │ └── otpless_flutter_example │ │ │ │ │ │ └── MainActivity.kt │ │ │ │ └── AndroidManifest.xml │ │ │ ├── debug │ │ │ │ └── AndroidManifest.xml │ │ │ └── profile │ │ │ │ └── AndroidManifest.xml │ │ └── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ ├── .gitignore │ ├── settings.gradle │ └── build.gradle ├── README.md ├── .gitignore ├── test │ └── widget_test.dart ├── analysis_options.yaml ├── pubspec.yaml ├── pubspec.lock └── lib │ └── main.dart ├── doc ├── 1.png ├── 2.png ├── iosp1.png ├── iosp2.png ├── androidp.png ├── iosp11.png ├── iosp22.png └── infoplist.png ├── analysis_options.yaml ├── README.md ├── .gitignore ├── test ├── otpless_flutter_method_channel_test.dart └── otpless_flutter_test.dart ├── lib ├── otpless_flutter_platform_interface.dart ├── otpless_flutter.dart └── otpless_flutter_method_channel.dart ├── .metadata ├── CHANGELOG.md ├── pubspec.yaml └── LICENSE /.pubignore: -------------------------------------------------------------------------------- 1 | docs 2 | doc -------------------------------------------------------------------------------- /ios/Assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'otpless_flutter' 2 | -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /doc/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otpless-tech/otpless-flutter-plugin/HEAD/doc/1.png -------------------------------------------------------------------------------- /doc/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otpless-tech/otpless-flutter-plugin/HEAD/doc/2.png -------------------------------------------------------------------------------- /doc/iosp1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otpless-tech/otpless-flutter-plugin/HEAD/doc/iosp1.png -------------------------------------------------------------------------------- /doc/iosp2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otpless-tech/otpless-flutter-plugin/HEAD/doc/iosp2.png -------------------------------------------------------------------------------- /doc/androidp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otpless-tech/otpless-flutter-plugin/HEAD/doc/androidp.png -------------------------------------------------------------------------------- /doc/iosp11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otpless-tech/otpless-flutter-plugin/HEAD/doc/iosp11.png -------------------------------------------------------------------------------- /doc/iosp22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otpless-tech/otpless-flutter-plugin/HEAD/doc/iosp22.png -------------------------------------------------------------------------------- /doc/infoplist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otpless-tech/otpless-flutter-plugin/HEAD/doc/infoplist.png -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /ios/Classes/OtplessFlutterPlugin.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface OtplessFlutterPlugin : NSObject 4 | @end 5 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otpless-tech/otpless-flutter-plugin/HEAD/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .cxx 10 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | # Additional information about this file can be found at 4 | # https://dart.dev/guides/language/analysis-options 5 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otpless-tech/otpless-flutter-plugin/HEAD/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otpless-tech/otpless-flutter-plugin/HEAD/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otpless-tech/otpless-flutter-plugin/HEAD/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otpless-tech/otpless-flutter-plugin/HEAD/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otpless-tech/otpless-flutter-plugin/HEAD/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otpless-tech/otpless-flutter-plugin/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otpless-tech/otpless-flutter-plugin/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otpless-tech/otpless-flutter-plugin/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otpless-tech/otpless-flutter-plugin/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otpless-tech/otpless-flutter-plugin/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otpless-tech/otpless-flutter-plugin/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otpless-tech/otpless-flutter-plugin/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otpless-tech/otpless-flutter-plugin/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otpless-tech/otpless-flutter-plugin/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otpless-tech/otpless-flutter-plugin/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otpless-tech/otpless-flutter-plugin/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otpless-tech/otpless-flutter-plugin/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otpless-tech/otpless-flutter-plugin/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otpless-tech/otpless-flutter-plugin/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otpless-tech/otpless-flutter-plugin/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otpless-tech/otpless-flutter-plugin/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otpless-tech/otpless-flutter-plugin/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/otpless-tech/otpless-flutter-plugin/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | android.defaults.buildfeatures.buildconfig=true 5 | android.nonTransitiveRClass=false 6 | android.nonFinalResIds=false 7 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip 7 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /example/ios/Runner/Runner.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.developer.associated-domains 6 | 7 | webcredentials:otpless.com 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 |

3 | 4 |

5 | 6 | # OTPLESS Flutter SDK 7 | [![pub package](https://img.shields.io/pub/v/otpless_flutter.svg)](https://pub.dartlang.org/packages/otpless_flutter) 8 | 9 | 10 | ## Installation 11 | 12 | You can checkout the complete [installation guide here](https://otpless.com/platforms/flutter) 13 | 14 | ## Author 15 | 16 | [OTPLESS](https://otpless.com), developer@otpless.com 17 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /android/src/main/kotlin/com/otpless/otplessflutter/utility.kt: -------------------------------------------------------------------------------- 1 | package com.otpless.otplessflutter 2 | 3 | import com.otpless.dto.HeadlessResponse 4 | import org.json.JSONObject 5 | 6 | internal fun convertHeadlessResponseToJson(headlessResponse: HeadlessResponse): JSONObject { 7 | val jsonObject = JSONObject() 8 | jsonObject.put("responseType", headlessResponse.responseType) 9 | jsonObject.put("statusCode", headlessResponse.statusCode) 10 | jsonObject.put("response", headlessResponse.response) 11 | return jsonObject 12 | } -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/Generated.xcconfig 37 | /Flutter/ephemeral/ 38 | /Flutter/flutter_export_environment.sh -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # otpless_flutter_example 2 | 3 | Demonstrates how to use the otpless_flutter plugin. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) 13 | 14 | For help getting started with Flutter development, view the 15 | [online documentation](https://docs.flutter.dev/), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. 26 | /pubspec.lock 27 | **/doc/api/ 28 | .dart_tool/ 29 | .packages 30 | build/ 31 | -------------------------------------------------------------------------------- /ios/Classes/OtplessFlutterPlugin.m: -------------------------------------------------------------------------------- 1 | #import "OtplessFlutterPlugin.h" 2 | #if __has_include() 3 | #import 4 | #else 5 | // Support project import fallback if the generated compatibility header 6 | // is not copied when this plugin is created as a library. 7 | // https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816 8 | #import "otpless_flutter-Swift.h" 9 | #endif 10 | 11 | @implementation OtplessFlutterPlugin 12 | + (void)registerWithRegistrar:(NSObject*)registrar { 13 | [SwiftOtplessFlutterPlugin registerWithRegistrar:registrar]; 14 | } 15 | @end 16 | -------------------------------------------------------------------------------- /ios/Classes/Strings.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Strings.swift 3 | // otpless_flutter 4 | // 5 | // Created by Solai Raj on 08/10/22. 6 | // 7 | 8 | import Foundation 9 | import UIKit 10 | 11 | 12 | struct StringValues { 13 | static let WHATSAPP_LINK_CREATE_ERROR = "Unable to create WhatsApp Data Link" 14 | static let WHATSAPP_NOT_FOUND = "Unable to open WhatsApp" 15 | static let WHATSAPP_URL_NOT_FOUND = "WhatsApp URL not found" 16 | static let WHATSAPP_URL_FOUND = "Valid URL Scheme" 17 | static let URL_TOKEN = "token" 18 | static let URL_TOKEN_FOUND = "Deeplink token found" 19 | static let URL_TOKEN_NOT_FOUND = "Deeplink token not found" 20 | static let INVALID_URL = "Invalid url" 21 | 22 | } 23 | -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /example/android/app/src/main/kotlin/com/example/otpless_flutter_example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.otpless_flutter_example 2 | 3 | import android.os.Bundle 4 | import com.otpless.otplessflutter.OtplessFlutterPlugin 5 | import io.flutter.embedding.android.FlutterActivity 6 | 7 | class MainActivity: FlutterActivity() { 8 | 9 | override fun onCreate(savedInstanceState: Bundle?) { 10 | super.onCreate(savedInstanceState) 11 | } 12 | 13 | override fun onBackPressed() { 14 | val plugin = flutterEngine?.plugins?.get(OtplessFlutterPlugin::class.java) 15 | if (plugin is OtplessFlutterPlugin) { 16 | if (plugin.onBackPressed()) return 17 | } 18 | super.onBackPressed() 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /test/otpless_flutter_method_channel_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/services.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:otpless_flutter/otpless_flutter_method_channel.dart'; 4 | 5 | void main() { 6 | MethodChannelOtplessFlutter platform = MethodChannelOtplessFlutter(); 7 | const MethodChannel channel = MethodChannel('otpless_flutter'); 8 | 9 | TestWidgetsFlutterBinding.ensureInitialized(); 10 | 11 | setUp(() { 12 | channel.setMockMethodCallHandler((MethodCall methodCall) async { 13 | return '42'; 14 | }); 15 | }); 16 | 17 | tearDown(() { 18 | channel.setMockMethodCallHandler(null); 19 | }); 20 | 21 | test('getPlatformVersion', () async { 22 | expect(await platform.getPlatformVersion(), '42'); 23 | }); 24 | } 25 | -------------------------------------------------------------------------------- /example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flutter (1.0.0) 3 | - otpless_flutter (0.0.4): 4 | - Flutter 5 | - OtplessSDK/Core (= 2.2.8) 6 | - OtplessSDK/Core (2.2.8) 7 | 8 | DEPENDENCIES: 9 | - Flutter (from `Flutter`) 10 | - otpless_flutter (from `.symlinks/plugins/otpless_flutter/ios`) 11 | 12 | SPEC REPOS: 13 | trunk: 14 | - OtplessSDK 15 | 16 | EXTERNAL SOURCES: 17 | Flutter: 18 | :path: Flutter 19 | otpless_flutter: 20 | :path: ".symlinks/plugins/otpless_flutter/ios" 21 | 22 | SPEC CHECKSUMS: 23 | Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 24 | otpless_flutter: 558d03da0f3bc5e765278ed8b7207fcbb82f36f6 25 | OtplessSDK: 4012206d070936bf4ae917025511e70eea5234a5 26 | 27 | PODFILE CHECKSUM: c4c93c5f6502fe2754f48404d3594bf779584011 28 | 29 | COCOAPODS: 1.14.3 30 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | import OtplessSDK 4 | 5 | @UIApplicationMain 6 | @objc class AppDelegate: FlutterAppDelegate { 7 | override func application( 8 | _ application: UIApplication, 9 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 10 | ) -> Bool { 11 | GeneratedPluginRegistrant.register(with: self) 12 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 13 | } 14 | 15 | override func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { 16 | super.application(app, open: url, options: options) 17 | if Otpless.sharedInstance.isOtplessDeeplink(url: url){ Otpless.sharedInstance.processOtplessDeeplink(url: url) } 18 | return true 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 12.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | **/doc/api/ 26 | **/ios/Flutter/.last_build_id 27 | .dart_tool/ 28 | .flutter-plugins 29 | .flutter-plugins-dependencies 30 | .packages 31 | .pub-cache/ 32 | .pub/ 33 | /build/ 34 | 35 | # Web related 36 | lib/generated_plugin_registrant.dart 37 | 38 | # Symbolication related 39 | app.*.symbols 40 | 41 | # Obfuscation related 42 | app.*.map.json 43 | 44 | # Android Studio will place build artifacts here 45 | /android/app/debug 46 | /android/app/profile 47 | /android/app/release 48 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.8.0' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:8.3.1' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 18 | maven { 19 | url 'https://maven.fpregistry.io/releases' 20 | } 21 | maven { 22 | url 'https://jitpack.io' 23 | } 24 | maven { 25 | url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' 26 | } 27 | } 28 | } 29 | 30 | rootProject.buildDir = '../build' 31 | subprojects { 32 | project.buildDir = "${rootProject.buildDir}/${project.name}" 33 | } 34 | subprojects { 35 | project.evaluationDependsOn(':app') 36 | } 37 | 38 | tasks.register("clean", Delete) { 39 | delete rootProject.buildDir 40 | } 41 | -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility in the flutter_test package. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:otpless_flutter_example/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Verify Platform version', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(const MyApp()); 17 | 18 | // Verify that platform version is retrieved. 19 | expect( 20 | find.byWidgetPredicate( 21 | (Widget widget) => widget is Text && 22 | widget.data!.startsWith('Running on:'), 23 | ), 24 | findsOneWidget, 25 | ); 26 | }); 27 | } 28 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /lib/otpless_flutter_platform_interface.dart: -------------------------------------------------------------------------------- 1 | import 'package:plugin_platform_interface/plugin_platform_interface.dart'; 2 | 3 | import 'otpless_flutter_method_channel.dart'; 4 | 5 | abstract class OtplessFlutterPlatform extends PlatformInterface { 6 | /// Constructs a OtplessFlutterPlatform. 7 | OtplessFlutterPlatform() : super(token: _token); 8 | 9 | static final Object _token = Object(); 10 | 11 | static OtplessFlutterPlatform _instance = MethodChannelOtplessFlutter(); 12 | 13 | /// The default instance of [OtplessFlutterPlatform] to use. 14 | /// 15 | /// Defaults to [MethodChannelOtplessFlutter]. 16 | static OtplessFlutterPlatform get instance => _instance; 17 | 18 | /// Platform-specific implementations should set this with their own 19 | /// platform-specific class that extends [OtplessFlutterPlatform] when 20 | /// they register themselves. 21 | static set instance(OtplessFlutterPlatform instance) { 22 | PlatformInterface.verifyToken(instance, _token); 23 | _instance = instance; 24 | } 25 | 26 | Future getPlatformVersion() { 27 | throw UnimplementedError('platformVersion() has not been implemented.'); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /test/otpless_flutter_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | import 'package:otpless_flutter/otpless_flutter.dart'; 3 | import 'package:otpless_flutter/otpless_flutter_platform_interface.dart'; 4 | import 'package:otpless_flutter/otpless_flutter_method_channel.dart'; 5 | import 'package:plugin_platform_interface/plugin_platform_interface.dart'; 6 | 7 | class MockOtplessFlutterPlatform 8 | with MockPlatformInterfaceMixin 9 | implements OtplessFlutterPlatform { 10 | 11 | @override 12 | Future getPlatformVersion() => Future.value('42'); 13 | } 14 | 15 | void main() { 16 | final OtplessFlutterPlatform initialPlatform = OtplessFlutterPlatform.instance; 17 | 18 | test('$MethodChannelOtplessFlutter is the default instance', () { 19 | expect(initialPlatform, isInstanceOf()); 20 | }); 21 | 22 | test('getPlatformVersion', () async { 23 | Otpless otplessFlutterPlugin = Otpless(); 24 | MockOtplessFlutterPlatform fakePlatform = MockOtplessFlutterPlatform(); 25 | OtplessFlutterPlatform.instance = fakePlatform; 26 | 27 | expect(await otplessFlutterPlugin.getPlatformVersion(), '42'); 28 | }); 29 | } 30 | -------------------------------------------------------------------------------- /ios/otpless_flutter.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. 3 | # Run `pod lib lint otpless_flutter.podspec` to validate before publishing. 4 | # 5 | Pod::Spec.new do |s| 6 | s.name = 'otpless_flutter' 7 | s.version = '0.0.4' 8 | s.summary = 'Sign-up/ Sign-in via Whatsapp engineered by Otpless.' 9 | s.description = <<-DESC 10 | 'Sign-up/ Sign-in via Whatsapp engineered by Otpless. Get your user authentication sorted in just five minutes by integrating of Otpless sdk.' 11 | DESC 12 | s.homepage = 'https://github.com/otpless-tech/Otpless-iOS-SDK' 13 | s.license = { :file => '../LICENSE' } 14 | s.author = { 'Otpless' => 'developer@otpless.com' } 15 | s.source = { :git => 'https://github.com/otpless-tech/Otpless-iOS-SDK.git', :tag => s.version.to_s } 16 | s.source_files = 'Classes/**/*' 17 | s.dependency 'Flutter' 18 | s.dependency 'OtplessSDK/Core', '2.2.8' 19 | s.ios.deployment_target = '13.0' 20 | s.resources = ["OtplessSDK/Assets/*.png"] 21 | 22 | s.swift_versions = ['4.0', '4.1', '4.2', '5.0', '5.1', '5.2', '5.3', '5.4', '5.5'] 23 | end 24 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled. 5 | 6 | version: 7 | revision: 85684f9300908116a78138ea4c6036c35c9a1236 8 | channel: stable 9 | 10 | project_type: plugin 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: 85684f9300908116a78138ea4c6036c35c9a1236 17 | base_revision: 85684f9300908116a78138ea4c6036c35c9a1236 18 | - platform: android 19 | create_revision: 85684f9300908116a78138ea4c6036c35c9a1236 20 | base_revision: 85684f9300908116a78138ea4c6036c35c9a1236 21 | - platform: ios 22 | create_revision: 85684f9300908116a78138ea4c6036c35c9a1236 23 | base_revision: 85684f9300908116a78138ea4c6036c35c9a1236 24 | 25 | # User provided section 26 | 27 | # List of Local paths (relative to this file) that should be 28 | # ignored by the migrate tool. 29 | # 30 | # Files that are not part of the templates will be ignored by default. 31 | unmanaged_files: 32 | - 'lib/main.dart' 33 | - 'ios/Runner.xcodeproj/project.pbxproj' 34 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | group 'com.example.otpless_flutter' 2 | version '1.0-SNAPSHOT' 3 | 4 | buildscript { 5 | ext.kotlin_version = '1.6.10' 6 | repositories { 7 | google() 8 | mavenCentral() 9 | } 10 | 11 | dependencies { 12 | classpath 'com.android.tools.build:gradle:8.2.0' 13 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 14 | } 15 | } 16 | 17 | rootProject.allprojects { 18 | repositories { 19 | google() 20 | mavenCentral() 21 | } 22 | } 23 | 24 | apply plugin: 'com.android.library' 25 | apply plugin: 'kotlin-android' 26 | 27 | android { 28 | compileSdkVersion 34 29 | namespace("com.otpless.otplessflutter") 30 | defaultConfig { 31 | minSdkVersion 21 32 | } 33 | 34 | compileOptions { 35 | sourceCompatibility JavaVersion.VERSION_1_8 36 | targetCompatibility JavaVersion.VERSION_1_8 37 | } 38 | 39 | kotlinOptions { 40 | jvmTarget = '1.8' 41 | } 42 | 43 | sourceSets { 44 | main.java.srcDirs += 'src/main/kotlin' 45 | } 46 | } 47 | 48 | dependencies { 49 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 50 | implementation 'io.github.otpless-tech:otpless-android-sdk:2.6.5' 51 | } 52 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '12.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | end 36 | 37 | post_install do |installer| 38 | installer.pods_project.targets.each do |target| 39 | flutter_additional_ios_build_settings(target) 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /example/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.0.1 2 | 3 | * Supporting iOS + Android whatsapp login 4 | 5 | ## 1.0.0 6 | 7 | * Moving to production 8 | 9 | ## 1.0.1 10 | 11 | * Bug Resolves 12 | 13 | ## 1.0.2 14 | 15 | * Bug Resolves 16 | 17 | ## 1.0.3 18 | 19 | * Added Whatsapp Business support 20 | * Bug Resolves 21 | 22 | ## 1.0.4 23 | 24 | * Avoiding memory leaks 25 | * stopping unwanted crash messages 26 | * Bug Resolves 27 | 28 | ## 1.0.9 29 | 30 | * one tap support 31 | 32 | ## 1.1.0 33 | 34 | * environment sdk version changes 35 | 36 | ## 1.1.1 37 | 38 | * android sdk version upgrade to 2.1.0 39 | * params support 40 | 41 | ## 1.1.2 42 | * ios sdk version updated to 2.0.0 43 | 44 | ## 1.1.3 45 | * android sdk dependency changed to maven 46 | * new fast android sdk 2.1.4 integrated. 47 | 48 | ## 1.1.4 49 | * ios sdk 2.0.1 with login page support added 50 | 51 | ## 2.0.0 52 | * Plugin package corrected. 53 | * android sdk version updated to 2.1.6 54 | 55 | ## 2.1.0 56 | * Inapp browser. 57 | * Otp autoread. 58 | * Google phone hint. 59 | 60 | ## 2.1.1 61 | * android sdk version updated to 2.2.6 and ios sdk version updated to 2.0.6 62 | 63 | ## 2.1.2 64 | * android and ios headless integration 65 | 66 | ## 2.1.3 67 | * bug fixes 68 | 69 | ## 2.1.4 70 | * silent auth 71 | 72 | ## 2.1.5 73 | * low memory instance save fix 74 | 75 | ## 2.1.6 76 | * WhatsApp OTP auto read in android 77 | 78 | ## 2.1.7 79 | * WebAuthn implementation in android and iOS. 80 | 81 | ## 2.1.8 82 | * uni_links package and build.gradle bug fix 83 | 84 | ## 2.1.9 85 | * V3 web SDK implementation 86 | 87 | ## 2.2.0 88 | * sim analysis query and listener added 89 | * unique id provider support added 90 | 91 | ## 2.2.2 92 | * RC4 changes 93 | 94 | ## 2.2.3 95 | * custom login uri and timeout support 96 | * optimizations and fixes 97 | * core android 2.6.3 and core ios 2.2.8 supported 98 | 99 | 100 | ## 2.2.4 101 | * Fixed android countdown timer crash by bumping android to 2.6.4 102 | 103 | ## 2.2.5 104 | * core android 2.6.5 105 | * OtplessSimStateReceiver removed from module AndroidManifest -------------------------------------------------------------------------------- /ios/Classes/WhatsAppHandler.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WhatsAppHandler.swift 3 | // otpless_flutter 4 | // 5 | // Created by Solai Raj on 08/10/22. 6 | // 7 | 8 | import Foundation 9 | import UIKit 10 | 11 | public enum responseCodeError: String { 12 | case urlNotFound = "581" 13 | case invalidURL = "582" 14 | case verificationFailed = "583" 15 | } 16 | 17 | public class WhatsAppHandler: NSObject { 18 | 19 | public static let sharedInstance: WhatsAppHandler = { 20 | let instance = WhatsAppHandler() 21 | return instance 22 | }() 23 | 24 | public func initiateWhatsappLogin(scheme : String,result: @escaping FlutterResult) { 25 | if scheme == "" { 26 | result("\(responseCodeError.invalidURL.rawValue)-\(StringValues.WHATSAPP_LINK_CREATE_ERROR)") 27 | }else{ 28 | if let newUrl = scheme.removingPercentEncoding as String? { 29 | print(newUrl) 30 | if let urlString = URL(string: newUrl.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!) { 31 | if let whatsappURL = NSURL(string: urlString.absoluteString) { 32 | if UIApplication.shared.canOpenURL(whatsappURL as URL) { 33 | if #available(iOS 10.0, *) { 34 | UIApplication.shared.open(whatsappURL as URL, options: [:], completionHandler: nil) 35 | } else { 36 | UIApplication.shared.openURL(whatsappURL as URL) 37 | } 38 | } else { 39 | result("\(responseCodeError.urlNotFound.rawValue)-\(StringValues.WHATSAPP_NOT_FOUND)") 40 | } 41 | }else{ 42 | result("\(responseCodeError.invalidURL.rawValue)-\(StringValues.WHATSAPP_LINK_CREATE_ERROR)") 43 | 44 | } 45 | }else{ 46 | result("\(responseCodeError.invalidURL.rawValue)-\(StringValues.WHATSAPP_LINK_CREATE_ERROR)") 47 | } 48 | } else { 49 | result("\(responseCodeError.invalidURL.rawValue)-\(StringValues.WHATSAPP_LINK_CREATE_ERROR)") 50 | 51 | } 52 | } 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /lib/otpless_flutter.dart: -------------------------------------------------------------------------------- 1 | import 'otpless_flutter_platform_interface.dart'; 2 | import 'package:otpless_flutter/otpless_flutter_method_channel.dart'; 3 | 4 | class Otpless { 5 | final MethodChannelOtplessFlutter _otplessChannel = 6 | MethodChannelOtplessFlutter(); 7 | 8 | Future getPlatformVersion() { 9 | return OtplessFlutterPlatform.instance.getPlatformVersion(); 10 | } 11 | 12 | /* 13 | open login page 14 | */ 15 | Future openLoginPage( 16 | OtplessResultCallback callback, Map jsonObject) async { 17 | _otplessChannel.openOtplessLoginPage(callback, jsonObject); 18 | } 19 | 20 | Future isWhatsAppInstalled() async { 21 | return _otplessChannel.isWhatsAppInstalled(); 22 | } 23 | 24 | Future setLoaderVisibility(bool visibility) async { 25 | return _otplessChannel.setLoaderVisibility(visibility); 26 | } 27 | 28 | /* 29 | start headless 30 | */ 31 | Future startHeadless( 32 | OtplessResultCallback callback, Map jsonObject) async { 33 | _otplessChannel.startHeadless(callback, jsonObject); 34 | } 35 | 36 | Future initHeadless(String appid, {double timeout = 30.0}) async { 37 | _otplessChannel.initHeadless(appid, timeout); 38 | } 39 | 40 | Future setHeadlessCallback(OtplessResultCallback callback) async { 41 | _otplessChannel.setHeadlessCallback(callback); 42 | } 43 | 44 | Future setWebviewInspectable(bool isInspectable) async { 45 | _otplessChannel.setWebviewInspectable(isInspectable); 46 | } 47 | 48 | Future enableDebugLogging(bool isDebugLoggingEnabled) async { 49 | _otplessChannel.enableDebugLogging(isDebugLoggingEnabled); 50 | } 51 | 52 | Future> showPhoneHint(bool showFallback) async { 53 | final result = await _otplessChannel.showPhoneHintLib(showFallback); 54 | return result; 55 | } 56 | 57 | Future attachSecureService(String appId) async { 58 | return await _otplessChannel.attachSecureService(appId); 59 | } 60 | 61 | Future>> getEjectedSimEntries() async { 62 | return await _otplessChannel.getEjectedSimEntries(); 63 | } 64 | 65 | Future setSimEventListener(final OtplessSimEventListener? listener) async { 66 | return await _otplessChannel.setSimEventListener(listener); 67 | } 68 | 69 | Future commitHeadlessResponse(final dynamic response) async { 70 | return await _otplessChannel.commitHeadlessResponse(response); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: otpless_flutter 2 | description: Flutter plugin to integrate OTPless login with whatsapp with flutter 3 | version: 2.2.5 4 | homepage: https://github.com/otpless-tech/otpless-flutter-plugin 5 | 6 | environment: 7 | sdk: ">=2.14.0 <4.0.0" 8 | flutter: ">=2.5.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | plugin_platform_interface: ^2.0.2 14 | 15 | dev_dependencies: 16 | flutter_test: 17 | sdk: flutter 18 | flutter_lints: ^1.0.4 19 | 20 | # For information on the generic Dart part of this file, see the 21 | # following page: https://dart.dev/tools/pub/pubspec 22 | 23 | # The following section is specific to Flutter packages. 24 | flutter: 25 | # This section identifies this Flutter project as a plugin project. 26 | # The 'pluginClass' specifies the class (in Java, Kotlin, Swift, Objective-C, etc.) 27 | # which should be registered in the plugin registry. This is required for 28 | # using method channels. 29 | # The Android 'package' specifies package in which the registered class is. 30 | # This is required for using method channels on Android. 31 | # The 'ffiPlugin' specifies that native code should be built and bundled. 32 | # This is required for using `dart:ffi`. 33 | # All these are used by the tooling to maintain consistency when 34 | # adding or updating assets for this project. 35 | plugin: 36 | platforms: 37 | android: 38 | package: com.otpless.otplessflutter 39 | pluginClass: OtplessFlutterPlugin 40 | ios: 41 | pluginClass: OtplessFlutterPlugin 42 | 43 | # To add assets to your plugin package, add an assets section, like this: 44 | # assets: 45 | # - images/a_dot_burr.jpeg 46 | # - images/a_dot_ham.jpeg 47 | # 48 | # For details regarding assets in packages, see 49 | # https://flutter.dev/assets-and-images/#from-packages 50 | # 51 | # An image asset can refer to one or more resolution-specific "variants", see 52 | # https://flutter.dev/assets-and-images/#resolution-aware 53 | 54 | # To add custom fonts to your plugin package, add a fonts section here, 55 | # in this "flutter" section. Each entry in this list should have a 56 | # "family" key with the font family name, and a "fonts" key with a 57 | # list giving the asset and other descriptors for the font. For 58 | # example: 59 | # fonts: 60 | # - family: Schyler 61 | # fonts: 62 | # - asset: fonts/Schyler-Regular.ttf 63 | # - asset: fonts/Schyler-Italic.ttf 64 | # style: italic 65 | # - family: Trajan Pro 66 | # fonts: 67 | # - asset: fonts/TrajanPro.ttf 68 | # - asset: fonts/TrajanPro_Bold.ttf 69 | # weight: 700 70 | # 71 | # For details regarding fonts in packages, see 72 | # https://flutter.dev/custom-fonts/#from-packages 73 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 15 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 44 | 45 | 46 | 48 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CADisableMinimumFrameDurationOnPhone 6 | 7 | CFBundleDevelopmentRegion 8 | $(DEVELOPMENT_LANGUAGE) 9 | CFBundleDisplayName 10 | Otpless Flutter 11 | CFBundleExecutable 12 | $(EXECUTABLE_NAME) 13 | CFBundleIdentifier 14 | $(PRODUCT_BUNDLE_IDENTIFIER) 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | otpless_flutter_example 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | $(FLUTTER_BUILD_NAME) 23 | CFBundleSignature 24 | ???? 25 | CFBundleURLTypes 26 | 27 | 28 | CFBundleTypeRole 29 | Editor 30 | CFBundleURLName 31 | otpless 32 | CFBundleURLSchemes 33 | 34 | otpless.your_appid_in_smallcase 35 | 36 | 37 | 38 | CFBundleVersion 39 | $(FLUTTER_BUILD_NUMBER) 40 | FlutterDeepLinkingEnabled 41 | 42 | LSApplicationQueriesSchemes 43 | 44 | whatsapp 45 | 46 | LSRequiresIPhoneOS 47 | 48 | NSAppTransportSecurity 49 | 50 | NSAllowsArbitraryLoads 51 | 52 | NSExceptionDomains 53 | 54 | 80.in.safr.sekuramobile.com 55 | 56 | NSIncludesSubdomains 57 | 58 | NSTemporaryExceptionAllowsInsecureHTTPLoads 59 | 60 | NSTemporaryExceptionMinimumTLSVersion 61 | TLSv1.1 62 | 63 | partnerapi.jio.com 64 | 65 | NSIncludesSubdomains 66 | 67 | NSTemporaryExceptionAllowsInsecureHTTPLoads 68 | 69 | NSTemporaryExceptionMinimumTLSVersion 70 | TLSv1.1 71 | 72 | 73 | 74 | UIApplicationSupportsIndirectInputEvents 75 | 76 | UILaunchStoryboardName 77 | LaunchScreen 78 | UIMainStoryboardFile 79 | Main 80 | UISupportedInterfaceOrientations 81 | 82 | UIInterfaceOrientationPortrait 83 | UIInterfaceOrientationLandscapeLeft 84 | UIInterfaceOrientationLandscapeRight 85 | 86 | UISupportedInterfaceOrientations~ipad 87 | 88 | UIInterfaceOrientationPortrait 89 | UIInterfaceOrientationPortraitUpsideDown 90 | UIInterfaceOrientationLandscapeLeft 91 | UIInterfaceOrientationLandscapeRight 92 | 93 | UIViewControllerBasedStatusBarAppearance 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 34//flutter.compileSdkVersion 30 | ndkVersion flutter.ndkVersion 31 | 32 | compileOptions { 33 | sourceCompatibility JavaVersion.VERSION_1_8 34 | targetCompatibility JavaVersion.VERSION_1_8 35 | } 36 | 37 | kotlinOptions { 38 | jvmTarget = '1.8' 39 | } 40 | 41 | sourceSets { 42 | main.java.srcDirs += 'src/main/kotlin' 43 | } 44 | 45 | defaultConfig { 46 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 47 | applicationId "com.digvijayanubhav.app" 48 | // You can update the following values to match your application needs. 49 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. 50 | minSdkVersion 21//flutter.minSdkVersion 51 | targetSdkVersion 34//flutter.targetSdkVersion 52 | versionCode flutterVersionCode.toInteger() 53 | versionName flutterVersionName 54 | 55 | //region === web authin === 56 | resValue 'string', 'host', 'https://otpless.com' 57 | resValue 'string', 'asset_statements', """ 58 | [{ 59 | "include": "https://otpless.com/.well-known/assetlinks.json" 60 | }] 61 | """ 62 | //endregion 63 | } 64 | 65 | signingConfigs { 66 | release { 67 | storeFile file(localProperties.getProperty("storeFile")) 68 | storePassword localProperties.getProperty("storePassword") 69 | keyAlias localProperties.getProperty("keyAlias") 70 | keyPassword localProperties.getProperty("keyPassword") 71 | } 72 | } 73 | 74 | buildTypes { 75 | release { 76 | // Signing with the debug keys for now, so `flutter run --release` works. 77 | signingConfig signingConfigs.release 78 | } 79 | } 80 | namespace 'com.example.otpless_flutter_example' 81 | } 82 | 83 | flutter { 84 | source '../..' 85 | } 86 | 87 | dependencies { 88 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 89 | implementation 'io.github.otpless-tech:otpless-secure-sdk:0.1.5' 90 | } 91 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | @rem SPDX-License-Identifier: Apache-2.0 17 | @rem 18 | 19 | @if "%DEBUG%"=="" @echo off 20 | @rem ########################################################################## 21 | @rem 22 | @rem Gradle startup script for Windows 23 | @rem 24 | @rem ########################################################################## 25 | 26 | @rem Set local scope for the variables with windows NT shell 27 | if "%OS%"=="Windows_NT" setlocal 28 | 29 | set DIRNAME=%~dp0 30 | if "%DIRNAME%"=="" set DIRNAME=. 31 | @rem This is normally unused 32 | set APP_BASE_NAME=%~n0 33 | set APP_HOME=%DIRNAME% 34 | 35 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 36 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 37 | 38 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 39 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 40 | 41 | @rem Find java.exe 42 | if defined JAVA_HOME goto findJavaFromJavaHome 43 | 44 | set JAVA_EXE=java.exe 45 | %JAVA_EXE% -version >NUL 2>&1 46 | if %ERRORLEVEL% equ 0 goto execute 47 | 48 | echo. 1>&2 49 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 50 | echo. 1>&2 51 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 52 | echo location of your Java installation. 1>&2 53 | 54 | goto fail 55 | 56 | :findJavaFromJavaHome 57 | set JAVA_HOME=%JAVA_HOME:"=% 58 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 59 | 60 | if exist "%JAVA_EXE%" goto execute 61 | 62 | echo. 1>&2 63 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 64 | echo. 1>&2 65 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 66 | echo location of your Java installation. 1>&2 67 | 68 | goto fail 69 | 70 | :execute 71 | @rem Setup the command line 72 | 73 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 74 | 75 | 76 | @rem Execute Gradle 77 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 78 | 79 | :end 80 | @rem End local scope for the variables with windows NT shell 81 | if %ERRORLEVEL% equ 0 goto mainEnd 82 | 83 | :fail 84 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 85 | rem the _cmd.exe /c_ return code! 86 | set EXIT_CODE=%ERRORLEVEL% 87 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 88 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 89 | exit /b %EXIT_CODE% 90 | 91 | :mainEnd 92 | if "%OS%"=="Windows_NT" endlocal 93 | 94 | :omega 95 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/ReleaseScheme.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 9 | 10 | 16 | 17 | 18 | 19 | 25 | 31 | 32 | 33 | 34 | 35 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: otpless_flutter_example 2 | description: Demonstrates how to use the otpless_flutter plugin. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `flutter pub publish`. This is preferred for private packages. 6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 7 | 8 | environment: 9 | sdk: ">=2.17.5 <3.0.0" 10 | 11 | # Dependencies specify other packages that your package needs in order to work. 12 | # To automatically upgrade your package dependencies to the latest versions 13 | # consider running `flutter pub upgrade --major-versions`. Alternatively, 14 | # dependencies can be manually updated by changing the version numbers below to 15 | # the latest version available on pub.dev. To see which dependencies have newer 16 | # versions available, run `flutter pub outdated`. 17 | dependencies: 18 | flutter: 19 | sdk: flutter 20 | 21 | otpless_flutter: 22 | # When depending on this package from a real application you should use: 23 | # otpless_flutter: ^x.y.z 24 | # See https://dart.dev/tools/pub/dependencies#version-constraints 25 | # The example app is bundled with the plugin so we use a path dependency on 26 | # the parent directory to use the current plugin's version. 27 | path: ../ 28 | 29 | # The following adds the Cupertino Icons font to your application. 30 | # Use with the CupertinoIcons class for iOS style icons. 31 | cupertino_icons: ^1.0.2 32 | 33 | dev_dependencies: 34 | flutter_test: 35 | sdk: flutter 36 | 37 | # The "flutter_lints" package below contains a set of recommended lints to 38 | # encourage good coding practices. The lint set provided by the package is 39 | # activated in the `analysis_options.yaml` file located at the root of your 40 | # package. See that file for information about deactivating specific lint 41 | # rules and activating additional ones. 42 | flutter_lints: ^2.0.0 43 | 44 | # For information on the generic Dart part of this file, see the 45 | # following page: https://dart.dev/tools/pub/pubspec 46 | 47 | # The following section is specific to Flutter packages. 48 | flutter: 49 | 50 | # The following line ensures that the Material Icons font is 51 | # included with your application, so that you can use the icons in 52 | # the material Icons class. 53 | uses-material-design: true 54 | 55 | # To add assets to your application, add an assets section, like this: 56 | # assets: 57 | # - images/a_dot_burr.jpeg 58 | # - images/a_dot_ham.jpeg 59 | 60 | # An image asset can refer to one or more resolution-specific "variants", see 61 | # https://flutter.dev/assets-and-images/#resolution-aware 62 | 63 | # For details regarding adding assets from package dependencies, see 64 | # https://flutter.dev/assets-and-images/#from-packages 65 | 66 | # To add custom fonts to your application, add a fonts section here, 67 | # in this "flutter" section. Each entry in this list should have a 68 | # "family" key with the font family name, and a "fonts" key with a 69 | # list giving the asset and other descriptors for the font. For 70 | # example: 71 | # fonts: 72 | # - family: Schyler 73 | # fonts: 74 | # - asset: fonts/Schyler-Regular.ttf 75 | # - asset: fonts/Schyler-Italic.ttf 76 | # style: italic 77 | # - family: Trajan Pro 78 | # fonts: 79 | # - asset: fonts/TrajanPro.ttf 80 | # - asset: fonts/TrajanPro_Bold.ttf 81 | # weight: 700 82 | # 83 | # For details regarding fonts from package dependencies, 84 | # see https://flutter.dev/custom-fonts/#from-packages 85 | -------------------------------------------------------------------------------- /lib/otpless_flutter_method_channel.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter/foundation.dart'; 4 | import 'package:flutter/services.dart'; 5 | 6 | import 'otpless_flutter_platform_interface.dart'; 7 | 8 | typedef OtplessResultCallback = void Function(dynamic); 9 | typedef OtplessSimEventListener = void Function(List>); 10 | 11 | /// An implementation of [OtplessFlutterPlatform] that uses method channels. 12 | class MethodChannelOtplessFlutter extends OtplessFlutterPlatform { 13 | final eventChannel = const EventChannel('otpless_callback_event'); 14 | 15 | @visibleForTesting 16 | final methodChannel = const MethodChannel('otpless_flutter'); 17 | 18 | OtplessResultCallback? _callback; 19 | OtplessSimEventListener? _simEventListener; 20 | 21 | MethodChannelOtplessFlutter() { 22 | _setEventChannel(); 23 | } 24 | 25 | void _setEventChannel() { 26 | methodChannel.setMethodCallHandler((call) async { 27 | if (call.method == "otpless_callback_event") { 28 | final json = call.arguments as String; 29 | final result = jsonDecode(json); 30 | _callback!(result); 31 | } else if(call.method == "otpless_sim_status_change_event") { 32 | if (_simEventListener != null) { 33 | final result = call.arguments as List; 34 | final fR = (result ?? []).map((item) => Map.from(item)).toList(); 35 | _simEventListener!(fR); 36 | } 37 | } 38 | }); 39 | } 40 | 41 | Future openOtplessLoginPage( 42 | OtplessResultCallback callback, Map jsonObject) async { 43 | _callback = callback; 44 | await methodChannel 45 | .invokeMethod("openOtplessLoginPage", {'arg': json.encode(jsonObject)}); 46 | } 47 | 48 | Future isWhatsAppInstalled() async { 49 | final isInstalled = await methodChannel.invokeMethod("isWhatsAppInstalled"); 50 | return isInstalled as bool; 51 | } 52 | 53 | Future setLoaderVisibility(bool visibility) async { 54 | await methodChannel 55 | .invokeMethod("setLoaderVisibility", {'arg': visibility}); 56 | } 57 | 58 | Future startHeadless( 59 | OtplessResultCallback callback, Map jsonObject) async { 60 | _callback = callback; 61 | await methodChannel 62 | .invokeMethod("startHeadless", {'arg': json.encode(jsonObject)}); 63 | } 64 | 65 | Future initHeadless(String appid, double timeout) async { 66 | await methodChannel.invokeMethod("initHeadless", {'arg': appid, 'timeout': timeout}); 67 | } 68 | 69 | Future setHeadlessCallback(OtplessResultCallback callback) async { 70 | _callback = callback; 71 | await methodChannel.invokeMethod("setHeadlessCallback"); 72 | } 73 | 74 | Future setWebviewInspectable(bool isInspectable) async { 75 | await methodChannel 76 | .invokeMapMethod("setWebviewInspectable", {'arg': isInspectable}); 77 | } 78 | 79 | Future enableDebugLogging(bool isEnabled) async { 80 | await methodChannel.invokeMethod("enableDebugLogging", {'arg': isEnabled}); 81 | } 82 | 83 | Future> showPhoneHintLib(bool showFallback) async { 84 | final result = await methodChannel.invokeMethod>( 85 | 'showPhoneHintLib', {'arg': showFallback}); 86 | return (result ?? {}) 87 | .map((key, value) => MapEntry(key.toString(), value.toString())); 88 | } 89 | 90 | Future attachSecureService(String appId) async { 91 | return await methodChannel 92 | .invokeMethod("attachSecureService", {'appId': appId}); 93 | } 94 | 95 | Future>> getEjectedSimEntries() async { 96 | final result = await methodChannel.invokeMethod>("getEjectedSimEntries"); 97 | return (result ?? []).map((item) => Map.from(item)).toList(); 98 | } 99 | 100 | Future setSimEventListener(final OtplessSimEventListener? listener) async { 101 | this._simEventListener = listener; 102 | bool isAttach = listener != null; 103 | await methodChannel.invokeMethod("setSimEjectionListener", {"isAttach": isAttach}); 104 | } 105 | 106 | Future commitHeadlessResponse(final dynamic response) async { 107 | await methodChannel.invokeMethod("commitHeadlessResponse", { "response": response }); 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /example/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" 9 | url: "https://pub.dev" 10 | source: hosted 11 | version: "2.11.0" 12 | boolean_selector: 13 | dependency: transitive 14 | description: 15 | name: boolean_selector 16 | sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" 17 | url: "https://pub.dev" 18 | source: hosted 19 | version: "2.1.1" 20 | characters: 21 | dependency: transitive 22 | description: 23 | name: characters 24 | sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" 25 | url: "https://pub.dev" 26 | source: hosted 27 | version: "1.3.0" 28 | clock: 29 | dependency: transitive 30 | description: 31 | name: clock 32 | sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf 33 | url: "https://pub.dev" 34 | source: hosted 35 | version: "1.1.1" 36 | collection: 37 | dependency: transitive 38 | description: 39 | name: collection 40 | sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a 41 | url: "https://pub.dev" 42 | source: hosted 43 | version: "1.18.0" 44 | cupertino_icons: 45 | dependency: "direct main" 46 | description: 47 | name: cupertino_icons 48 | sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 49 | url: "https://pub.dev" 50 | source: hosted 51 | version: "1.0.8" 52 | fake_async: 53 | dependency: transitive 54 | description: 55 | name: fake_async 56 | sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" 57 | url: "https://pub.dev" 58 | source: hosted 59 | version: "1.3.1" 60 | flutter: 61 | dependency: "direct main" 62 | description: flutter 63 | source: sdk 64 | version: "0.0.0" 65 | flutter_lints: 66 | dependency: "direct dev" 67 | description: 68 | name: flutter_lints 69 | sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 70 | url: "https://pub.dev" 71 | source: hosted 72 | version: "2.0.3" 73 | flutter_test: 74 | dependency: "direct dev" 75 | description: flutter 76 | source: sdk 77 | version: "0.0.0" 78 | leak_tracker: 79 | dependency: transitive 80 | description: 81 | name: leak_tracker 82 | sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" 83 | url: "https://pub.dev" 84 | source: hosted 85 | version: "10.0.0" 86 | leak_tracker_flutter_testing: 87 | dependency: transitive 88 | description: 89 | name: leak_tracker_flutter_testing 90 | sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 91 | url: "https://pub.dev" 92 | source: hosted 93 | version: "2.0.1" 94 | leak_tracker_testing: 95 | dependency: transitive 96 | description: 97 | name: leak_tracker_testing 98 | sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 99 | url: "https://pub.dev" 100 | source: hosted 101 | version: "2.0.1" 102 | lints: 103 | dependency: transitive 104 | description: 105 | name: lints 106 | sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" 107 | url: "https://pub.dev" 108 | source: hosted 109 | version: "2.1.1" 110 | matcher: 111 | dependency: transitive 112 | description: 113 | name: matcher 114 | sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb 115 | url: "https://pub.dev" 116 | source: hosted 117 | version: "0.12.16+1" 118 | material_color_utilities: 119 | dependency: transitive 120 | description: 121 | name: material_color_utilities 122 | sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" 123 | url: "https://pub.dev" 124 | source: hosted 125 | version: "0.8.0" 126 | meta: 127 | dependency: transitive 128 | description: 129 | name: meta 130 | sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 131 | url: "https://pub.dev" 132 | source: hosted 133 | version: "1.11.0" 134 | otpless_flutter: 135 | dependency: "direct main" 136 | description: 137 | path: ".." 138 | relative: true 139 | source: path 140 | version: "2.2.5" 141 | path: 142 | dependency: transitive 143 | description: 144 | name: path 145 | sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" 146 | url: "https://pub.dev" 147 | source: hosted 148 | version: "1.9.0" 149 | plugin_platform_interface: 150 | dependency: transitive 151 | description: 152 | name: plugin_platform_interface 153 | sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" 154 | url: "https://pub.dev" 155 | source: hosted 156 | version: "2.1.8" 157 | sky_engine: 158 | dependency: transitive 159 | description: flutter 160 | source: sdk 161 | version: "0.0.99" 162 | source_span: 163 | dependency: transitive 164 | description: 165 | name: source_span 166 | sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" 167 | url: "https://pub.dev" 168 | source: hosted 169 | version: "1.10.0" 170 | stack_trace: 171 | dependency: transitive 172 | description: 173 | name: stack_trace 174 | sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" 175 | url: "https://pub.dev" 176 | source: hosted 177 | version: "1.11.1" 178 | stream_channel: 179 | dependency: transitive 180 | description: 181 | name: stream_channel 182 | sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 183 | url: "https://pub.dev" 184 | source: hosted 185 | version: "2.1.2" 186 | string_scanner: 187 | dependency: transitive 188 | description: 189 | name: string_scanner 190 | sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" 191 | url: "https://pub.dev" 192 | source: hosted 193 | version: "1.2.0" 194 | term_glyph: 195 | dependency: transitive 196 | description: 197 | name: term_glyph 198 | sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 199 | url: "https://pub.dev" 200 | source: hosted 201 | version: "1.2.1" 202 | test_api: 203 | dependency: transitive 204 | description: 205 | name: test_api 206 | sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" 207 | url: "https://pub.dev" 208 | source: hosted 209 | version: "0.6.1" 210 | vector_math: 211 | dependency: transitive 212 | description: 213 | name: vector_math 214 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" 215 | url: "https://pub.dev" 216 | source: hosted 217 | version: "2.1.4" 218 | vm_service: 219 | dependency: transitive 220 | description: 221 | name: vm_service 222 | sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 223 | url: "https://pub.dev" 224 | source: hosted 225 | version: "13.0.0" 226 | sdks: 227 | dart: ">=3.2.0-0 <4.0.0" 228 | flutter: ">=2.5.0" 229 | -------------------------------------------------------------------------------- /ios/Classes/SwiftOtplessFlutterPlugin.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Strings.swift 3 | // otpless_flutter 4 | // 5 | // Created by Solai Raj on 08/10/22. 6 | // 7 | 8 | import Flutter 9 | import UIKit 10 | import OtplessSDK 11 | 12 | 13 | public class SwiftOtplessFlutterPlugin: NSObject, FlutterPlugin { 14 | 15 | public static func register(with registrar: FlutterPluginRegistrar) { 16 | let channel = FlutterMethodChannel(name: "otpless_flutter", binaryMessenger: registrar.messenger()) 17 | let instance = SwiftOtplessFlutterPlugin() 18 | registrar.addMethodCallDelegate(instance, channel: channel) 19 | ChannelManager.shared.setMethodChannel(channel) 20 | } 21 | 22 | public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { 23 | if(call.method == "isWhatsAppInstalled"){ 24 | result(Otpless.sharedInstance.isWhatsappInstalled()) 25 | } 26 | else if(call.method == "openOtplessLoginPage"){ 27 | guard let viewController = UIApplication.shared.delegate?.window??.rootViewController else {return} 28 | Otpless.sharedInstance.setLoginPageDelegate(self); 29 | let args = call.arguments as! [String: Any] 30 | let jsonString = args["arg"] as! String 31 | let argument: [String: Any] = SwiftOtplessFlutterPlugin.convertToDictionary(text: jsonString)! 32 | let appId: String = argument["appId"] as! String 33 | let params: [String: Any]? = argument["params"] as? [String: Any] 34 | Otpless.sharedInstance.showOtplessLoginPageWithParams(appId: appId, vc: viewController, params: params) 35 | } else if (call.method == "setLoaderVisibility") { 36 | // do nothing 37 | } else if (call.method == "startHeadless") { 38 | Otpless.sharedInstance.setHeadlessResponseDelegate(self); 39 | let args = call.arguments as! [String: Any] 40 | let jsonString = args["arg"] as! String 41 | let data = jsonString.data(using: .utf8)! 42 | let argument: [String: String] = try! JSONSerialization.jsonObject(with: data, options: []) as! [String: String] 43 | let headlessRequest = createHeadlessRequest(args: argument) 44 | if let otp = argument["otp"] { 45 | headlessRequest.setOtp(otp: otp) 46 | Otpless.sharedInstance.startHeadless(headlessRequest: headlessRequest) 47 | } else { 48 | Otpless.sharedInstance.startHeadless(headlessRequest: createHeadlessRequest(args: argument)) 49 | } 50 | } else if (call.method == "initHeadless") { 51 | guard let viewController = UIApplication.shared.delegate?.window??.rootViewController else {return} 52 | let args = call.arguments as! [String: Any] 53 | let appId = args["arg"] as! String 54 | let loginUri = args["loginUri"] as? String 55 | let timeout = args["timeout"] as? Double 56 | Otpless.sharedInstance.initialise(vc: viewController, appId: appId, loginUri: loginUri ,timeoutInterval: timeout != nil ? timeout! : 30.0) 57 | } else if (call.method == "setHeadlessCallback") { 58 | Otpless.sharedInstance.setHeadlessResponseDelegate(self); 59 | } else if (call.method == "setWebviewInspectable") { 60 | let args = call.arguments as! [String: Any] 61 | var isInspectable = args["arg"] as? Bool 62 | if isInspectable == nil { 63 | isInspectable = false 64 | } 65 | Otpless.sharedInstance.webviewInspectable = isInspectable! 66 | } else if (call.method == "enableDebugLogging") { 67 | let args = call.arguments as? [String: Any] 68 | let shouldEnableDebugLogging = args?["arg"] as? Bool ?? false 69 | 70 | if shouldEnableDebugLogging { 71 | Otpless.sharedInstance.setLoggerDelegate(delegate: self) 72 | } 73 | } else if (call.method == "attachSecureService" || call.method == "setSimEjectionListener") { 74 | result(nil) 75 | } else if (call.method == "getEjectedSimEntries") { 76 | result([]) 77 | } else if call.method == "commitHeadlessResponse" { 78 | let args = call.arguments as? [String: Any] 79 | let response = args?["response"] as? [String: Any] 80 | let headlessResponse: HeadlessResponse? = convertDictionaryToHeadlessResponse(response) 81 | Otpless.sharedInstance.commitHeadlessResponse(headlessResponse: headlessResponse) 82 | } 83 | } 84 | 85 | private func convertDictionaryToHeadlessResponse(_ dict: [String: Any]?) -> HeadlessResponse? { 86 | guard let dict = dict else { 87 | return nil 88 | } 89 | 90 | return HeadlessResponse( 91 | responseType: dict["responseType"] as? String ?? "", 92 | responseData: dict["response"] as? [String: Any], 93 | statusCode: dict["statusCode"] as? Int ?? -1000 94 | ) 95 | } 96 | 97 | private func createHeadlessRequest(args: [String: String]) -> HeadlessRequest { 98 | let headlessRequest = HeadlessRequest() 99 | if let phone = args["phone"] { 100 | let countryCode: String = args["countryCode"]! 101 | headlessRequest.setPhoneNumber(number: phone, withCountryCode: countryCode) 102 | } else if let email = args["email"] { 103 | headlessRequest.setEmail(email) 104 | } else if let channelType = args["channelType"] { 105 | headlessRequest.setChannelType(channelType) 106 | } 107 | if let deliveryChannel = args["deliveryChannel"] { 108 | headlessRequest.setDeliveryChannel(deliveryChannel.uppercased()) 109 | } 110 | if let otpLength = args["otpLength"] { 111 | headlessRequest.setOtpLength(otpLength: otpLength) 112 | } 113 | if let expiry = args["expiry"] { 114 | headlessRequest.setExpiry(expiry: expiry) 115 | } 116 | return headlessRequest 117 | } 118 | 119 | static func filterParamsCondition(_ call: FlutterMethodCall, on onHaving: ([String: Any]) -> Void, off onNotHaving: () -> Void) { 120 | if let args = call.arguments as? [String: Any] { 121 | if let jsonString = args["arg"] as? String { 122 | if let params = convertToDictionary(text: jsonString) { 123 | onHaving(params) 124 | return 125 | } 126 | } 127 | } 128 | onNotHaving() 129 | } 130 | 131 | static func convertToJsonString(response: OtplessSDK.OtplessResponse?) -> String? { 132 | do { 133 | var params = [String: Any]() 134 | if (response != nil && response?.errorString != nil){ 135 | params["errorMessage"] = response?.errorString 136 | } else { 137 | if response != nil && response?.responseData != nil { 138 | params = response!.responseData! 139 | } 140 | } 141 | if response != nil { 142 | let jsonData = try JSONSerialization.data(withJSONObject: params, options: []) 143 | if let jsonString = String(data: jsonData, encoding: .utf8) { 144 | return jsonString 145 | } 146 | } else { 147 | return"{}" 148 | } 149 | } catch { 150 | print("Error converting to JSON string: \(error)") 151 | return"{}" 152 | } 153 | 154 | return "{}" 155 | } 156 | 157 | static func convertToDictionary(text: String) -> [String: Any]? { 158 | if let data = text.data(using: .utf8) { 159 | do { 160 | return try JSONSerialization.jsonObject(with: data, options: []) as? [String: Any] 161 | } catch { 162 | print(error.localizedDescription) 163 | } 164 | } 165 | return nil 166 | } 167 | 168 | 169 | } 170 | 171 | extension SwiftOtplessFlutterPlugin: onResponseDelegate{ 172 | public func onResponse(response: OtplessSDK.OtplessResponse?) { 173 | ChannelManager.shared.invokeMethod(method: "otpless_callback_event", arguments: SwiftOtplessFlutterPlugin.convertToJsonString(response: response)) 174 | } 175 | } 176 | 177 | extension SwiftOtplessFlutterPlugin: onHeadlessResponseDelegate { 178 | public func onHeadlessResponse(response: OtplessSDK.HeadlessResponse?) { 179 | guard let response = response else { 180 | return 181 | } 182 | let flutterResponse: [String: Any] = ["statusCode": response.statusCode, 183 | "responseType": response.responseType, 184 | "response": response.responseData] 185 | let jsonData = try! JSONSerialization.data(withJSONObject: flutterResponse, options: []) 186 | ChannelManager.shared.invokeMethod(method: "otpless_callback_event", arguments: String(data: jsonData, encoding: .utf8)) 187 | } 188 | } 189 | 190 | extension SwiftOtplessFlutterPlugin: OtplessLoggerDelegate { 191 | public func otplessLog(string: String, type: String) { 192 | print("Otpless Log of type : \(type)\n\n\(string)") 193 | } 194 | } 195 | 196 | class ChannelManager { 197 | static let shared = ChannelManager() 198 | 199 | private var methodChannel: FlutterMethodChannel? 200 | 201 | private init() {} 202 | 203 | func setMethodChannel(_ channel: FlutterMethodChannel) { 204 | methodChannel = channel 205 | } 206 | 207 | func invokeMethod(method: String, arguments: Any?) { 208 | methodChannel?.invokeMethod(method, arguments: arguments) 209 | } 210 | } 211 | 212 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # SPDX-License-Identifier: Apache-2.0 19 | # 20 | 21 | ############################################################################## 22 | # 23 | # Gradle start up script for POSIX generated by Gradle. 24 | # 25 | # Important for running: 26 | # 27 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 28 | # noncompliant, but you have some other compliant shell such as ksh or 29 | # bash, then to run this script, type that shell name before the whole 30 | # command line, like: 31 | # 32 | # ksh Gradle 33 | # 34 | # Busybox and similar reduced shells will NOT work, because this script 35 | # requires all of these POSIX shell features: 36 | # * functions; 37 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 38 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 39 | # * compound commands having a testable exit status, especially «case»; 40 | # * various built-in commands including «command», «set», and «ulimit». 41 | # 42 | # Important for patching: 43 | # 44 | # (2) This script targets any POSIX shell, so it avoids extensions provided 45 | # by Bash, Ksh, etc; in particular arrays are avoided. 46 | # 47 | # The "traditional" practice of packing multiple parameters into a 48 | # space-separated string is a well documented source of bugs and security 49 | # problems, so this is (mostly) avoided, by progressively accumulating 50 | # options in "$@", and eventually passing that to Java. 51 | # 52 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 53 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 54 | # see the in-line comments for details. 55 | # 56 | # There are tweaks for specific operating systems such as AIX, CygWin, 57 | # Darwin, MinGW, and NonStop. 58 | # 59 | # (3) This script is generated from the Groovy template 60 | # https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 61 | # within the Gradle project. 62 | # 63 | # You can find Gradle at https://github.com/gradle/gradle/. 64 | # 65 | ############################################################################## 66 | 67 | # Attempt to set APP_HOME 68 | 69 | # Resolve links: $0 may be a link 70 | app_path=$0 71 | 72 | # Need this for daisy-chained symlinks. 73 | while 74 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 75 | [ -h "$app_path" ] 76 | do 77 | ls=$( ls -ld "$app_path" ) 78 | link=${ls#*' -> '} 79 | case $link in #( 80 | /*) app_path=$link ;; #( 81 | *) app_path=$APP_HOME$link ;; 82 | esac 83 | done 84 | 85 | # This is normally unused 86 | # shellcheck disable=SC2034 87 | APP_BASE_NAME=${0##*/} 88 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) 89 | APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s 90 | ' "$PWD" ) || exit 91 | 92 | # Use the maximum available, or set MAX_FD != -1 to use that value. 93 | MAX_FD=maximum 94 | 95 | warn () { 96 | echo "$*" 97 | } >&2 98 | 99 | die () { 100 | echo 101 | echo "$*" 102 | echo 103 | exit 1 104 | } >&2 105 | 106 | # OS specific support (must be 'true' or 'false'). 107 | cygwin=false 108 | msys=false 109 | darwin=false 110 | nonstop=false 111 | case "$( uname )" in #( 112 | CYGWIN* ) cygwin=true ;; #( 113 | Darwin* ) darwin=true ;; #( 114 | MSYS* | MINGW* ) msys=true ;; #( 115 | NONSTOP* ) nonstop=true ;; 116 | esac 117 | 118 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 119 | 120 | 121 | # Determine the Java command to use to start the JVM. 122 | if [ -n "$JAVA_HOME" ] ; then 123 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 124 | # IBM's JDK on AIX uses strange locations for the executables 125 | JAVACMD=$JAVA_HOME/jre/sh/java 126 | else 127 | JAVACMD=$JAVA_HOME/bin/java 128 | fi 129 | if [ ! -x "$JAVACMD" ] ; then 130 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 131 | 132 | Please set the JAVA_HOME variable in your environment to match the 133 | location of your Java installation." 134 | fi 135 | else 136 | JAVACMD=java 137 | if ! command -v java >/dev/null 2>&1 138 | then 139 | die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 140 | 141 | Please set the JAVA_HOME variable in your environment to match the 142 | location of your Java installation." 143 | fi 144 | fi 145 | 146 | # Increase the maximum file descriptors if we can. 147 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 148 | case $MAX_FD in #( 149 | max*) 150 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. 151 | # shellcheck disable=SC2039,SC3045 152 | MAX_FD=$( ulimit -H -n ) || 153 | warn "Could not query maximum file descriptor limit" 154 | esac 155 | case $MAX_FD in #( 156 | '' | soft) :;; #( 157 | *) 158 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. 159 | # shellcheck disable=SC2039,SC3045 160 | ulimit -n "$MAX_FD" || 161 | warn "Could not set maximum file descriptor limit to $MAX_FD" 162 | esac 163 | fi 164 | 165 | # Collect all arguments for the java command, stacking in reverse order: 166 | # * args from the command line 167 | # * the main class name 168 | # * -classpath 169 | # * -D...appname settings 170 | # * --module-path (only if needed) 171 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 172 | 173 | # For Cygwin or MSYS, switch paths to Windows format before running java 174 | if "$cygwin" || "$msys" ; then 175 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 176 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 177 | 178 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 179 | 180 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 181 | for arg do 182 | if 183 | case $arg in #( 184 | -*) false ;; # don't mess with options #( 185 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 186 | [ -e "$t" ] ;; #( 187 | *) false ;; 188 | esac 189 | then 190 | arg=$( cygpath --path --ignore --mixed "$arg" ) 191 | fi 192 | # Roll the args list around exactly as many times as the number of 193 | # args, so each arg winds up back in the position where it started, but 194 | # possibly modified. 195 | # 196 | # NB: a `for` loop captures its iteration list before it begins, so 197 | # changing the positional parameters here affects neither the number of 198 | # iterations, nor the values presented in `arg`. 199 | shift # remove old arg 200 | set -- "$@" "$arg" # push replacement arg 201 | done 202 | fi 203 | 204 | 205 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 206 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 207 | 208 | # Collect all arguments for the java command: 209 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, 210 | # and any embedded shellness will be escaped. 211 | # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be 212 | # treated as '${Hostname}' itself on the command line. 213 | 214 | set -- \ 215 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 216 | -classpath "$CLASSPATH" \ 217 | org.gradle.wrapper.GradleWrapperMain \ 218 | "$@" 219 | 220 | # Stop when "xargs" is not available. 221 | if ! command -v xargs >/dev/null 2>&1 222 | then 223 | die "xargs is not available" 224 | fi 225 | 226 | # Use "xargs" to parse quoted args. 227 | # 228 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 229 | # 230 | # In Bash we could simply go: 231 | # 232 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 233 | # set -- "${ARGS[@]}" "$@" 234 | # 235 | # but POSIX shell has neither arrays nor command substitution, so instead we 236 | # post-process each arg (as a line of input to sed) to backslash-escape any 237 | # character that might be a shell metacharacter, then use eval to reverse 238 | # that process (while maintaining the separation between arguments), and wrap 239 | # the whole thing up as a single "set" statement. 240 | # 241 | # This will of course break if any of these variables contains a newline or 242 | # an unmatched quote. 243 | # 244 | 245 | eval "set -- $( 246 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 247 | xargs -n1 | 248 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 249 | tr '\n' ' ' 250 | )" '"$@"' 251 | 252 | exec "$JAVACMD" "$@" 253 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'dart:io'; 3 | 4 | import 'package:flutter/cupertino.dart'; 5 | import 'package:flutter/material.dart'; 6 | import 'package:flutter/services.dart'; 7 | import 'dart:async'; 8 | 9 | import 'package:otpless_flutter/otpless_flutter.dart'; 10 | 11 | void main() { 12 | runApp(const MyApp()); 13 | } 14 | 15 | class MyApp extends StatefulWidget { 16 | const MyApp({Key? key}) : super(key: key); 17 | 18 | @override 19 | State createState() => _MyAppState(); 20 | } 21 | 22 | class _MyAppState extends State { 23 | String _dataResponse = 'Unknown'; 24 | final _otplessFlutterPlugin = Otpless(); 25 | var loaderVisibility = true; 26 | bool isSimStateListenerAttached = false; 27 | final TextEditingController phoneOrEmailTextController = 28 | TextEditingController(); 29 | final TextEditingController otpController = TextEditingController(); 30 | String channel = "WHATSAPP"; 31 | 32 | String phoneOrEmail = ''; 33 | String otp = ''; 34 | bool isInitIos = false; 35 | 36 | String deliveryChannel = ''; 37 | String otpLength = ""; 38 | String expiry = ""; 39 | 40 | static const String appId = "YOUR_APPID"; 41 | 42 | @override 43 | void initState() { 44 | super.initState(); 45 | _otplessFlutterPlugin.enableDebugLogging(true); 46 | if (Platform.isAndroid) { 47 | _otplessFlutterPlugin.initHeadless(appId, timeout: 23); 48 | _otplessFlutterPlugin.setHeadlessCallback(onHeadlessResult); 49 | debugPrint("init headless sdk is called for android"); 50 | attachSecureService(); 51 | } 52 | _otplessFlutterPlugin.setWebviewInspectable(true); 53 | } 54 | 55 | Future attachSecureService() async { 56 | try { 57 | await _otplessFlutterPlugin.attachSecureService(appId); 58 | } on PlatformException catch (e) { 59 | print( 60 | 'PlatformException: ${e.message}, code: ${e.code}, details: ${e.details}'); 61 | } 62 | } 63 | 64 | Future getEjectedSimStatus() async { 65 | List> data = 66 | await _otplessFlutterPlugin.getEjectedSimEntries(); 67 | setState(() { 68 | _dataResponse = data.toString(); 69 | }); 70 | } 71 | 72 | Future openLoginPage() async { 73 | Map arg = {'appId': appId}; 74 | _otplessFlutterPlugin.openLoginPage(onLoginPageResult, arg); 75 | } 76 | 77 | Future startHeadlessWithChannel() async { 78 | if (Platform.isIOS && !isInitIos) { 79 | _otplessFlutterPlugin.initHeadless(appId, timeout: 26); 80 | _otplessFlutterPlugin.setHeadlessCallback(onHeadlessResult); 81 | isInitIos = true; 82 | debugPrint("init headless sdk is called for ios"); 83 | return; 84 | } 85 | Map arg = {'channelType': channel}; 86 | arg["timeout"] = "21"; 87 | _otplessFlutterPlugin.startHeadless(onHeadlessResult, arg); 88 | } 89 | 90 | Future startHeadlessForPhoneAndEmail() async { 91 | if (Platform.isIOS && !isInitIos) { 92 | _otplessFlutterPlugin.initHeadless(appId, timeout: 1); 93 | _otplessFlutterPlugin.setHeadlessCallback(onHeadlessResult); 94 | isInitIos = true; 95 | debugPrint("init headless sdk is called for ios"); 96 | return; 97 | } 98 | Map arg = {}; 99 | arg["timeout"] = "21"; 100 | var x = double.tryParse(phoneOrEmail); 101 | if (x != null) { 102 | arg["phone"] = phoneOrEmail; 103 | arg["countryCode"] = "91"; 104 | } else { 105 | arg["email"] = phoneOrEmail; 106 | } 107 | 108 | if (otp.isNotEmpty) { 109 | arg["otp"] = otp; 110 | } 111 | // adding delivery channel, otp length and expiry 112 | if (deliveryChannel.isNotEmpty) { 113 | arg["deliveryChannel"] = deliveryChannel; 114 | } 115 | if (otpLength.isNotEmpty) { 116 | arg["otpLength"] = otpLength; 117 | } 118 | if (expiry.isNotEmpty) { 119 | arg["expiry"] = expiry; 120 | } 121 | 122 | _otplessFlutterPlugin.startHeadless(onHeadlessResult, arg); 123 | } 124 | 125 | Future onSimCheckboxChange(bool isChecked) async { 126 | if (isChecked) { 127 | _otplessFlutterPlugin.setSimEventListener((data) { 128 | setState(() { 129 | _dataResponse = data.toString(); 130 | }); 131 | }); 132 | } else { 133 | _otplessFlutterPlugin.setSimEventListener(null); 134 | } 135 | } 136 | 137 | void onHeadlessResult(dynamic result) { 138 | setState(() { 139 | _dataResponse = jsonEncode(result); 140 | _otplessFlutterPlugin.commitHeadlessResponse(result); 141 | String responseType = result["responseType"]; 142 | if (responseType == "OTP_AUTO_READ") { 143 | String _otp = result["response"]["otp"]; 144 | otpController.text = _otp; 145 | otp = _otp; 146 | } 147 | }); 148 | } 149 | 150 | void onLoginPageResult(dynamic result) { 151 | setState(() { 152 | _dataResponse = jsonEncode(result); 153 | }); 154 | } 155 | 156 | Future changeLoaderVisibility() async { 157 | loaderVisibility = !loaderVisibility; 158 | _otplessFlutterPlugin.setLoaderVisibility(loaderVisibility); 159 | } 160 | 161 | @override 162 | void dispose() { 163 | phoneOrEmailTextController.dispose(); 164 | super.dispose(); 165 | } 166 | 167 | @override 168 | Widget build(BuildContext context) { 169 | return MaterialApp( 170 | home: Scaffold( 171 | appBar: AppBar( 172 | title: const Text('OTPless Flutter Plugin example app'), 173 | ), 174 | body: SafeArea( 175 | child: SingleChildScrollView( 176 | child: Padding( 177 | padding: const EdgeInsets.all(16.0), // Adjusted margin 178 | child: Center( 179 | child: Column( 180 | crossAxisAlignment: CrossAxisAlignment 181 | .stretch, // Makes the buttons fill the width 182 | children: [ 183 | CupertinoButton.filled( 184 | onPressed: openLoginPage, 185 | child: const Text("Open Otpless Login Page"), 186 | ), 187 | const SizedBox(height: 16), // Spacing between buttons 188 | CupertinoButton.filled( 189 | onPressed: changeLoaderVisibility, 190 | child: const Text("Toggle Loader Visibility"), 191 | ), 192 | const SizedBox(height: 16), 193 | CupertinoButton.filled( 194 | onPressed: startHeadlessWithChannel, 195 | child: const Text("Start Headless With Channel"), 196 | ), 197 | const SizedBox(height: 16), 198 | CupertinoButton.filled( 199 | onPressed: handlePhoneHint, 200 | child: const Text("Show Phone Hint")), 201 | const SizedBox(height: 16), 202 | CupertinoButton.filled( 203 | onPressed: getEjectedSimStatus, 204 | child: const Text("Sim Eject Status")), 205 | const SizedBox(height: 16), 206 | Row( 207 | mainAxisAlignment: MainAxisAlignment.center, 208 | children: [ 209 | Checkbox( 210 | value: isSimStateListenerAttached, 211 | onChanged: (bool? value) { 212 | onSimCheckboxChange(value ?? false); 213 | setState(() { 214 | isSimStateListenerAttached = value!; 215 | }); 216 | }, 217 | ), 218 | Text( 219 | isSimStateListenerAttached 220 | ? 'Remove Sim Change Listener' 221 | : 'Attach Sim Change Listener', 222 | style: TextStyle(fontSize: 20), 223 | ), 224 | ]), 225 | TextField( 226 | controller: phoneOrEmailTextController, 227 | onChanged: (value) { 228 | setState(() { 229 | phoneOrEmail = value; 230 | }); 231 | }, 232 | decoration: const InputDecoration( 233 | hintText: 'Enter Phone or email here', 234 | ), 235 | ), 236 | const SizedBox(height: 16), 237 | TextField( 238 | controller: otpController, 239 | onChanged: (value) { 240 | setState(() { 241 | otp = value; 242 | }); 243 | }, 244 | decoration: const InputDecoration( 245 | hintText: 'Enter your OTP here', 246 | ), 247 | ), 248 | const SizedBox(height: 16), 249 | TextField( 250 | onChanged: (value) { 251 | setState(() { 252 | channel = value; 253 | }); 254 | }, 255 | decoration: const InputDecoration( 256 | hintText: 'Enter channel', 257 | ), 258 | ), 259 | const SizedBox(height: 16), 260 | CupertinoButton.filled( 261 | onPressed: startHeadlessForPhoneAndEmail, 262 | child: const Text("Start with Phone and Email"), 263 | ), 264 | const SizedBox(height: 16), 265 | // adding delivery channel 266 | TextField( 267 | onChanged: (value) { 268 | deliveryChannel = value; 269 | }, 270 | decoration: const InputDecoration( 271 | hintText: "Enter Delivery Channel"), 272 | ), 273 | const SizedBox(height: 16), 274 | // adding otp length 275 | TextField( 276 | onChanged: (value) { 277 | otpLength = value; 278 | }, 279 | decoration: 280 | const InputDecoration(hintText: "Enter the OTP length"), 281 | keyboardType: TextInputType.number, 282 | ), 283 | const SizedBox(height: 16), 284 | // adding expiry 285 | TextField( 286 | onChanged: (value) { 287 | expiry = value; 288 | }, 289 | decoration: const InputDecoration( 290 | hintText: "Enter the expiry in seconds"), 291 | keyboardType: TextInputType.number, 292 | ), 293 | const SizedBox(height: 16), 294 | // response view 295 | Text( 296 | _dataResponse, 297 | textAlign: TextAlign.center, 298 | ), 299 | ], 300 | ), 301 | ), 302 | ), 303 | )), 304 | ), 305 | ); 306 | } 307 | 308 | void handlePhoneHint() async { 309 | final result = await _otplessFlutterPlugin.showPhoneHint(true); 310 | setState(() { 311 | if (result["phoneNumber"] != null) { 312 | String phone = result["phoneNumber"]!; 313 | if (phone.length > 10) { 314 | phone = phone.substring(phone.length - 10); 315 | } 316 | phoneOrEmail = phone; 317 | phoneOrEmailTextController.text = phoneOrEmail; 318 | } else { 319 | _dataResponse = result["error"]!; 320 | } 321 | }); 322 | } 323 | } 324 | -------------------------------------------------------------------------------- /android/src/main/kotlin/com/otpless/otplessflutter/OtplessFlutterPlugin.kt: -------------------------------------------------------------------------------- 1 | package com.otpless.otplessflutter 2 | 3 | import android.app.Activity 4 | import android.content.Context 5 | import android.content.Intent 6 | import android.util.Log 7 | import androidx.annotation.NonNull 8 | import com.otpless.dto.HeadlessRequest 9 | import com.otpless.dto.HeadlessResponse 10 | import com.otpless.dto.OtpDeliveryChannel 11 | import com.otpless.dto.OtpLength 12 | import com.otpless.dto.OtplessRequest 13 | import com.otpless.main.OtplessManager 14 | import com.otpless.main.OtplessView 15 | import com.otpless.tesseract.OtplessSecureService 16 | import com.otpless.tesseract.sim.OtplessSimStateReceiverApi 17 | import com.otpless.utils.Utility 18 | import io.flutter.embedding.engine.plugins.FlutterPlugin 19 | import io.flutter.embedding.engine.plugins.activity.ActivityAware 20 | import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding 21 | import io.flutter.plugin.common.MethodCall 22 | import io.flutter.plugin.common.MethodChannel 23 | import io.flutter.plugin.common.MethodChannel.MethodCallHandler 24 | import io.flutter.plugin.common.MethodChannel.Result 25 | import io.flutter.plugin.common.PluginRegistry.ActivityResultListener 26 | import io.flutter.plugin.common.PluginRegistry.NewIntentListener 27 | import org.json.JSONObject 28 | 29 | 30 | /** OtplessFlutterPlugin */ 31 | class OtplessFlutterPlugin: FlutterPlugin, MethodCallHandler, ActivityAware, ActivityResultListener, NewIntentListener { 32 | /// The MethodChannel that will the communication between Flutter and native Android 33 | /// 34 | /// This local reference serves to register the plugin with the Flutter Engine and unregister it 35 | /// when the Flutter Engine is detached from the Activity 36 | private lateinit var channel : MethodChannel 37 | private lateinit var context: Context 38 | private lateinit var activity: Activity 39 | private lateinit var otplessView: OtplessView 40 | 41 | override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { 42 | channel = MethodChannel(flutterPluginBinding.binaryMessenger, "otpless_flutter") 43 | channel.setMethodCallHandler(this) 44 | context = flutterPluginBinding.applicationContext 45 | } 46 | 47 | override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) { 48 | // safe check 49 | if (!this::otplessView.isInitialized) return 50 | fun parseJsonArg(): JSONObject { 51 | val jsonString = call.argument("arg") 52 | val jsonObject = if (jsonString != null) { 53 | try { 54 | Log.d(Tag, "arg: $jsonString") 55 | JSONObject(jsonString) 56 | } catch (ex: Exception) { 57 | Log.d(Tag, "wrong json object is passed. error ${ex.message}") 58 | ex.printStackTrace() 59 | null 60 | } 61 | } else { 62 | Log.d(Tag, "No json object is passed.") 63 | null 64 | } 65 | if (jsonObject == null) { 66 | throw Exception("json argument not provided") 67 | } 68 | return jsonObject 69 | } 70 | when (call.method) { 71 | "openOtplessLoginPage" -> { 72 | result.success("") 73 | openOtplessLoginPage(parseJsonArg()) 74 | } 75 | 76 | "setLoaderVisibility" -> { 77 | val visibility = call.argument("arg") ?: true 78 | result.success("") 79 | activity.runOnUiThread { 80 | otplessView.setLoaderVisibility(visibility) 81 | } 82 | } 83 | 84 | "isWhatsAppInstalled" -> { 85 | result.success(Utility.isWhatsAppInstalled(activity)) 86 | } 87 | 88 | "startHeadless" -> { 89 | result.success("") 90 | startHeadless(parseJsonArg()) 91 | } 92 | 93 | "initHeadless" -> { 94 | val appId = call.argument("arg") ?: "" 95 | val timeout: Number = call.argument("timeout") ?: 30 96 | val loginUri = call.argument("loginUri") 97 | result.success("") 98 | activity.runOnUiThread { 99 | otplessView.initHeadless(appId, loginUri, timeout.toLong()) 100 | } 101 | } 102 | 103 | "setHeadlessCallback" -> { 104 | result.success("") 105 | otplessView.setHeadlessCallback(this::onHeadlessResultCallback) 106 | } 107 | 108 | "setWebviewInspectable" -> { 109 | // webview is always inspectable in debug mode 110 | } 111 | 112 | "enableDebugLogging" -> { 113 | val isEnabled = call.argument("arg") ?: false 114 | result.success("") 115 | Utility.debugLogging = isEnabled 116 | } 117 | 118 | "showPhoneHintLib" -> { 119 | val showFallback = call.argument("arg") ?: true 120 | showPhoneHint(showFallback) { 121 | result.success(it) 122 | } 123 | } 124 | 125 | "attachSecureService" -> { 126 | val appId = call.argument("appId") ?: "" 127 | attachSecureService(appId, result) 128 | } 129 | 130 | "getEjectedSimEntries" -> { 131 | val ejectedSimEntries = getEjectedSimsEntries() 132 | result.success(ejectedSimEntries) 133 | } 134 | 135 | "setSimEjectionListener" -> { 136 | val isAttach = call.argument("isAttach") ?: false 137 | setSimEjectionListener(isAttach) 138 | result.success(null) 139 | } 140 | 141 | "commitHeadlessResponse" -> { 142 | val response = call.argument>("response") ?: emptyMap() 143 | val headlessResponse = convertMapToHeadlessResponse(response) 144 | if (::otplessView.isInitialized) { 145 | otplessView.commitHeadlessResponse(headlessResponse) 146 | } 147 | } 148 | 149 | else -> { 150 | result.notImplemented() 151 | } 152 | } 153 | } 154 | 155 | private fun convertMapToHeadlessResponse(response: Map): HeadlessResponse? { 156 | if (response.isEmpty()) return null 157 | try { 158 | val responseType = response["responseType"].toString() 159 | val responseJson = JSONObject(response["response"] as Map) 160 | val statusCode = response["statusCode"].toString().softParseStatusCode() 161 | 162 | return HeadlessResponse( 163 | responseType, 164 | responseJson, 165 | statusCode 166 | ) 167 | } catch (_: Exception) { 168 | return null 169 | } 170 | } 171 | 172 | private fun openOtplessLoginPage(json:JSONObject) { 173 | val otplessRequest = OtplessRequest(json.getString("appId")) 174 | json.optJSONObject("params")?.let { params -> 175 | // checking and adding uxmode 176 | val uxMode = params.optString("uxmode") 177 | if (uxMode.isNotEmpty()) { 178 | otplessRequest.setUxmode(uxMode) 179 | params.remove("uxmode") 180 | } 181 | // checking and adding locale 182 | val locale = params.optString("locale") 183 | if (locale.isNotEmpty()) { 184 | otplessRequest.setLocale(locale) 185 | params.remove("locale") 186 | } 187 | // adding other extra params 188 | for (key in params.keys()) { 189 | val value = params.optString(key) 190 | if (value.isEmpty()) continue 191 | otplessRequest.addExtras(key, value) 192 | } 193 | } 194 | activity.runOnUiThread { 195 | otplessView.showOtplessLoginPage(otplessRequest) { 196 | Log.d(Tag, "callback openOtplessLoginPage with response $it") 197 | channel.invokeMethod("otpless_callback_event", it.toJsonString()) 198 | } 199 | } 200 | } 201 | 202 | private fun onHeadlessResultCallback(headlessResponse: HeadlessResponse) { 203 | Log.d(Tag, "callback openOtplessLoginPage with response $headlessResponse") 204 | channel.invokeMethod("otpless_callback_event", convertHeadlessResponseToJson(headlessResponse).toString()) 205 | } 206 | 207 | private fun startHeadless(json: JSONObject) { 208 | val headlessRequest = parseHeadlessRequest(json) 209 | activity.runOnUiThread { 210 | otplessView.startHeadless(headlessRequest, this::onHeadlessResultCallback) 211 | } 212 | } 213 | 214 | private fun parseHeadlessRequest(json: JSONObject): HeadlessRequest { 215 | val headlessRequest = HeadlessRequest() 216 | // check for phone 217 | val phone = json.optString("phone") 218 | if (phone.isNotEmpty()) { 219 | val countryCode = json.getString("countryCode") 220 | headlessRequest.setPhoneNumber(countryCode, phone) 221 | val otp = json.optString("otp") 222 | if (otp.isNotEmpty()) { 223 | headlessRequest.setOtp(otp) 224 | } 225 | } else { 226 | // check for email 227 | val email = json.optString("email") 228 | // check for otp in case of phone and email 229 | if (email.isNotEmpty()) { 230 | headlessRequest.setEmail(email) 231 | val otp = json.optString("otp") 232 | if (otp.isNotEmpty()) { 233 | headlessRequest.setOtp(otp) 234 | } 235 | } else { 236 | // check for channel type 237 | val channelType = json.getString("channelType") 238 | headlessRequest.setChannelType(channelType) 239 | } 240 | } 241 | // adding otp length and expiry 242 | json.optString("otpLength").softParseInt { 243 | headlessRequest.setOtpLength(OtpLength.suggestOtpSize(it)) 244 | } 245 | json.optString("expiry").softParseInt { 246 | headlessRequest.setExpiry(it) 247 | } 248 | // adding delivery channel 249 | val dChannelStr: String = json.optString("deliveryChannel") 250 | headlessRequest.setDeliveryChannel( 251 | OtpDeliveryChannel.from(dChannelStr.uppercase()) 252 | ) 253 | return headlessRequest 254 | } 255 | 256 | private inline fun String.softParseInt(onSuccessParse: (Int) -> Unit) { 257 | if (this.isEmpty()) return 258 | try { 259 | onSuccessParse(this.toInt()) 260 | } catch (ex: NumberFormatException) { 261 | Utility.debugLog(ex) 262 | } 263 | } 264 | 265 | private fun String.softParseStatusCode() : Int { 266 | if (this.isEmpty()) return -1000 267 | try { 268 | return this.toInt() 269 | } catch (e: NumberFormatException) { 270 | Utility.debugLog(e) 271 | return -1000 272 | } 273 | } 274 | 275 | fun onBackPressed(): Boolean { 276 | return otplessView.onBackPressed() 277 | } 278 | 279 | 280 | override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) { 281 | channel.setMethodCallHandler(null) 282 | } 283 | 284 | override fun onAttachedToActivity(binding: ActivityPluginBinding) { 285 | activity = binding.activity 286 | otplessView = OtplessManager.getInstance().getOtplessView(activity) 287 | otplessView.phoneHintManager.register(activity, false) 288 | binding.addActivityResultListener(this) 289 | binding.addOnNewIntentListener(this) 290 | } 291 | 292 | override fun onNewIntent(intent: Intent): Boolean { 293 | return otplessView.onNewIntent(intent) 294 | } 295 | 296 | override fun onDetachedFromActivityForConfigChanges() { 297 | return 298 | } 299 | 300 | override fun onReattachedToActivityForConfigChanges(binding: ActivityPluginBinding) { 301 | return 302 | } 303 | 304 | override fun onDetachedFromActivity() { 305 | return 306 | } 307 | 308 | companion object { 309 | private const val Tag = "OtplessFlutterPlugin" 310 | } 311 | 312 | override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?): Boolean { 313 | if (!this::otplessView.isInitialized) return false 314 | return otplessView.onActivityResult(requestCode, resultCode, data) 315 | } 316 | 317 | private fun showPhoneHint(showFallback: Boolean, onPhoneHintResult: (Map) -> Unit) { 318 | otplessView.phoneHintManager.showPhoneNumberHint(showFallback) { phoneHintResult -> 319 | val map = mutableMapOf( 320 | if (phoneHintResult.first != null) 321 | "phoneNumber" to phoneHintResult.first!! 322 | else 323 | "error" to phoneHintResult.second!!.message!! 324 | ) 325 | onPhoneHintResult(map) 326 | } 327 | } 328 | 329 | private fun attachSecureService(appId: String, result: Result) { 330 | try { 331 | val managerClass = Class.forName("com.otpless.secure.OtplessSecureManager") 332 | val managerInstance = managerClass.getField("INSTANCE").get(null) 333 | val creatorMethod = managerClass.getDeclaredMethod( 334 | "getOtplessSecureService", Activity::class.java, String::class.java) 335 | val secureService = creatorMethod.invoke(managerInstance, activity, appId) as? OtplessSecureService 336 | otplessView.attachOtplessSecureService(secureService) 337 | result.success("") 338 | } catch (ex: ClassNotFoundException) { 339 | Utility.debugLog(ex) 340 | result.error("SERVICE_ERROR", "Failed to create otpless service.", ex.message); 341 | } catch (ex: NoSuchMethodException) { 342 | Utility.debugLog(ex) 343 | result.error("SERVICE_ERROR", "Failed to create otpless service.", ex.message); 344 | } 345 | } 346 | 347 | private fun getEjectedSimsEntries(): List> { 348 | val result = mutableListOf>() 349 | for (each in OtplessSimStateReceiverApi.savedEjectedSimEntries(activity)) { 350 | result.add( 351 | mapOf( 352 | "state" to each.state, 353 | "transactionTime" to each.transactionTime 354 | ) 355 | ) 356 | } 357 | return result 358 | } 359 | 360 | private fun setSimEjectionListener(isToAttach: Boolean) { 361 | if (isToAttach) OtplessSimStateReceiverApi.setSimStateChangeListener { 362 | val result = mutableListOf>() 363 | for (each in OtplessSimStateReceiverApi.savedEjectedSimEntries(activity)) { 364 | result.add( 365 | mapOf( 366 | "state" to each.state, 367 | "transactionTime" to each.transactionTime 368 | ) 369 | ) 370 | } 371 | channel.invokeMethod("otpless_sim_status_change_event", result) 372 | } else OtplessSimStateReceiverApi.setSimStateChangeListener(null) 373 | } 374 | } 375 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 54; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 6B0AF698EC87F0DC54CEF7ED /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DF045C5B4571B3DBE494F1DA /* Pods_Runner.framework */; }; 13 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 14 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 15 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 16 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXCopyFilesBuildPhase section */ 20 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 21 | isa = PBXCopyFilesBuildPhase; 22 | buildActionMask = 2147483647; 23 | dstPath = ""; 24 | dstSubfolderSpec = 10; 25 | files = ( 26 | ); 27 | name = "Embed Frameworks"; 28 | runOnlyForDeploymentPostprocessing = 0; 29 | }; 30 | /* End PBXCopyFilesBuildPhase section */ 31 | 32 | /* Begin PBXFileReference section */ 33 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 34 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 35 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 36 | 425EA1840AE8C5E35A077E25 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 37 | 542A88A72C75D2A7001F21B0 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = ""; }; 38 | 6AD2B6F1CA63C7AC68B35AE9 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 39 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 40 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 41 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 42 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 43 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 44 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 45 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 46 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 47 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 48 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 49 | DF045C5B4571B3DBE494F1DA /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | F0852BCBF293C9F584D84425 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 51 | /* End PBXFileReference section */ 52 | 53 | /* Begin PBXFrameworksBuildPhase section */ 54 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 55 | isa = PBXFrameworksBuildPhase; 56 | buildActionMask = 2147483647; 57 | files = ( 58 | 6B0AF698EC87F0DC54CEF7ED /* Pods_Runner.framework in Frameworks */, 59 | ); 60 | runOnlyForDeploymentPostprocessing = 0; 61 | }; 62 | /* End PBXFrameworksBuildPhase section */ 63 | 64 | /* Begin PBXGroup section */ 65 | 8C624E75B1B63E100589B815 /* Pods */ = { 66 | isa = PBXGroup; 67 | children = ( 68 | 425EA1840AE8C5E35A077E25 /* Pods-Runner.debug.xcconfig */, 69 | F0852BCBF293C9F584D84425 /* Pods-Runner.release.xcconfig */, 70 | 6AD2B6F1CA63C7AC68B35AE9 /* Pods-Runner.profile.xcconfig */, 71 | ); 72 | path = Pods; 73 | sourceTree = ""; 74 | }; 75 | 9740EEB11CF90186004384FC /* Flutter */ = { 76 | isa = PBXGroup; 77 | children = ( 78 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 79 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 80 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 81 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 82 | ); 83 | name = Flutter; 84 | sourceTree = ""; 85 | }; 86 | 97C146E51CF9000F007C117D = { 87 | isa = PBXGroup; 88 | children = ( 89 | 9740EEB11CF90186004384FC /* Flutter */, 90 | 97C146F01CF9000F007C117D /* Runner */, 91 | 97C146EF1CF9000F007C117D /* Products */, 92 | 8C624E75B1B63E100589B815 /* Pods */, 93 | AF436B8381EF4FAAFD2B6EC1 /* Frameworks */, 94 | ); 95 | sourceTree = ""; 96 | }; 97 | 97C146EF1CF9000F007C117D /* Products */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | 97C146EE1CF9000F007C117D /* Runner.app */, 101 | ); 102 | name = Products; 103 | sourceTree = ""; 104 | }; 105 | 97C146F01CF9000F007C117D /* Runner */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | 542A88A72C75D2A7001F21B0 /* Runner.entitlements */, 109 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 110 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 111 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 112 | 97C147021CF9000F007C117D /* Info.plist */, 113 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 114 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 115 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 116 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 117 | ); 118 | path = Runner; 119 | sourceTree = ""; 120 | }; 121 | AF436B8381EF4FAAFD2B6EC1 /* Frameworks */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | DF045C5B4571B3DBE494F1DA /* Pods_Runner.framework */, 125 | ); 126 | name = Frameworks; 127 | sourceTree = ""; 128 | }; 129 | /* End PBXGroup section */ 130 | 131 | /* Begin PBXNativeTarget section */ 132 | 97C146ED1CF9000F007C117D /* Runner */ = { 133 | isa = PBXNativeTarget; 134 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 135 | buildPhases = ( 136 | F34204D15D81721512780862 /* [CP] Check Pods Manifest.lock */, 137 | 9740EEB61CF901F6004384FC /* Run Script */, 138 | 97C146EA1CF9000F007C117D /* Sources */, 139 | 97C146EB1CF9000F007C117D /* Frameworks */, 140 | 97C146EC1CF9000F007C117D /* Resources */, 141 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 142 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 143 | F5B57637133D7AF280FF9B63 /* [CP] Embed Pods Frameworks */, 144 | ); 145 | buildRules = ( 146 | ); 147 | dependencies = ( 148 | ); 149 | name = Runner; 150 | productName = Runner; 151 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 152 | productType = "com.apple.product-type.application"; 153 | }; 154 | /* End PBXNativeTarget section */ 155 | 156 | /* Begin PBXProject section */ 157 | 97C146E61CF9000F007C117D /* Project object */ = { 158 | isa = PBXProject; 159 | attributes = { 160 | LastUpgradeCheck = 1510; 161 | ORGANIZATIONNAME = ""; 162 | TargetAttributes = { 163 | 97C146ED1CF9000F007C117D = { 164 | CreatedOnToolsVersion = 7.3.1; 165 | LastSwiftMigration = 1100; 166 | }; 167 | }; 168 | }; 169 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 170 | compatibilityVersion = "Xcode 9.3"; 171 | developmentRegion = en; 172 | hasScannedForEncodings = 0; 173 | knownRegions = ( 174 | en, 175 | Base, 176 | ); 177 | mainGroup = 97C146E51CF9000F007C117D; 178 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 179 | projectDirPath = ""; 180 | projectRoot = ""; 181 | targets = ( 182 | 97C146ED1CF9000F007C117D /* Runner */, 183 | ); 184 | }; 185 | /* End PBXProject section */ 186 | 187 | /* Begin PBXResourcesBuildPhase section */ 188 | 97C146EC1CF9000F007C117D /* Resources */ = { 189 | isa = PBXResourcesBuildPhase; 190 | buildActionMask = 2147483647; 191 | files = ( 192 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 193 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 194 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 195 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 196 | ); 197 | runOnlyForDeploymentPostprocessing = 0; 198 | }; 199 | /* End PBXResourcesBuildPhase section */ 200 | 201 | /* Begin PBXShellScriptBuildPhase section */ 202 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 203 | isa = PBXShellScriptBuildPhase; 204 | alwaysOutOfDate = 1; 205 | buildActionMask = 2147483647; 206 | files = ( 207 | ); 208 | inputPaths = ( 209 | "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", 210 | ); 211 | name = "Thin Binary"; 212 | outputPaths = ( 213 | ); 214 | runOnlyForDeploymentPostprocessing = 0; 215 | shellPath = /bin/sh; 216 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 217 | }; 218 | 9740EEB61CF901F6004384FC /* Run Script */ = { 219 | isa = PBXShellScriptBuildPhase; 220 | alwaysOutOfDate = 1; 221 | buildActionMask = 2147483647; 222 | files = ( 223 | ); 224 | inputPaths = ( 225 | ); 226 | name = "Run Script"; 227 | outputPaths = ( 228 | ); 229 | runOnlyForDeploymentPostprocessing = 0; 230 | shellPath = /bin/sh; 231 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 232 | }; 233 | F34204D15D81721512780862 /* [CP] Check Pods Manifest.lock */ = { 234 | isa = PBXShellScriptBuildPhase; 235 | buildActionMask = 2147483647; 236 | files = ( 237 | ); 238 | inputFileListPaths = ( 239 | ); 240 | inputPaths = ( 241 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 242 | "${PODS_ROOT}/Manifest.lock", 243 | ); 244 | name = "[CP] Check Pods Manifest.lock"; 245 | outputFileListPaths = ( 246 | ); 247 | outputPaths = ( 248 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 249 | ); 250 | runOnlyForDeploymentPostprocessing = 0; 251 | shellPath = /bin/sh; 252 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 253 | showEnvVarsInLog = 0; 254 | }; 255 | F5B57637133D7AF280FF9B63 /* [CP] Embed Pods Frameworks */ = { 256 | isa = PBXShellScriptBuildPhase; 257 | buildActionMask = 2147483647; 258 | files = ( 259 | ); 260 | inputFileListPaths = ( 261 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", 262 | ); 263 | name = "[CP] Embed Pods Frameworks"; 264 | outputFileListPaths = ( 265 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", 266 | ); 267 | runOnlyForDeploymentPostprocessing = 0; 268 | shellPath = /bin/sh; 269 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 270 | showEnvVarsInLog = 0; 271 | }; 272 | /* End PBXShellScriptBuildPhase section */ 273 | 274 | /* Begin PBXSourcesBuildPhase section */ 275 | 97C146EA1CF9000F007C117D /* Sources */ = { 276 | isa = PBXSourcesBuildPhase; 277 | buildActionMask = 2147483647; 278 | files = ( 279 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 280 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 281 | ); 282 | runOnlyForDeploymentPostprocessing = 0; 283 | }; 284 | /* End PBXSourcesBuildPhase section */ 285 | 286 | /* Begin PBXVariantGroup section */ 287 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 288 | isa = PBXVariantGroup; 289 | children = ( 290 | 97C146FB1CF9000F007C117D /* Base */, 291 | ); 292 | name = Main.storyboard; 293 | sourceTree = ""; 294 | }; 295 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 296 | isa = PBXVariantGroup; 297 | children = ( 298 | 97C147001CF9000F007C117D /* Base */, 299 | ); 300 | name = LaunchScreen.storyboard; 301 | sourceTree = ""; 302 | }; 303 | /* End PBXVariantGroup section */ 304 | 305 | /* Begin XCBuildConfiguration section */ 306 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 307 | isa = XCBuildConfiguration; 308 | buildSettings = { 309 | ALWAYS_SEARCH_USER_PATHS = NO; 310 | CLANG_ANALYZER_NONNULL = YES; 311 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 312 | CLANG_CXX_LIBRARY = "libc++"; 313 | CLANG_ENABLE_MODULES = YES; 314 | CLANG_ENABLE_OBJC_ARC = YES; 315 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 316 | CLANG_WARN_BOOL_CONVERSION = YES; 317 | CLANG_WARN_COMMA = YES; 318 | CLANG_WARN_CONSTANT_CONVERSION = YES; 319 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 320 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 321 | CLANG_WARN_EMPTY_BODY = YES; 322 | CLANG_WARN_ENUM_CONVERSION = YES; 323 | CLANG_WARN_INFINITE_RECURSION = YES; 324 | CLANG_WARN_INT_CONVERSION = YES; 325 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 326 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 327 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 328 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 329 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 330 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 331 | CLANG_WARN_STRICT_PROTOTYPES = YES; 332 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 333 | CLANG_WARN_UNREACHABLE_CODE = YES; 334 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 335 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 336 | COPY_PHASE_STRIP = NO; 337 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 338 | ENABLE_NS_ASSERTIONS = NO; 339 | ENABLE_STRICT_OBJC_MSGSEND = YES; 340 | GCC_C_LANGUAGE_STANDARD = gnu99; 341 | GCC_NO_COMMON_BLOCKS = YES; 342 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 343 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 344 | GCC_WARN_UNDECLARED_SELECTOR = YES; 345 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 346 | GCC_WARN_UNUSED_FUNCTION = YES; 347 | GCC_WARN_UNUSED_VARIABLE = YES; 348 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 349 | MTL_ENABLE_DEBUG_INFO = NO; 350 | SDKROOT = iphoneos; 351 | SUPPORTED_PLATFORMS = iphoneos; 352 | TARGETED_DEVICE_FAMILY = "1,2"; 353 | VALIDATE_PRODUCT = YES; 354 | }; 355 | name = Profile; 356 | }; 357 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 358 | isa = XCBuildConfiguration; 359 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 360 | buildSettings = { 361 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 362 | CLANG_ENABLE_MODULES = YES; 363 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; 364 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 365 | DEVELOPMENT_TEAM = LRPGAA2922; 366 | ENABLE_BITCODE = NO; 367 | FLUTTER_BUILD_NUMBER = 1001; 368 | INFOPLIST_FILE = Runner/Info.plist; 369 | IPHONEOS_DEPLOYMENT_TARGET = 13.0; 370 | LD_RUNPATH_SEARCH_PATHS = ( 371 | "$(inherited)", 372 | "@executable_path/Frameworks", 373 | ); 374 | PRODUCT_BUNDLE_IDENTIFIER = com.example.otplessFlutterExample; 375 | PRODUCT_NAME = "$(TARGET_NAME)"; 376 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 377 | SWIFT_VERSION = 5.0; 378 | VERSIONING_SYSTEM = "apple-generic"; 379 | }; 380 | name = Profile; 381 | }; 382 | 97C147031CF9000F007C117D /* Debug */ = { 383 | isa = XCBuildConfiguration; 384 | buildSettings = { 385 | ALWAYS_SEARCH_USER_PATHS = NO; 386 | CLANG_ANALYZER_NONNULL = YES; 387 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 388 | CLANG_CXX_LIBRARY = "libc++"; 389 | CLANG_ENABLE_MODULES = YES; 390 | CLANG_ENABLE_OBJC_ARC = YES; 391 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 392 | CLANG_WARN_BOOL_CONVERSION = YES; 393 | CLANG_WARN_COMMA = YES; 394 | CLANG_WARN_CONSTANT_CONVERSION = YES; 395 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 396 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 397 | CLANG_WARN_EMPTY_BODY = YES; 398 | CLANG_WARN_ENUM_CONVERSION = YES; 399 | CLANG_WARN_INFINITE_RECURSION = YES; 400 | CLANG_WARN_INT_CONVERSION = YES; 401 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 402 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 403 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 404 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 405 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 406 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 407 | CLANG_WARN_STRICT_PROTOTYPES = YES; 408 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 409 | CLANG_WARN_UNREACHABLE_CODE = YES; 410 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 411 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 412 | COPY_PHASE_STRIP = NO; 413 | DEBUG_INFORMATION_FORMAT = dwarf; 414 | ENABLE_STRICT_OBJC_MSGSEND = YES; 415 | ENABLE_TESTABILITY = YES; 416 | GCC_C_LANGUAGE_STANDARD = gnu99; 417 | GCC_DYNAMIC_NO_PIC = NO; 418 | GCC_NO_COMMON_BLOCKS = YES; 419 | GCC_OPTIMIZATION_LEVEL = 0; 420 | GCC_PREPROCESSOR_DEFINITIONS = ( 421 | "DEBUG=1", 422 | "$(inherited)", 423 | ); 424 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 425 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 426 | GCC_WARN_UNDECLARED_SELECTOR = YES; 427 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 428 | GCC_WARN_UNUSED_FUNCTION = YES; 429 | GCC_WARN_UNUSED_VARIABLE = YES; 430 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 431 | MTL_ENABLE_DEBUG_INFO = YES; 432 | ONLY_ACTIVE_ARCH = YES; 433 | SDKROOT = iphoneos; 434 | TARGETED_DEVICE_FAMILY = "1,2"; 435 | }; 436 | name = Debug; 437 | }; 438 | 97C147041CF9000F007C117D /* Release */ = { 439 | isa = XCBuildConfiguration; 440 | buildSettings = { 441 | ALWAYS_SEARCH_USER_PATHS = NO; 442 | CLANG_ANALYZER_NONNULL = YES; 443 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 444 | CLANG_CXX_LIBRARY = "libc++"; 445 | CLANG_ENABLE_MODULES = YES; 446 | CLANG_ENABLE_OBJC_ARC = YES; 447 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 448 | CLANG_WARN_BOOL_CONVERSION = YES; 449 | CLANG_WARN_COMMA = YES; 450 | CLANG_WARN_CONSTANT_CONVERSION = YES; 451 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 452 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 453 | CLANG_WARN_EMPTY_BODY = YES; 454 | CLANG_WARN_ENUM_CONVERSION = YES; 455 | CLANG_WARN_INFINITE_RECURSION = YES; 456 | CLANG_WARN_INT_CONVERSION = YES; 457 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 458 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 459 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 460 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 461 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 462 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 463 | CLANG_WARN_STRICT_PROTOTYPES = YES; 464 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 465 | CLANG_WARN_UNREACHABLE_CODE = YES; 466 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 467 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 468 | COPY_PHASE_STRIP = NO; 469 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 470 | ENABLE_NS_ASSERTIONS = NO; 471 | ENABLE_STRICT_OBJC_MSGSEND = YES; 472 | GCC_C_LANGUAGE_STANDARD = gnu99; 473 | GCC_NO_COMMON_BLOCKS = YES; 474 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 475 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 476 | GCC_WARN_UNDECLARED_SELECTOR = YES; 477 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 478 | GCC_WARN_UNUSED_FUNCTION = YES; 479 | GCC_WARN_UNUSED_VARIABLE = YES; 480 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 481 | MTL_ENABLE_DEBUG_INFO = NO; 482 | SDKROOT = iphoneos; 483 | SUPPORTED_PLATFORMS = iphoneos; 484 | SWIFT_COMPILATION_MODE = wholemodule; 485 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 486 | TARGETED_DEVICE_FAMILY = "1,2"; 487 | VALIDATE_PRODUCT = YES; 488 | }; 489 | name = Release; 490 | }; 491 | 97C147061CF9000F007C117D /* Debug */ = { 492 | isa = XCBuildConfiguration; 493 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 494 | buildSettings = { 495 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 496 | CLANG_ENABLE_MODULES = YES; 497 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; 498 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 499 | DEVELOPMENT_TEAM = LRPGAA2922; 500 | ENABLE_BITCODE = NO; 501 | FLUTTER_BUILD_NUMBER = 1001; 502 | INFOPLIST_FILE = Runner/Info.plist; 503 | IPHONEOS_DEPLOYMENT_TARGET = 13.0; 504 | LD_RUNPATH_SEARCH_PATHS = ( 505 | "$(inherited)", 506 | "@executable_path/Frameworks", 507 | ); 508 | PRODUCT_BUNDLE_IDENTIFIER = com.example.otplessFlutterExample; 509 | PRODUCT_NAME = "$(TARGET_NAME)"; 510 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 511 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 512 | SWIFT_VERSION = 5.0; 513 | VERSIONING_SYSTEM = "apple-generic"; 514 | }; 515 | name = Debug; 516 | }; 517 | 97C147071CF9000F007C117D /* Release */ = { 518 | isa = XCBuildConfiguration; 519 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 520 | buildSettings = { 521 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 522 | CLANG_ENABLE_MODULES = YES; 523 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; 524 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 525 | DEVELOPMENT_TEAM = LRPGAA2922; 526 | ENABLE_BITCODE = NO; 527 | FLUTTER_BUILD_NUMBER = 1001; 528 | INFOPLIST_FILE = Runner/Info.plist; 529 | IPHONEOS_DEPLOYMENT_TARGET = 13.0; 530 | LD_RUNPATH_SEARCH_PATHS = ( 531 | "$(inherited)", 532 | "@executable_path/Frameworks", 533 | ); 534 | PRODUCT_BUNDLE_IDENTIFIER = com.example.otplessFlutterExample; 535 | PRODUCT_NAME = "$(TARGET_NAME)"; 536 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 537 | SWIFT_VERSION = 5.0; 538 | VERSIONING_SYSTEM = "apple-generic"; 539 | }; 540 | name = Release; 541 | }; 542 | /* End XCBuildConfiguration section */ 543 | 544 | /* Begin XCConfigurationList section */ 545 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 546 | isa = XCConfigurationList; 547 | buildConfigurations = ( 548 | 97C147031CF9000F007C117D /* Debug */, 549 | 97C147041CF9000F007C117D /* Release */, 550 | 249021D3217E4FDB00AE95B9 /* Profile */, 551 | ); 552 | defaultConfigurationIsVisible = 0; 553 | defaultConfigurationName = Release; 554 | }; 555 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 556 | isa = XCConfigurationList; 557 | buildConfigurations = ( 558 | 97C147061CF9000F007C117D /* Debug */, 559 | 97C147071CF9000F007C117D /* Release */, 560 | 249021D4217E4FDB00AE95B9 /* Profile */, 561 | ); 562 | defaultConfigurationIsVisible = 0; 563 | defaultConfigurationName = Release; 564 | }; 565 | /* End XCConfigurationList section */ 566 | }; 567 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 568 | } 569 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------