Commit d452b017bcb7e5d177ed4414b6cf5f6774f154a5

Authored by 蓋亞光
2 parents 7df6abad 4ecf9509

合并冲突

... ... @@ -11,14 +11,14 @@ if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = "145"
def flutterVersionCode = "146"
if (flutterVersionCode == null) {
flutterVersionCode = '145'
flutterVersionCode = '146'
}
def flutterVersionName = "1.4.5"
def flutterVersionName = "1.4.6"
if (flutterVersionName == null) {
flutterVersionName = '1.4.5'
flutterVersionName = '1.4.6'
}
apply plugin: 'com.android.application'
... ...
... ... @@ -10,7 +10,7 @@
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="com.huawei.android.launcher.permission.CHANGE_BADGE"/>
<application
android:name="io.flutter.app.FlutterApplication"
android:label="一键订"
... ...
c71e777004aab201609920eac28801f9
\ No newline at end of file
<<<<<<< HEAD
c71e777004aab201609920eac28801f9
=======
7babc7873f8d177769b987ba4c6c2911
>>>>>>> 4ecf950986f1856303c83ccacadc2b15efeb20ac
... ...
... ... @@ -12,6 +12,8 @@ PODS:
- easy_contact_picker (0.0.1):
- Flutter
- Flutter (1.0.0)
- flutter_app_badger (0.0.1):
- Flutter
- flutter_bugly (0.0.1):
- Bugly
- Flutter
... ... @@ -56,6 +58,7 @@ DEPENDENCIES:
- device_info (from `.symlinks/plugins/device_info/ios`)
- easy_contact_picker (from `.symlinks/plugins/easy_contact_picker/ios`)
- Flutter (from `Flutter`)
- flutter_app_badger (from `.symlinks/plugins/flutter_app_badger/ios`)
- flutter_bugly (from `.symlinks/plugins/flutter_bugly/ios`)
- flutter_statusbarcolor (from `.symlinks/plugins/flutter_statusbarcolor/ios`)
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
... ... @@ -91,6 +94,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/easy_contact_picker/ios"
Flutter:
:path: Flutter
flutter_app_badger:
:path: ".symlinks/plugins/flutter_app_badger/ios"
flutter_bugly:
:path: ".symlinks/plugins/flutter_bugly/ios"
flutter_statusbarcolor:
... ... @@ -126,6 +131,7 @@ SPEC CHECKSUMS:
device_info: d7d233b645a32c40dfdc212de5cf646ca482f175
easy_contact_picker: 9ab9dc70e8ddde6e76a19ffc482d7bf899868730
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
flutter_app_badger: 65de4d6f0c34a891df49e6cfb8a1c0496426fa68
flutter_bugly: c9800f4d5bc5bdc27ffdde3417a26ba44266e0c3
flutter_statusbarcolor: 8afb1071ed8c58be929f1e32b36c629771fd2259
fluttertoast: b644586ef3b16f67fae9a1f8754cef6b2d6b634b
... ...
... ... @@ -254,6 +254,7 @@
"${BUILT_PRODUCTS_DIR}/contacts_service/contacts_service.framework",
"${BUILT_PRODUCTS_DIR}/device_info/device_info.framework",
"${BUILT_PRODUCTS_DIR}/easy_contact_picker/easy_contact_picker.framework",
"${BUILT_PRODUCTS_DIR}/flutter_app_badger/flutter_app_badger.framework",
"${BUILT_PRODUCTS_DIR}/flutter_statusbarcolor/flutter_statusbarcolor.framework",
"${BUILT_PRODUCTS_DIR}/fluttertoast/fluttertoast.framework",
"${BUILT_PRODUCTS_DIR}/install_plugin/install_plugin.framework",
... ... @@ -274,6 +275,7 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/contacts_service.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/device_info.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/easy_contact_picker.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_app_badger.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_statusbarcolor.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/fluttertoast.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/install_plugin.framework",
... ... @@ -404,9 +406,14 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
<<<<<<< HEAD
CURRENT_PROJECT_VERSION = 145;
=======
CURRENT_PROJECT_VERSION = 146;
>>>>>>> 4ecf950986f1856303c83ccacadc2b15efeb20ac
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
... ... @@ -419,7 +426,11 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
<<<<<<< HEAD
MARKETING_VERSION = 1.4.5;
=======
MARKETING_VERSION = 1.4.6;
>>>>>>> 4ecf950986f1856303c83ccacadc2b15efeb20ac
PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine;
PRODUCT_NAME = "一键订";
PROVISIONING_PROFILE_SPECIFIER = "";
... ... @@ -546,9 +557,13 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
<<<<<<< HEAD
CURRENT_PROJECT_VERSION = 145;
=======
CURRENT_PROJECT_VERSION = 146;
>>>>>>> 4ecf950986f1856303c83ccacadc2b15efeb20ac
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
... ... @@ -561,7 +576,11 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
<<<<<<< HEAD
MARKETING_VERSION = 1.4.5;
=======
MARKETING_VERSION = 1.4.6;
>>>>>>> 4ecf950986f1856303c83ccacadc2b15efeb20ac
PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine;
PRODUCT_NAME = "一键订";
PROVISIONING_PROFILE_SPECIFIER = "";
... ... @@ -579,9 +598,13 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
<<<<<<< HEAD
CURRENT_PROJECT_VERSION = 145;
=======
CURRENT_PROJECT_VERSION = 146;
>>>>>>> 4ecf950986f1856303c83ccacadc2b15efeb20ac
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
... ... @@ -594,7 +617,11 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
<<<<<<< HEAD
MARKETING_VERSION = 1.4.5;
=======
MARKETING_VERSION = 1.4.6;
>>>>>>> 4ecf950986f1856303c83ccacadc2b15efeb20ac
PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine;
PRODUCT_NAME = "一键订";
PROVISIONING_PROFILE_SPECIFIER = "";
... ...
... ... @@ -33,6 +33,7 @@ import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart';
import 'package:flutter_app_badger/flutter_app_badger.dart';
class HomePage extends StatefulWidget {
final int initialIndex; //初始tab
... ... @@ -51,6 +52,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
int _currIndex = 1;
Color _activeColor = MyColours.color_199095;
Color _defaultColor = MyColours.color_999999;
int numPush = 0; //推送消息个数
Timer timer;
... ... @@ -103,6 +105,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
//获取点击通知栏的自定义参数
_getIntent() async {
_clearBadge(() {});
Map param = await Tools().getIntent();
Map notifyParam = param;
if (Platform.isIOS && param != null) {
... ... @@ -152,14 +155,16 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
LogUtil.v("注册成功:$token");
// Utils.showToast("注册成功:$token");
userTokenInit(token);
XgFlutterPlugin().setAppBadge(0);
// XgFlutterPlugin().setAppBadge(0);
}
},
unRegistered: (String msg) async {
print("flutter unRegistered: $msg");
},
onReceiveNotificationResponse: (Map<String, dynamic> msg) async {
LogUtil.v("flutter onReceiveNotificationResponse $msg");
print("flutter onReceiveNotificationResponse $msg");
numPush++;
_addBadge();
},
onReceiveMessage: (Map<String, dynamic> msg) async {
print("flutter onReceiveMessage $msg");
... ... @@ -167,8 +172,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
xgPushDidSetBadge: (String msg) async {
print("flutter xgPushDidSetBadge: $msg");
/// 在此可设置应用角标
XgFlutterPlugin().setAppBadge(0);
// /// 在此可设置应用角标
// XgFlutterPlugin().setAppBadge(0);
},
xgPushDidBindWithIdentifier: (String msg) async {
print("flutter xgPushDidBindWithIdentifier: $msg");
... ... @@ -183,6 +188,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
print("flutter xgPushDidClearAllIdentifiers: $msg");
},
xgPushClickAction: (Map<String, dynamic> msg) async {
_clearBadge(() {});
if (Platform.isIOS && msg != null && msg['custom'] != null) {
Map custom = json.decode(msg['custom'].toString());
switch (custom["messageType"].toString()) {
... ... @@ -233,6 +239,20 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
xgCount++;
}
void _addBadge() {
XgFlutterPlugin().setBadge(numPush);
XgFlutterPlugin().setAppBadge(numPush);
FlutterAppBadger.updateBadgeCount(numPush);
}
void _clearBadge(VoidCallback callback) async {
numPush = 0;
XgFlutterPlugin().setBadge(0);
XgFlutterPlugin().setAppBadge(0);
FlutterAppBadger.removeBadge();
callback();
}
//初始化推送token
userTokenInit(String token) {
UserModel userModel = Provider.of<UserModel>(context, listen: false);
... ... @@ -266,7 +286,10 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
super.didChangeAppLifecycleState(state);
switch (state) {
case AppLifecycleState.resumed: //应用前台可见
getUntreatedMessage();
_clearBadge(() {
getUntreatedMessage();
});
break;
case AppLifecycleState.inactive:
print('inactive');
... ...
... ... @@ -300,6 +300,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_app_badger:
dependency: "direct main"
description:
name: flutter_app_badger
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.2"
flutter_blurhash:
dependency: transitive
description:
... ...
... ... @@ -87,6 +87,7 @@ dependencies:
contacts_service: ^0.4.6
common_utils: ^1.1.3
easy_contact_picker: ^0.0.2
flutter_app_badger: ^1.1.2
dev_dependencies:
... ...