dev_3.3_Queueing
haroon amjad 9 months ago
parent b42c47f074
commit 162b2fd22a

@ -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:4422/';
// 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 = 'http://10.20.200.111:1010/';
// var BASE_URL = 'https://uat.hmgwebservices.com/';
// var BASE_URL = 'https://hmgwebservices.com/';

@ -81,10 +81,6 @@ class _MyApp extends State<MyApp> {
Widget build(BuildContext context) {
PlatformBridge.init(context);
LocalNotification.init(onNotificationClick: (payload) {
LocalNotification.getInstance().showNow(title: "Payload", subtitle: payload, payload: payload);
});
// SystemChrome.setPreferredOrientations([
// DeviceOrientation.portraitUp,
// DeviceOrientation.portraitDown,

@ -303,6 +303,9 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
familyFileProvider.getSharedRecordByStatus(languageID);
}
// Future.delayed(Duration(seconds: 3)).then((result) async {
// LocalNotification.getInstance().showNow(title: "Payload Update", subtitle: "Payload Update", payload: "Payload Update");
// });
});
PayfortViewModel payfortViewModel = context.read<PayfortViewModel>();

@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/theme/theme_notifier.dart';
import 'package:diplomaticquarterapp/theme/theme_value.dart';
import 'package:diplomaticquarterapp/uitl/LocalNotification.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/push-notification-handler.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -37,6 +38,8 @@ class _SplashScreenState extends State<SplashScreen> {
Duration(seconds: 1, milliseconds: 500),
() async {
await loadPrivilege().then((value) {
LocalNotification.init(onNotificationClick: (payload) {});
// LocalNotification.getInstance().showNow(title: "Payload", subtitle: "Subtitle", payload: "Payload");
if(!_privilegeService.hasError) {
Navigator.of(context).pushReplacement(
MaterialPageRoute(

@ -31,25 +31,27 @@ class LocalNotification {
_initialize() async {
try {
var initializationSettingsAndroid = new AndroidInitializationSettings('app_icon');
// var initializationSettingsIOS = DarwinInitializationSettings(onDidReceiveLocalNotification: null);
// var initializationSettings = InitializationSettings(android: initializationSettingsAndroid, iOS: initializationSettingsIOS);
// await flutterLocalNotificationsPlugin.initialize(
// initializationSettings,
// onDidReceiveNotificationResponse: (NotificationResponse notificationResponse) {
// switch (notificationResponse.notificationResponseType) {
// case NotificationResponseType.selectedNotification:
// // selectNotificationStream.add(notificationResponse.payload);
// break;
// case NotificationResponseType.selectedNotificationAction:
// // if (notificationResponse.actionId == navigationActionId) {
// // selectNotificationStream.add(notificationResponse.payload);
// // }
// break;
// }
// },
// onDidReceiveBackgroundNotificationResponse: notificationTapBackground,
// );
} catch (ex) {}
var initializationSettingsIOS = DarwinInitializationSettings(onDidReceiveLocalNotification: null);
var initializationSettings = InitializationSettings(android: initializationSettingsAndroid, iOS: initializationSettingsIOS);
await flutterLocalNotificationsPlugin.initialize(
initializationSettings,
onDidReceiveNotificationResponse: (NotificationResponse notificationResponse) {
switch (notificationResponse.notificationResponseType) {
case NotificationResponseType.selectedNotification:
// selectNotificationStream.add(notificationResponse.payload);
break;
case NotificationResponseType.selectedNotificationAction:
// if (notificationResponse.actionId == navigationActionId) {
// selectNotificationStream.add(notificationResponse.payload);
// }
break;
}
},
// onDidReceiveBackgroundNotificationResponse: notificationTapBackground,
);
} catch (ex) {
print(ex.toString());
}
// flutterLocalNotificationsPlugin.initialize(initializationSettings, onDidReceiveNotificationResponse: (NotificationResponse notificationResponse)
// {
// switch (notificationResponse.notificationResponseType) {
@ -96,15 +98,26 @@ class LocalNotification {
}
Future showNow({@required String title, @required String subtitle, String payload}) {
// Future.delayed(Duration(seconds: 1)).then((result) async {
// var androidPlatformChannelSpecifics = AndroidNotificationDetails('com.hmg.local_notification', 'HMG',
// channelDescription: 'HMG', importance: Importance.max, priority: Priority.high, ticker: 'ticker', vibrationPattern: _vibrationPattern());
// var iOSPlatformChannelSpecifics = DarwinNotificationDetails();
// var platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics);
// await flutterLocalNotificationsPlugin.show(_randomNumber(), title, subtitle, platformChannelSpecifics, payload: payload).catchError((err) {
// print(err);
// });
// });
Future.delayed(Duration(seconds: 1)).then((result) async {
var androidPlatformChannelSpecifics = AndroidNotificationDetails(
'com.hmg.local_notification',
'HMG',
channelDescription: 'HMG',
importance: Importance.max,
priority: Priority.high,
ticker: 'ticker',
vibrationPattern: _vibrationPattern(),
ongoing: true,
autoCancel: false,
usesChronometer: true,
when: DateTime.now().millisecondsSinceEpoch - 120 * 1000,
);
var iOSPlatformChannelSpecifics = DarwinNotificationDetails();
var platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics);
await flutterLocalNotificationsPlugin.show(25613, title, subtitle, platformChannelSpecifics, payload: payload).catchError((err) {
print(err);
});
});
}
Future scheduleNotification({@required DateTime scheduledNotificationDateTime, @required String title, @required String description}) async {
@ -115,7 +128,7 @@ class LocalNotification {
vibrationPattern[2] = 5000;
vibrationPattern[3] = 2000;
// var androidPlatformChannelSpecifics = AndroidNotificationDetails('active-prescriptions', 'ActivePrescriptions',
// var androidPlatformChannelSpecifics = AndroidNotificationDetails('active-prescriptions', 'ActivePrescriptions',
// channelDescription: 'ActivePrescriptionsDescription',
// // icon: 'secondary_icon',
// sound: RawResourceAndroidNotificationSound('slow_spring_board'),

Loading…
Cancel
Save