v 3.2.1
This commit is contained in:
parent
fa0bfd8746
commit
c87859d46e
|
|
@ -1,7 +1,4 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:android_intent_plus/android_intent.dart';
|
||||
import 'package:awesome_notifications/awesome_notifications.dart';
|
||||
import 'package:bot_toast/bot_toast.dart';
|
||||
import 'package:didvan/config/theme_data.dart';
|
||||
import 'package:didvan/models/notification_message.dart';
|
||||
|
|
@ -12,14 +9,10 @@ import 'package:didvan/routes/route_generator.dart';
|
|||
import 'package:didvan/routes/routes.dart';
|
||||
import 'package:didvan/services/app_home_widget/home_widget_repository.dart';
|
||||
import 'package:didvan/services/app_initalizer.dart';
|
||||
import 'package:didvan/services/notification/awsome/awsome_notification_controller.dart';
|
||||
import 'package:didvan/services/notification/awsome/awsome_notification_handler.dart';
|
||||
import 'package:didvan/services/notification/fcm/firebase_notification_handler.dart';
|
||||
import 'package:didvan/views/podcasts/podcasts_state.dart';
|
||||
import 'package:didvan/views/podcasts/studio_details/studio_details_state.dart';
|
||||
import 'package:firebase_core/firebase_core.dart';
|
||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:home_widget/home_widget.dart';
|
||||
|
|
@ -104,7 +97,7 @@ class _DidvanState extends State<Didvan> with WidgetsBindingObserver {
|
|||
await HomeWidgetRepository.decideWhereToGo();
|
||||
|
||||
NotificationMessage? data = HomeWidgetRepository.data;
|
||||
print("hhhhshahahjsfghasgfhjgfsahjghgfhgsahfghsag $data");
|
||||
|
||||
if (data != null) {
|
||||
await HomeWidgetRepository.decideWhereToGoNotif();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -149,6 +149,8 @@ class HomeWidgetRepository {
|
|||
}
|
||||
}
|
||||
await HomeWidget.saveWidgetData("uri", "");
|
||||
data = null;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -184,7 +184,6 @@ class AppInitializer {
|
|||
final initMsg = await FirebaseMessaging.instance.getInitialMessage();
|
||||
|
||||
if (initMsg != null) {
|
||||
print("aaaaaaaaaa: ${initMsg.data}");
|
||||
clickAction = initMsg.data['click_action'].replaceAll(
|
||||
'navigate-',
|
||||
'',
|
||||
|
|
|
|||
|
|
@ -8,8 +8,6 @@ class NotificationController {
|
|||
static Future<void> onNotificationCreatedMethod(
|
||||
ReceivedNotification receivedNotification) async {
|
||||
// Your code goes here
|
||||
print(
|
||||
"onNotificationCreatedMethod--------------------------------------------------------------");
|
||||
}
|
||||
|
||||
/// Use this method to detect every time that a new notification is displayed
|
||||
|
|
@ -17,8 +15,6 @@ class NotificationController {
|
|||
static Future<void> onNotificationDisplayedMethod(
|
||||
ReceivedNotification receivedNotification) async {
|
||||
// Your code goes here
|
||||
print(
|
||||
"onNotificationDisplayedMethod--------------------------------------------------------------");
|
||||
}
|
||||
|
||||
/// Use this method to detect if the user dismissed a notification
|
||||
|
|
@ -26,25 +22,23 @@ class NotificationController {
|
|||
static Future<void> onDismissActionReceivedMethod(
|
||||
ReceivedAction receivedAction) async {
|
||||
// Your code goes here
|
||||
print(
|
||||
"onDismissActionReceivedMethod--------------------------------------------------------------");
|
||||
}
|
||||
|
||||
/// Use this method to detect when the user taps on a notification or action button
|
||||
@pragma("vm:entry-point")
|
||||
static Future<void> onActionReceivedMethod(
|
||||
ReceivedAction receivedAction) async {
|
||||
print("obiiiiiiiiiiiiiiii $receivedAction");
|
||||
NotificationMessage data =
|
||||
NotificationMessage.fromJson(receivedAction.payload!);
|
||||
// Your code goes here
|
||||
|
||||
HomeWidgetRepository.data = data;
|
||||
await HomeWidgetRepository.decideWhereToGoNotif();
|
||||
|
||||
return;
|
||||
|
||||
// MyApp.navigatorKey.currentState?.pushNamedAndRemoveUntil('/notification-page',
|
||||
// (route) => (route.settings.name != '/notification-page') || route.isFirst,
|
||||
// arguments: receivedAction);
|
||||
print(
|
||||
"onActionReceivedMethod--------------------------------------------------------------");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,6 +48,14 @@ class AwsomeNotificationHandler {
|
|||
initialAction = await AwesomeNotifications()
|
||||
.getInitialNotificationAction(removeFromActionEvents: false);
|
||||
|
||||
if (initialAction?.payload != null) {
|
||||
NotificationMessage data =
|
||||
NotificationMessage.fromJson(initialAction!.payload!);
|
||||
|
||||
HomeWidgetRepository.data = data;
|
||||
}
|
||||
// Your code goes here
|
||||
|
||||
AwesomeNotifications().isNotificationAllowed().then((isAllowed) {
|
||||
//It would be more appropriate if you can show your own dialog
|
||||
//to the user before requesting the notifications permissons.
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
import 'package:awesome_notifications/awesome_notifications.dart';
|
||||
import 'package:didvan/config/design_config.dart';
|
||||
import 'package:didvan/models/notification_message.dart';
|
||||
import 'package:didvan/providers/theme.dart';
|
||||
import 'package:didvan/services/app_initalizer.dart';
|
||||
import 'package:didvan/services/notification/awsome/awsome_notification_controller.dart';
|
||||
import 'package:didvan/services/notification/awsome/awsome_notification_handler.dart';
|
||||
import 'package:didvan/views/home/bookmarks/bookmarks.dart';
|
||||
import 'package:didvan/views/home/categories/categories_page.dart';
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class ProfilePage extends StatelessWidget {
|
|||
),
|
||||
const SizedBox(height: 16),
|
||||
DidvanText(
|
||||
'نسخه نرمافزار: 3.2.0',
|
||||
'نسخه نرمافزار: 3.2.1',
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -15,10 +15,10 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
|||
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
||||
# Read more about iOS versioning at
|
||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||
version: 3.2.0+3200
|
||||
version: 3.2.1+3210
|
||||
|
||||
environment:
|
||||
sdk: ">=2.17.0 <3.0.0"
|
||||
sdk: ">=2.19.0 <3.0.0"
|
||||
|
||||
# Dependencies specify other packages that your package needs in order to work.
|
||||
# To automatically upgrade your package dependencies to the latest versions
|
||||
|
|
|
|||
Loading…
Reference in New Issue