Updates & fixes

merge-update-with-lab-changes
haroon amjad 11 months ago
parent 229efb2e25
commit b677be9e3c

@ -213,7 +213,8 @@ dependencies {
implementation 'com.google.android.material:material:1.9.0'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.22'
androidTestImplementation "androidx.test:core:1.4.0"
implementation 'com.airbnb.android:lottie:5.2.0'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.22'
// implementation 'com.airbnb.android:lottie:5.2.0'
// implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.22'
implementation 'com.whatsapp.otp:whatsapp-otp-android-sdk:0.1.0'
}

@ -71,6 +71,8 @@
<intent>
<action android:name="android.speech.RecognitionService" />
</intent>
<package android:name="com.whatsapp"/>
<package android:name="com.whatsapp.w4b"/>
</queries>
<application
android:name=".Application"
@ -92,6 +94,7 @@
android:showOnLockScreen="true"
android:theme="@style/LaunchTheme"
android:exported="true"
android:enabled="true"
tools:node="merge"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
@ -109,7 +112,9 @@
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background" />
<intent-filter>
<action android:name="com.whatsapp.otp.OTP_RETRIEVED" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />

@ -11,6 +11,9 @@ import com.ejada.hmg.utils.*
import io.flutter.embedding.android.FlutterFragmentActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugins.GeneratedPluginRegistrant
import com.cloud.diplomaticquarterapp.whatsapp.WhatsApp
import com.cloud.diplomaticquarterapp.whatsapp.WhatsAppOtpPlatformBridge
class MainActivity: FlutterFragmentActivity() {
@RequiresApi(Build.VERSION_CODES.O)
@ -22,6 +25,10 @@ class MainActivity: FlutterFragmentActivity() {
PlatformBridge(flutterEngine, this).create()
OpenTokPlatformBridge(flutterEngine, this).create()
PenguinInPlatformBridge(flutterEngine, this).create()
WhatsAppOtpPlatformBridge(flutterEngine, this).invoke()
WhatsApp.handleOTP(intent){code ->
WhatsAppOtpPlatformBridge.result?.success(code);
}
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// val mChannel = NotificationChannel("video_call_noti", "video call", NotificationManager.IMPORTANCE_HIGH)

@ -600,7 +600,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 4.5.991;
MARKETING_VERSION = 4.5.998;
PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@ -751,7 +751,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 4.5.991;
MARKETING_VERSION = 4.5.998;
PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@ -794,7 +794,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 4.5.991;
MARKETING_VERSION = 4.5.998;
PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";

@ -21,8 +21,8 @@ var PACKAGES_ORDERS = '/api/orders';
var PACKAGES_ORDER_HISTORY = '/api/orders/items';
var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// var BASE_URL = 'http://10.50.100.198:2018/';
// var BASE_URL = 'https://uat.hmgwebservices.com/';
var BASE_URL = 'https://hmgwebservices.com/';
var BASE_URL = 'https://uat.hmgwebservices.com/';
// var BASE_URL = 'https://hmgwebservices.com/';
// var BASE_URL = 'https://orash.cloudsolutions.com.sa/';
// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/';
// var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/';
@ -697,10 +697,10 @@ var GET_PATIENT_OCCUPATION_LIST = 'Services/Authentication.svc/REST/GetPatientOc
//PAYFORT
var getPayFortProjectDetails = "Services/PayFort_Serv.svc/REST/GetPayFortProjectDetails";
var addPayFortApplePayResponse = "Services/PayFort_Serv.svc/REST/AddResponse";
var payFortEnvironment = FortEnvironment.production;
var applePayMerchantId = "merchant.com.hmgwebservices";
// var payFortEnvironment = FortEnvironment.test;
// var applePayMerchantId = "merchant.com.hmgwebservices.uat";
// var payFortEnvironment = FortEnvironment.production;
// var applePayMerchantId = "merchant.com.hmgwebservices";
var payFortEnvironment = FortEnvironment.test;
var applePayMerchantId = "merchant.com.hmgwebservices.uat";
class AppGlobal {
static var context;

@ -230,36 +230,6 @@ class _LiveCarePatmentPageState extends State<LiveCarePatmentPage> {
),
),
mHeight(32.0),
AutoSizeText(
TranslationBase.of(context).selectedCallType,
maxLines: 1,
minFontSize: 12,
style: TextStyle(
fontSize: SizeConfig.textMultiplier! * 2.0,
fontWeight: FontWeight.w600,
letterSpacing: -0.39,
height: 0.8,
),
),
mHeight(12.0),
Row(
children: <Widget>[
SvgPicture.asset(
getCallTypeImagePath(),
width: 18,
height: 18,
),
mWidth(10),
Text(
getCallTypeText(),
style: TextStyle(
fontSize: 14.0,
letterSpacing: -0.4,
fontWeight: FontWeight.w600,
),
),
],
),
Container(
margin: EdgeInsets.only(top: 16.0),
child: Row(
@ -300,6 +270,36 @@ class _LiveCarePatmentPageState extends State<LiveCarePatmentPage> {
],
),
),
AutoSizeText(
TranslationBase.of(context).selectedCallType,
maxLines: 1,
minFontSize: 12,
style: TextStyle(
fontSize: SizeConfig.textMultiplier! * 2.0,
fontWeight: FontWeight.w600,
letterSpacing: -0.39,
height: 0.8,
),
),
mHeight(12.0),
Row(
children: <Widget>[
SvgPicture.asset(
getCallTypeImagePath(),
width: 18,
height: 18,
),
mWidth(10),
Text(
getCallTypeText(),
style: TextStyle(
fontSize: 14.0,
letterSpacing: -0.4,
fontWeight: FontWeight.w600,
),
),
],
),
mFlex(1),
Text(
TranslationBase.of(context).upComingPayOption,

@ -30,6 +30,7 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/whatsapp_method_channel.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -344,7 +345,12 @@ class _ConfirmLogin extends State<ConfirmLogin> {
sharedPref.setInt(LAST_LOGIN, this.selectedOption); //this.cs.sharedService.setStorage(this.selectedOption, AuthenticationService.LAST_LOGIN);
}
loginWithSMS(type) {
loginWithSMS(type) async {
// if (type == 4) {
// var channel = WhatsappMethodChannel();
// await channel.handleHandShake();
// }
//if (!el.disabled) {
if (this.user != null && this.registerd_data == null) {
this.checkUserAuthentication(type);

@ -0,0 +1,32 @@
import 'dart:async';
import 'package:flutter/services.dart';
class WhatsappMethodChannel {
static const MethodChannel _channel = MethodChannel('whats_app_otp');
FutureOr<void> handleHandShake() async {
try {
await _channel.invokeMethod("performHandShake");
} on PlatformException catch (e) {
print("Failed to launch PenguinIn: '${e.message}'.");
}
}
Future<bool> isWhatsAppInstalled() async {
try {
return await _channel.invokeMethod("isWhatsAppInstalled");
} catch (e) {
return false;
}
}
Future<String> startListening() async {
try{
return await _channel.invokeMethod("startListening");
}catch(e){
return "";
}
}
}

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/whatsapp_method_channel.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:provider/provider.dart';
@ -296,6 +297,17 @@ class SMSOTP {
SmsVerification.stopListening();
// });
});
WhatsappMethodChannel().startListening().then((message) {
// setState(() {
final intRegex = RegExp(r'\d+', multiLine: true);
var otp = SmsVerification.getCode(message, intRegex);
_pinPutController.text = otp;
onSuccess(otp);
SmsVerification.stopListening();
// });
});
}
// startLister() {

Loading…
Cancel
Save