├── .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 | [](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