diff --git a/android/app/build.gradle b/android/app/build.gradle
index ce046057..41903854 100755
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -248,22 +248,22 @@ android {
JPUSH_PKGNAME : "这里不重要,在口味配置",
//JPush 上注册的包名对应的 Appkey.
// JPUSH_APPKEY : "7ff37d174c1a568a89e98dad",//--skyAppKey
-// JPUSH_APPKEY : "251fc8074820d122b6de58d2",//--鑫泓佳AppKey
-// JPUSH_CHANNEL : "flutter_channel",
+ JPUSH_APPKEY : "default",//--鑫泓佳AppKey
+ JPUSH_CHANNEL : "default",
//若不集成厂商通道,可直接跳过以下配置
//以下为sky的配置
// XIAOMI_APPID : "MI-2882303761520287291",
// XIAOMI_APPKEY : "MI-5352028744291",
//以下均为鑫泓佳的配置
-// XIAOMI_APPID : "MI-2882303761520314939",
-// XIAOMI_APPKEY : "MI-5312031456939",
-// OPPO_APPKEY : "OP-47f668c9943248118502aa58d066393b",
-// OPPO_APPID : "OP-31726001",
-// OPPO_APPSECRET: "OP-05723986bba64183a71530b496922450",
-// VIVO_APPKEY : "75fe8e570425b714e08d0390b14797cb",
-// VIVO_APPID : "105752244",
-// HONOR_APPID : "104458196",
+ XIAOMI_APPID : "default",
+ XIAOMI_APPKEY : "default",
+ OPPO_APPKEY : "default",
+ OPPO_APPID : "default",
+ OPPO_APPSECRET: "default",
+ VIVO_APPKEY : "default",
+ VIVO_APPID : "default",
+ HONOR_APPID : "default",
]
splits {
abi {
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 03314074..db2e332c 100755
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -10,6 +10,8 @@
+
+
diff --git a/ios/Runner/AppDelegate.m b/ios/Runner/AppDelegate.m
index c6d3389b..76d97654 100755
--- a/ios/Runner/AppDelegate.m
+++ b/ios/Runner/AppDelegate.m
@@ -9,6 +9,7 @@
@interface AppDelegate()
+@property (nonatomic, strong) FlutterMethodChannel *methodChannel;
@end
@@ -20,11 +21,24 @@
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// [UMConfigure initWithAppkey:@"671244ae80464b33f6df9646" channel:@"Product"];
+
+
+ //Required
+ //notice: 3.0.0 及以后版本注册可以这样写,也可以继续用之前的注册方式
+ JPUSHRegisterEntity * entity = [[JPUSHRegisterEntity alloc] init];
+ entity.types = JPAuthorizationOptionAlert|JPAuthorizationOptionBadge|JPAuthorizationOptionSound|JPAuthorizationOptionProvidesAppNotificationSettings;
+ if ([[UIDevice currentDevice].systemVersion floatValue] >= 8.0) {
+ // 可以添加自定义 categories
+ // NSSet *categories for iOS10 or later
+ // NSSet *categories for iOS8 and iOS9
+ }
+ [JPUSHService registerForRemoteNotificationConfig:entity delegate:self];
+
XSFlutterManager *VC = [[XSFlutterManager alloc] init];
self.window.rootViewController = VC;
[self.window makeKeyAndVisible];
-
+
return YES;
}
@@ -64,7 +78,7 @@
*/
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
- //sdk注册DeviceToken
+ /// Required - 注册 DeviceToken
[JPUSHService registerDeviceToken:deviceToken];
}
@@ -72,7 +86,8 @@
* 苹果推送注册失败回调
*/
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error {
- NSLog(@"didFailToRegisterForRemoteNotificationsWithError %@", error);
+ //Optional
+ NSLog(@"did Fail To Register For Remote Notifications With Error: %@", error);
}
/**
@@ -96,6 +111,49 @@
NSLog(@"Receive message title: %@, content: %@.", title, body);
}
+# pragma mark- JPUSHRegisterDelegate
+
+// iOS 12 Support
+- (void)jpushNotificationCenter:(UNUserNotificationCenter *)center openSettingsForNotification:(UNNotification *)notification{
+ if (notification && [notification.request.trigger isKindOfClass:[UNPushNotificationTrigger class]]) {
+ //从通知界面直接进入应用
+ }else{
+ //从通知设置界面进入应用
+ }
+}
+
+// iOS 10 Support
+- (void)jpushNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(NSInteger))completionHandler {
+ // Required
+ NSDictionary * userInfo = notification.request.content.userInfo;
+ if([notification.request.trigger isKindOfClass:[UNPushNotificationTrigger class]]) {
+ [JPUSHService handleRemoteNotification:userInfo];
+ }
+ completionHandler(UNNotificationPresentationOptionAlert); // 需要执行这个方法,选择是否提醒用户,有 Badge、Sound、Alert 三种类型可以选择设置
+}
+
+// iOS 10 Support
+- (void)jpushNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)())completionHandler {
+ // Required
+ NSDictionary * userInfo = response.notification.request.content.userInfo;
+ if([response.notification.request.trigger isKindOfClass:[UNPushNotificationTrigger class]]) {
+ [JPUSHService handleRemoteNotification:userInfo];
+ }
+ completionHandler(); // 系统要求执行这个方法
+}
+
+- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
+
+ // Required, iOS 7 Support
+ [JPUSHService handleRemoteNotification:userInfo];
+ completionHandler(UIBackgroundFetchResultNewData);
+}
+
+- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
+
+ // Required, For systems with less than or equal to iOS 6
+ [JPUSHService handleRemoteNotification:userInfo];
+}
diff --git a/ios/Runner/XSFlutterManager.m b/ios/Runner/XSFlutterManager.m
index d53ee425..c2ce6138 100755
--- a/ios/Runner/XSFlutterManager.m
+++ b/ios/Runner/XSFlutterManager.m
@@ -64,6 +64,7 @@
activityVC.completionWithItemsHandler = ^(UIActivityType _Nullable activityType, BOOL completed, NSArray * _Nullable returnedItems, NSError * _Nullable activityError) {
if (completed) {
NSLog(@"completed");
+
// 分享成功
} else {
NSLog(@"canceled");
@@ -72,6 +73,10 @@
};
result(@"push返回到flutter");
}
+ if ([method isEqualToString:@"getBundleIdentifier"]) {
+ NSString *bundleIdentifier = [[NSBundle mainBundle] bundleIdentifier];
+ result(bundleIdentifier); // 返回 Bundle Identifier
+ }
}];
[GeneratedPluginRegistrant registerWithRegistry:self];
diff --git a/lib/mine/addLock/lockAddress/gaode/lockAddressGaoDe_logic.dart b/lib/mine/addLock/lockAddress/gaode/lockAddressGaoDe_logic.dart
index bc55b983..c645dad7 100755
--- a/lib/mine/addLock/lockAddress/gaode/lockAddressGaoDe_logic.dart
+++ b/lib/mine/addLock/lockAddress/gaode/lockAddressGaoDe_logic.dart
@@ -1,8 +1,3 @@
-
-
-import 'package:amap_flutter_location/amap_flutter_location.dart';
-import 'package:amap_flutter_location/amap_location_option.dart';
-import 'package:permission_handler/permission_handler.dart';
import 'package:star_lock/tools/baseGetXController.dart';
import 'lockAddressGaoDe_state.dart';
@@ -10,46 +5,6 @@ import 'lockAddressGaoDe_state.dart';
class LockAddressGaoDeLogic extends BaseGetXController{
LockAddressGaoDeState state = LockAddressGaoDeState();
- // Future requestPermission() async {
- // final status = await Permission.location.request();
- // AppLog.log("Permission.location.request()=status:$status");
- // // state.permissionStatus = status;
- // switch (status) {
- // case PermissionStatus.denied:
- // AppLog.log("拒绝");
- // break;
- // case PermissionStatus.granted:
- // requestLocation();
- // break;
- // case PermissionStatus.limited:
- // AppLog.log("限制");
- // break;
- // default:
- // AppLog.log("其他状态");
- // requestLocation();
- // break;
- // }
- // }
- //
- // Future requestLocation() async {
- // state.location = AMapFlutterLocation()
- // ..setLocationOption(AMapLocationOption())
- // ..onLocationChanged().listen((event) {
- // AppLog.log("listenLocationChanged$event");
- // state.latitude.value = double.parse(event['latitude'] as String);
- // state.longitude.value = double.parse(event['longitude'] as String);
- // if (state.latitude.value != 0 && state.longitude.value != 0) {
- // // widget.callback(event);
- // state.addressInfo.value = event;
- // // currentLocation = CameraPosition(
- // // target: LatLng(latitude, longitude),
- // // zoom: 10,
- // // );
- // }
- // })
- // ..startLocation();
- // }
-
void pushAddAction(){
}
@@ -63,12 +18,6 @@ class LockAddressGaoDeLogic extends BaseGetXController{
@override
void onInit() {
super.onInit();
-
- // AMapFlutterLocation.updatePrivacyAgree(true);
- // AMapFlutterLocation.updatePrivacyShow(true, true);
- // AMapFlutterLocation.setApiKey("11d49b3f4fc09c04a02bbb7500925ba2", "883a3355d2d77c2fdc2667030dc97ffe");
- //
- // requestPermission();
}
@override
diff --git a/lib/mine/addLock/lockAddress/gaode/lockAddressGaoDe_page.dart b/lib/mine/addLock/lockAddress/gaode/lockAddressGaoDe_page.dart
index ce2f6f09..e219a237 100755
--- a/lib/mine/addLock/lockAddress/gaode/lockAddressGaoDe_page.dart
+++ b/lib/mine/addLock/lockAddress/gaode/lockAddressGaoDe_page.dart
@@ -14,9 +14,7 @@ import 'package:star_lock/widget/permission/permission_dialog.dart';
import '../../../../appRouters.dart';
import '../../../../app_settings/app_colors.dart';
-import '../../../../blue/blue_manage.dart';
import '../../../../flavors.dart';
-import '../../../../tools/appRouteObserver.dart';
import '../../../../tools/titleAppBar.dart';
import 'lockAddressGaoDe_logic.dart';
@@ -30,68 +28,139 @@ class LockAddressGaoDePage extends StatefulWidget {
class _LockAddressGaoDePageState extends State
with RouteAware {
final LockAddressGaoDeLogic logic = Get.put(LockAddressGaoDeLogic());
- final LockAddressGaoDeState state = Get
- .find()
- .state;
-
- // 高德地图
- static AMapApiKey amapApiKeys =
- AMapApiKey(iosKey: F.aMapKey.iosKey, androidKey: F.aMapKey.androidKey);
-
+ final LockAddressGaoDeState state = Get.find().state;
AMapController? mapController;
- AMapFlutterLocation location = AMapFlutterLocation();
+ Map? _addressInfo;
- PermissionStatus? permissionStatus;
- Map? addressInfo;
+ late StreamSubscription