diff --git a/star_lock/android/.gitignore b/star_lock/android/.gitignore index 36eb2329..3cd81ad5 100644 --- a/star_lock/android/.gitignore +++ b/star_lock/android/.gitignore @@ -14,3 +14,4 @@ GeneratedPluginRegistrant.java #key.properties #**/*.keystore #**/*.jks +/bundletool.jar diff --git a/star_lock/android/app/aliyun-emas-services.json b/star_lock/android/app/aliyun-emas-services.json deleted file mode 100644 index 66605471..00000000 --- a/star_lock/android/app/aliyun-emas-services.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "config": { - "emas.appKey":"334068743", - "emas.appSecret":"64de537f14984159a66ada10e54c6b63", - "emas.packageName":"com.skychip.lock", - "hotfix.idSecret":"334068743-1", - "hotfix.rsaSecret":"MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCrcYP7FeYbeYakUMBa2Z5PtVh7LsuS+CfAM6GUjNUDByktVz2lFmZatFvMHn7xuxg6rgsRMrZ9IFziLC4xGltwHhSsCkr6cNoVZODAIXpowq+/Uwg3Gdbw/SOOT5dV70h5Dt3ztORVlobghCb5D74jgn6pqQVmhpSbrS+7zZTzcyKhsvRbQEx3tLa98uCDdIOjym4Jk0+dANCpVOTCPYbQtxewUKZv4ZcpIF0vwqVmAmNjjK04Bp6rhpM1pSxfIo3k6jwng9E+9iwmQkjk7NsexqyzXGmBywUBpSqFBo4bLLrGByqN/kAMAXpchRCBpx9Q311RHJb1T98n0wRimT5HAgMBAAECggEAClNE2ptgB2mTRVQjsZUHps9KK+kOk6RkaHvzkEnHDm6g+T0W1ll6Ap54JNv1U0OsWuRegEOon/KSBYEZqxVmSmNVZWMdTuX7DGzN6GRbxfFruj8a8I6a1lq4iHqcp61IlRnjHilX0xvEtcLfwgJDtknGrRsj2x/h1Vph1JK2FM9RqupT7O7Jy0ehkpVeyGWYLHcFKFThECRPFLHqAwBIY3aU6wp1G8NxkDRxj+C2cF4/cIEHFa7ZsEmVpNOI01qjntlFylNumuR+Ehz6DBKKT72eeVz+gMpnHs+ILGe0ov54soMobBTisw2dFdP9StHnnjoRwOH/KZx3iySerCqK6QKBgQD8cYrCvGlNl0x/fen1Er0Lfks5yVoYQ1ilMag82W8odNjBlcRFwZ+tCjowh55sA2tlQ+cYJxIhQXa7ukk/ILCz9DIHgmwJy4xDRrXonuUKRIkG7859H2/cA2hFAIgNIl6GxJXhGucnWarwbtgX5I7fdLgWAQrAAPjYgET9E4fJfQKBgQCt29cQp63keXKaV2NPVr+axwyOpF0wBQ5frdUVEsBE0hvtkymWThmdnAMuhFJA9+qb4LPxYUFS/MGPl01KhNoU/t2nJdMIWqGPt5eFf+lvzfyk/Jmr7YzpvcpKgfj0orrlIz5gZO5QajGwjlPYtxcu7FLdh7w46uT+P4J+28ySEwKBgQCn9JcAt0BMalRwIoMNFdmHExDTsp5ptCz/Q4mOao/lV9B7A7zhOFCXXU2XyjNh4+iJKGNRk3UhgR+RCQEAqixGnjrG+kQNREre2+XdjhIPAcg1QEmev9K5i97MwezC6FIB0jtx2Gdgq+zqKKVHSD6yd0KfCTRwyHTH/pdn1Z2rNQKBgHeF/nmdvUeoUqhW0ZhWvAztMO3Tg5kisLoIaMg/Bt2JUNfoZxvE/4lCG1HceCvgBHM7bJnSUbV6vJs52lITuVXbzYg+0bEZlZ6XCd0mjdZmV30Zh5ASFOEQsES+y+drBG/I5fYhDVFNYHHPt0bywEZrA6D20uiSW/GKuez6sM3vAoGATm3cLmUCauphKbaVjUB8bh6w9fvgFJnU5c12wytCy9D6TyxtHO6vL1r/KN51ejp5Ht6MuqOBTJztDcXjLbQMBvmw/SRSqQfeiBzAnUDt9MTy2c8GH135jlhBxgSF6JpeQ56uIXc4/rdM5XH5M5qmM7HJtKcLjlC7GCDIhWEvZM0=", - "httpdns.accountId":"100674", - "httpdns.secretKey":"6cd4984095d53f6f311424cc9299257b", - "appmonitor.tlog.rsaSecret":"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCW084k+HG1OOaSY2B2N6aj4AOz8RhInqlaFr7BbQrqmPwzHC2Co0N/jmbBbxGP7oPsy7yF9zn/hJiuvzlQfjtK85IXAYUKj7IcLashQUT5lrGYlObCznH2qOPkw8OP+cboP51uWIeXFMYatwXRR05vtWVLEeUhaFE1onzQtcG0YwIDAQAB", - "appmonitor.rsaSecret":"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCW084k+HG1OOaSY2B2N6aj4AOz8RhInqlaFr7BbQrqmPwzHC2Co0N/jmbBbxGP7oPsy7yF9zn/hJiuvzlQfjtK85IXAYUKj7IcLashQUT5lrGYlObCznH2qOPkw8OP+cboP51uWIeXFMYatwXRR05vtWVLEeUhaFE1onzQtcG0YwIDAQAB" -}, - "services": { - "hotfix_service":{ - "status":1, - "version":"3.4.0" - }, - "ha-adapter_service":{ - "status":1, - "version":"1.2.3.0-open" - }, - "feedback_service":{ - "status":1, - "version":"3.4.2" - }, - "tlog_service":{ - "status":1, - "version":"1.1.7.0-open" - }, - "httpdns_service":{ - "status":1, - "version":"2.3.5" - }, - "apm_service":{ - "status":1, - "version":"1.1.3.0-open" - }, - "man_service":{ - "status":1, - "version":"1.2.7" - }, - "cps_service":{ - "status":1, - "version":"3.8.8.1" - } -}, - "use_maven":true, - "proguard_keeplist":"\n#httpdns\n-keep class com.taobao.** {*;}\n-keep class com.alibaba.** {*;}\n-keep class com.ta.**{*;}\n-keep class com.ut.**{*;}\n-dontwarn com.taobao.**\n-dontwarn com.alibaba.**\n-dontwarn com.ta.**\n-dontwarn com.ut.**\n\n#cps\n-keep class com.taobao.** {*;}\n-keep class com.alibaba.** {*;}\n-keep class com.ta.**{*;}\n-keep class com.ut.**{*;}\n-dontwarn com.taobao.**\n-dontwarn com.alibaba.**\n-dontwarn com.ta.**\n-dontwarn com.ut.**\n-keepclasseswithmembernames class ** {\nnative ;\n}\n-keepattributes Signature\n-keep class sun.misc.Unsafe { *; }\n-keep class com.alipay.** {*;}\n-dontwarn com.alipay.**\n-keep class anet.**{*;}\n-keep class org.android.spdy.**{*;}\n-keep class org.android.agoo.**{*;}\n-dontwarn anet.**\n-dontwarn org.android.spdy.**\n-dontwarn org.android.agoo.**\n\n#hotfix\n#基线包使用,生成mapping.txt\n-printmapping mapping.txt\n#生成的mapping.txt在app/buidl/outputs/mapping/release路径下,移动到/app路径下\n#修复后的项目使用,保证混淆结果一致\n#-applymapping mapping.txt\n#hotfix\n-keep class com.taobao.sophix.**{*;}\n-keep class com.ta.utdid2.device.**{*;}\n#防止inline\n-dontoptimize\n\n#man\n-keep class com.taobao.** {*;}\n-keep class com.alibaba.** {*;}\n-keep class com.ta.**{*;}\n-keep class com.ut.**{*;}\n-dontwarn com.taobao.**\n-dontwarn com.alibaba.**\n-dontwarn com.ta.**\n-dontwarn com.ut.**\n\n#feedback\n-keep class com.taobao.** {*;}\n-keep class com.alibaba.** {*;}\n-keep class com.ta.**{*;}\n-keep class com.ut.**{*;}\n-dontwarn com.taobao.**\n-dontwarn com.alibaba.**\n-dontwarn com.ta.**\n-dontwarn com.ut.**\n" -} \ No newline at end of file diff --git a/star_lock/android/app/build.gradle b/star_lock/android/app/build.gradle index 93273b5f..5d2c322e 100644 --- a/star_lock/android/app/build.gradle +++ b/star_lock/android/app/build.gradle @@ -23,7 +23,6 @@ if (flutterVersionName == null) { } apply plugin: 'com.android.application' -apply plugin: 'com.aliyun.ams.emas-services' // 引用emas-services插件 apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" @@ -114,7 +113,7 @@ android { } defaultConfig { - + applicationId "com.skychip.lock" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. minSdkVersion 25 @@ -129,6 +128,18 @@ android { //设置支持的SO库架构(开发者可以根据需要,选择一个或多个平台的so) abiFilters "armeabi", "armeabi-v7a", "arm64-v8a", "x86","x86_64" } + + manifestPlaceholders = [ + JPUSH_PKGNAME : "com.skychip.lock", + //JPush 上注册的包名对应的 Appkey. + JPUSH_APPKEY : "7ff37d174c1a568a89e98dad", + //暂时填写默认值即可. + JPUSH_CHANNEL : "flutter_channel", + + //若不集成厂商通道,可直接跳过以下配置 + XIAOMI_APPID : "MI-2882303761520287291", + XIAOMI_APPKEY : "MI-5352028744291", + ] splits { abi { enable true @@ -140,6 +151,7 @@ android { } } } + buildTypes { release { // 高德地图导致release编译模式下应用闪退,根据:[高德地图在Debug模式下运行正常但是打Release包时则闪退解决办法](https://blog.csdn.net/weixin_39370093/article/details/109631210) @@ -163,7 +175,9 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation('com.amap.api:location:5.6.0') implementation('com.amap.api:3dmap:8.1.0') - implementation 'com.aliyun.ams:alicloud-android-push:3.8.7' - //小米依赖 - implementation 'com.aliyun.ams:alicloud-android-third-push-xiaomi:3.8.7' + + implementation 'cn.jiguang.sdk:jpush:5.2.3' + implementation 'com.huawei.hms:push:6.12.0.300' + + implementation 'cn.jiguang.sdk.plugin:xiaomi:5.2.3' } diff --git a/star_lock/android/app/src/main/AndroidManifest.xml b/star_lock/android/app/src/main/AndroidManifest.xml index 25941a2b..6ec34a31 100644 --- a/star_lock/android/app/src/main/AndroidManifest.xml +++ b/star_lock/android/app/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + @@ -18,10 +18,6 @@ - - - - @@ -35,7 +31,10 @@ - + + @@ -49,50 +48,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + diff --git a/star_lock/android/app/src/main/kotlin/com/skychip/lock/MainActivity.kt b/star_lock/android/app/src/main/kotlin/com/skychip/lock/MainActivity.kt index f3c4205b..0237e5c7 100644 --- a/star_lock/android/app/src/main/kotlin/com/skychip/lock/MainActivity.kt +++ b/star_lock/android/app/src/main/kotlin/com/skychip/lock/MainActivity.kt @@ -4,22 +4,15 @@ import android.content.Intent import android.net.Uri import android.os.Bundle import android.util.Log -import com.alibaba.sdk.android.push.noonesdk.PushServiceFactory -import com.aliyun.ams.emas.push.CommonCallback import io.flutter.embedding.android.FlutterActivity import io.flutter.plugin.common.MethodChannel import io.flutter.embedding.engine.FlutterEngine; import io.flutter.plugins.GeneratedPluginRegistrant import android.bluetooth.BluetoothAdapter; -import com.alibaba.sdk.android.push.register.MiPushRegister class MainActivity: FlutterActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - initAliyunPushService() - - MiPushRegister.register(applicationContext, "2882303761520287291", "5352028744291"); - GeneratedPluginRegistrant.registerWith(flutterEngine!!) MethodChannel(flutterEngine?.dartExecutor!!.binaryMessenger, "starLockFlutterSend").setMethodCallHandler { call, result -> if (call.method == "loadNativeShare") { @@ -63,23 +56,6 @@ class MainActivity: FlutterActivity() { startActivity(Intent.createChooser(shareIntent, null)) } - private fun initAliyunPushService() { - PushServiceFactory.init(applicationContext) - val pushService = PushServiceFactory.getCloudPushService() - - val callback = object : CommonCallback, com.alibaba.sdk.android.push.CommonCallback { - override fun onSuccess(response: String?) { - Log.e("TAG","success $response") - } - - override fun onFailed(errorCode: String?, errorMessage: String?) { - Log.e("TAG","error $errorMessage") - } - } - - pushService.register(applicationContext,callback) - } - override fun configureFlutterEngine(flutterEngine: FlutterEngine) { GeneratedPluginRegistrant.registerWith(flutterEngine); MethodChannel(flutterEngine.dartExecutor.binaryMessenger, "starLockFlutterSend").setMethodCallHandler { diff --git a/star_lock/android/app/src/main/kotlin/com/skychip/lock/MyMessageReceiver.kt b/star_lock/android/app/src/main/kotlin/com/skychip/lock/MyMessageReceiver.kt deleted file mode 100644 index 4b58b259..00000000 --- a/star_lock/android/app/src/main/kotlin/com/skychip/lock/MyMessageReceiver.kt +++ /dev/null @@ -1,72 +0,0 @@ -package com.skychip.lock - -import android.content.Context -import android.util.Log -import com.alibaba.sdk.android.push.MessageReceiver -import com.alibaba.sdk.android.push.notification.CPushMessage - - -class MyMessageReceiver : MessageReceiver() { - override fun onNotification( - context: Context?, - title: String, - summary: String, - extraMap: Map - ) { - // TODO处理推送通知 - Log.e( - "MyMessageReceiver", - "Receive notification, title: $title, summary: $summary, extraMap: $extraMap" - ) - } - - override fun onMessage(context: Context?, cPushMessage: CPushMessage) { - Log.e( - "MyMessageReceiver", - "onMessage, messageId: " + cPushMessage.getMessageId() + ", title: " + cPushMessage.getTitle() + ", content:" + cPushMessage.getContent() - ) - } - - override fun onNotificationOpened(context: Context?, title: String, summary: String, extraMap: String) { - Log.e( - "MyMessageReceiver", - "onNotificationOpened, title: $title, summary: $summary, extraMap:$extraMap" - ) - } - - protected override fun onNotificationClickedWithNoAction( - context: Context?, - title: String, - summary: String, - extraMap: String - ) { - Log.e( - "MyMessageReceiver", - "onNotificationClickedWithNoAction, title: $title, summary: $summary, extraMap:$extraMap" - ) - } - - protected override fun onNotificationReceivedInApp( - context: Context?, - title: String, - summary: String, - extraMap: Map, - openType: Int, - openActivity: String, - openUrl: String - ) { - Log.e( - "MyMessageReceiver", - "onNotificationReceivedInApp, title: $title, summary: $summary, extraMap:$extraMap, openType:$openType, openActivity:$openActivity, openUrl:$openUrl" - ) - } - - protected override fun onNotificationRemoved(context: Context?, messageId: String?) { - Log.e("MyMessageReceiver", "onNotificationRemoved") - } - - companion object { - // 消息接收部分的LOG_TAG - const val REC_TAG = "receiver" - } -} \ No newline at end of file diff --git a/star_lock/android/app/src/main/kotlin/com/skychip/lock/PopupPushActivity.kt b/star_lock/android/app/src/main/kotlin/com/skychip/lock/PopupPushActivity.kt deleted file mode 100644 index 85442a7b..00000000 --- a/star_lock/android/app/src/main/kotlin/com/skychip/lock/PopupPushActivity.kt +++ /dev/null @@ -1,25 +0,0 @@ -import android.os.Bundle -import android.util.Log -import com.alibaba.sdk.android.push.AndroidPopupActivity - -class PopupPushActivity : AndroidPopupActivity() { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - } - - /** - * 实现通知打开回调方法,获取通知相关信息 - * @param title 标题 - * @param summary 内容 - * @param extMap 额外参数 - */ - override fun onSysNoticeOpened(title: String, summary: String, extMap: Map) { - Log.e( - "PopupPushActivity", - "OnMiPushSysNoticeOpened, title: $title, content: $summary, extMap: $extMap" - ) } - - companion object { - const val TAG = "PopupPushActivity" - } -} \ No newline at end of file diff --git a/star_lock/android/build.gradle b/star_lock/android/build.gradle index bb5a7cca..43480df7 100644 --- a/star_lock/android/build.gradle +++ b/star_lock/android/build.gradle @@ -4,16 +4,19 @@ buildscript { google() mavenCentral() mavenLocal() - maven { // 添加Maven仓库地址 - url 'https://maven.aliyun.com/nexus/content/repositories/releases/' - } + // hms, 若不集成华为厂商通道,可直接跳过 + maven { url 'https://developer.huawei.com/repo/'} + // fcm, 若不集成 FCM 通道,可直接跳过 + maven { url "https://maven.google.com" } } dependencies { classpath 'com.android.tools.build:gradle:7.1.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - // 添加emas-services插件 - classpath 'com.aliyun.ams:emas-services:1.0.4' + // fcm,若不集成 FCM 通道,可直接跳过 + classpath 'com.google.gms:google-services:4.3.8' + // hms,若不集成华为厂商通道,可直接跳过 + classpath 'com.huawei.agconnect:agcp:1.6.0.300' } } @@ -21,11 +24,11 @@ buildscript { allprojects { repositories { google() -// mavenCentral() + mavenCentral() jcenter() - maven { // 添加Maven仓库地址 - url 'https://maven.aliyun.com/nexus/content/repositories/releases/' - } + // 配置HMS Core SDK的Maven仓地址。 + maven {url 'https://developer.huawei.com/repo/'} + } } diff --git a/star_lock/ios/Podfile b/star_lock/ios/Podfile index fc1e6a3b..f60e3f48 100644 --- a/star_lock/ios/Podfile +++ b/star_lock/ios/Podfile @@ -36,6 +36,7 @@ end source 'https://github.com/CocoaPods/Specs.git' source 'https://github.com/aliyun/aliyun-specs.git' pod 'AlicloudPush', '~> 1.9.9' +pod 'JPush' post_install do |installer| installer.pods_project.targets.each do |target| diff --git a/star_lock/ios/Runner/AliyunEmasServices-Info.plist b/star_lock/ios/Runner/AliyunEmasServices-Info.plist index ea7823a7..4b1af180 100644 --- a/star_lock/ios/Runner/AliyunEmasServices-Info.plist +++ b/star_lock/ios/Runner/AliyunEmasServices-Info.plist @@ -5,23 +5,23 @@ config emas.appKey - 333904046 + 334068745 emas.appSecret - 3eead09a7fc7416cb4082319aa6f48c6 + bee9c200835e4951a85dc8709c319560 emas.bundleId cn.star-lock.starLock hotfix.idSecret - 333904046-2 + 334068745-2 hotfix.rsaSecret - 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 httpdns.accountId - 125761 + 100674 httpdns.secretKey - f77f39c6f0e66d7c169aa7e8d87dfe13 + 6cd4984095d53f6f311424cc9299257b appmonitor.tlog.rsaSecret - MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCSlqdpwcdPniL1ahrYfTy47aD8Ay7D7qLyKO5QeXy64V+CQ0UvYwyTtfPRzvlXbwmc2ONjwKHq2B7SRhwHuBwURZNp5Iw1XaGCmqPPMOpL9UnYEIO90x3sFebIRHmXscyRVniGhmmdOXpVaP6BA3RWK1uwH/FBetzom6H+dcNMPQIDAQAB + MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCku9yUXBjd9m7V8fflC6XTwJEc8D8GSe5KzgXQZXk12S3KaZrx82Cu6/nOD7RNtZvsxrYd69bzkrG84tvIwwVSefWuPiDAiY2uiigpSXXda0FjQXZ0xHPJGcsrbI67y/2xFeK0pD9542Y4FBYPq6BcslAYFUVFD8bN+K/GBXkJRwIDAQAB appmonitor.rsaSecret - MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCSlqdpwcdPniL1ahrYfTy47aD8Ay7D7qLyKO5QeXy64V+CQ0UvYwyTtfPRzvlXbwmc2ONjwKHq2B7SRhwHuBwURZNp5Iw1XaGCmqPPMOpL9UnYEIO90x3sFebIRHmXscyRVniGhmmdOXpVaP6BA3RWK1uwH/FBetzom6H+dcNMPQIDAQAB + MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCku9yUXBjd9m7V8fflC6XTwJEc8D8GSe5KzgXQZXk12S3KaZrx82Cu6/nOD7RNtZvsxrYd69bzkrG84tvIwwVSefWuPiDAiY2uiigpSXXda0FjQXZ0xHPJGcsrbI67y/2xFeK0pD9542Y4FBYPq6BcslAYFUVFD8bN+K/GBXkJRwIDAQAB services @@ -65,7 +65,7 @@ status 1 version - 1.2.0 + 1.2.0-no-memory man_service @@ -79,7 +79,7 @@ status 1 version - 2.0.4 + 1.9.9.1-notnull diff --git a/star_lock/ios/Runner/AppDelegate.h b/star_lock/ios/Runner/AppDelegate.h index bb4ca173..582d3c3b 100644 --- a/star_lock/ios/Runner/AppDelegate.h +++ b/star_lock/ios/Runner/AppDelegate.h @@ -9,9 +9,14 @@ #import #import +#import "JPUSHService.h" +#import + +#import "JPUSHService.h" +#import -@interface AppDelegate : FlutterAppDelegate +@interface AppDelegate : FlutterAppDelegate @property (strong, nonatomic) UIWindow *window; diff --git a/star_lock/ios/Runner/AppDelegate.m b/star_lock/ios/Runner/AppDelegate.m index 56817721..557f519a 100644 --- a/star_lock/ios/Runner/AppDelegate.m +++ b/star_lock/ios/Runner/AppDelegate.m @@ -7,6 +7,7 @@ #import + @interface AppDelegate() @end @@ -18,6 +19,18 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { +// //【注册通知】通知回调代理(可选) +// JPUSHRegisterEntity * entity = [[JPUSHRegisterEntity alloc] init]; +// entity.types = JPAuthorizationOptionAlert|JPAuthorizationOptionBadge|JPAuthorizationOptionSound|JPAuthorizationOptionProvidesAppNotificationSettings; +// [JPUSHService registerForRemoteNotificationConfig:entity delegate:self]; +// +// //【初始化sdk】 +// // notice: 2.1.5 版本的 SDK 新增的注册方法,改成可上报 IDFA,如果没有使用 IDFA 直接传 nil +// [JPUSHService setupWithOption:launchOptions appKey:@"7ff37d174c1a568a89e98dad" +// channel:@"flutter_channel" +// apsForProduction:NO +// advertisingIdentifier:nil]; + // [self initCloudPush]; // [CloudPushSDK sendNotificationAck:launchOptions]; XSFlutterManager *VC = [[XSFlutterManager alloc] init]; @@ -29,7 +42,7 @@ - (void)initCloudPush { // SDK初始化 - [CloudPushSDK asyncInit:@"333904046" appSecret:@"3eead09a7fc7416cb4082319aa6f48c6" callback:^(CloudPushCallbackResult *res) { + [CloudPushSDK asyncInit:@"334068745" appSecret:@"bee9c200835e4951a85dc8709c319560" callback:^(CloudPushCallbackResult *res) { if (res.success) { NSLog(@"Push SDK init success, deviceId: %@.", [CloudPushSDK getDeviceId]); } else { @@ -62,13 +75,16 @@ * 苹果推送注册成功回调,将苹果返回的deviceToken上传到CloudPush服务器 */ - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { - [CloudPushSDK registerDevice:deviceToken withCallback:^(CloudPushCallbackResult *res) { - if (res.success) { - NSLog(@"Register deviceToken success."); - } else { - NSLog(@"Register deviceToken failed, error: %@", res.error); - } - }]; +// [CloudPushSDK registerDevice:deviceToken withCallback:^(CloudPushCallbackResult *res) { +// if (res.success) { +// NSLog(@"Register deviceToken success."); +// } else { +// NSLog(@"Register deviceToken failed, error: %@", res.error); +// } +// }]; + //sdk注册DeviceToken + [JPUSHService registerDeviceToken:deviceToken]; + } /* * 苹果推送注册失败回调 @@ -98,12 +114,6 @@ NSLog(@"Receive message title: %@, content: %@.", title, body); } -//- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { -// // 点击通知将App从关闭状态启动时,将通知打开回执上报 -// // [CloudPushSDK handleLaunching:launchOptions];(Deprecated from v1.8.1) -// [CloudPushSDK sendNotificationAck:launchOptions]; -// return YES; -//} /* * App处于启动状态时,通知打开回调 */ diff --git a/star_lock/ios/Runner/Info.plist b/star_lock/ios/Runner/Info.plist index 6484c6e2..3251cc22 100644 --- a/star_lock/ios/Runner/Info.plist +++ b/star_lock/ios/Runner/Info.plist @@ -1,82 +1,84 @@ - - CADisableMinimumFrameDurationOnPhone - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleDisplayName - $(BUNDLE_DISPLAY_NAME) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(BUNDLE_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleSignature - ???? - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - LSRequiresIPhoneOS - - NSAppTransportSecurity - - NSAllowsArbitraryLoads - - - NSBluetoothAlwaysUsageDescription - The app uses bluetooth to find, connect and transfer data between different devices - NSBluetoothPeripheralUsageDescription - The app uses bluetooth to find, connect and transfer data between different devices - NSCameraUsageDescription - 照片 - NSContactsUsageDescription - Reason we need access to the contact list - NSLocationAlwaysAndWhenInUseUsageDescription - 应用在前台和后台的时候可以搜到更新的位置信息 - NSLocationAlwaysUsageDescription - 应用在后台的时候可以搜到更新的位置信息 - NSLocationWhenInUseUsageDescription - 应用在前台的时候可以搜到更新的位置信息 - NSMicrophoneUsageDescription - 应用请求麦克风用来通话 - NSPhotoLibraryUsageDescription - 用于相册 - UIApplicationSceneManifest - - UISceneConfigurations - - - UIApplicationSupportsIndirectInputEvents - - UIBackgroundModes - - remote-notification - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - UIInterfaceOrientationPortrait - - UIViewControllerBasedStatusBarAppearance - - io.flutter.embedded_views_preview - - - \ No newline at end of file + + CADisableMinimumFrameDurationOnPhone + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + $(BUNDLE_DISPLAY_NAME) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(BUNDLE_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + + NSBluetoothAlwaysUsageDescription + The app uses bluetooth to find, connect and transfer data between different devices + NSBluetoothPeripheralUsageDescription + The app uses bluetooth to find, connect and transfer data between different devices + NSCameraUsageDescription + 应用请求相机,以便于拍摄照片,用于头像上传 + NSContactsUsageDescription + Reason we need access to the contact list + NSLocationAlwaysAndWhenInUseUsageDescription + 应用在前台和后台的时候可以搜到更新的位置信息 + NSLocationAlwaysUsageDescription + 应用在后台的时候可以搜到更新的位置信息 + NSLocationWhenInUseUsageDescription + 应用在前台的时候可以搜到更新的位置信息 + NSMicrophoneUsageDescription + 应用请求麦克风用来通话 + NSPhotoLibraryUsageDescription + 应用请求相册用于头像上传 + UIApplicationSceneManifest + + UISceneConfigurations + + + UIApplicationSupportsIndirectInputEvents + + UIBackgroundModes + + remote-notification + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + UIInterfaceOrientationPortrait + + UIViewControllerBasedStatusBarAppearance + + NSUserTrackingUsageDescription + 需要访问您的隐私数据,以提供个性化的体验。 + io.flutter.embedded_views_preview + + + diff --git a/star_lock/lib/app.dart b/star_lock/lib/app.dart index ff5793ef..505cc1ae 100644 --- a/star_lock/lib/app.dart +++ b/star_lock/lib/app.dart @@ -1,15 +1,17 @@ -import 'package:aliyun_push/aliyun_push.dart'; +// import 'package:aliyun_push/aliyun_push.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import 'package:jpush_flutter/jpush_flutter.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:star_lock/flavors.dart'; import 'package:star_lock/tools/app_manager.dart'; import 'package:star_lock/tools/bindings/app_binding.dart'; import 'package:star_lock/tools/storage.dart'; -import 'package:star_lock/tools/xs_aliyunPush.dart'; +// import 'package:star_lock/tools/storage.dart'; +// import 'package:star_lock/tools/xs_aliyunPush.dart'; import 'package:star_lock/translations/app_dept.dart'; import 'package:star_lock/translations/trans_lib.dart'; @@ -30,6 +32,8 @@ class MyApp extends StatefulWidget { // final RouteObserver routeObserver = RouteObserver(); class _MyAppState extends State with WidgetsBindingObserver, BaseWidget { + final JPush jpush = JPush(); + @override Widget build(BuildContext context) { return ScreenUtilInit( @@ -101,7 +105,8 @@ class _MyAppState extends State with WidgetsBindingObserver, BaseWidget { void initState() { super.initState(); WidgetsBinding.instance.addObserver(this); - initFlutterAliyunPush(); + + initJPushService(); } @override @@ -109,6 +114,43 @@ class _MyAppState extends State with WidgetsBindingObserver, BaseWidget { WidgetsBinding.instance.removeObserver(this); super.dispose(); } + + Future initJPushService() async { + final data = await Storage.getString(saveUserLoginData); + if (data != null && data.isNotEmpty) { + jpush.setup( + appKey: "7ff37d174c1a568a89e98dad", + channel: "flutter_channel", + production: false, + debug: true, + ); + + jpush.addEventHandler( + // 接收通知回调方法。 + onReceiveNotification: (Map message) async { + print("flutter onReceiveNotification: $message"); + }, + // 点击通知回调方法。 + onOpenNotification: (Map message) async { + print("flutter onOpenNotification: $message"); + }, + // 接收自定义消息回调方法。 + onReceiveMessage: (Map message) async { + print("flutter onReceiveMessage: $message"); + }, + ); + + jpush.applyPushAuthority( + const NotificationSettingsIOS(sound: true, alert: true, badge: true)); + // jpush.setChannelAndSound( + // channel: "flutter_channel", channelID: "115700", sound: "default"); + + // Platform messages may fail, so we use a try/catch PlatformException. + jpush.getRegistrationID().then((rid) { + print("flutter get registration id : $rid"); + }); + } + } } void openBlueScan() { @@ -146,26 +188,3 @@ Future getMicrophonePermission() async { } return false; } - -//初始化阿里云推送 -Future initFlutterAliyunPush() async { - final data = await Storage.getString(saveUserLoginData); - if (data != null) { - final aliyunPush = AliyunPush(); - XSAliyunPushProvider().init(aliyunPush); - XSAliyunPushProvider().initAliyunPush(); - - if (Platform.isAndroid) { - XSAliyunPushProvider().initAliyunThirdPush(); - } - - //暂使用DeviceID推送 - aliyunPush.getDeviceId().then((deviceId) async { - print('得到的DeviceId$deviceId'); - if (deviceId.isNotEmpty) { - XSAliyunPushProvider() - .pushBindDeviceID(deviceId, Platform.isAndroid ? 10 : 20); - } - }); - } -} diff --git a/star_lock/lib/starLockApplication/starLockApplication.dart b/star_lock/lib/starLockApplication/starLockApplication.dart index 2c4dbd7f..3bbce837 100644 --- a/star_lock/lib/starLockApplication/starLockApplication.dart +++ b/star_lock/lib/starLockApplication/starLockApplication.dart @@ -3,7 +3,6 @@ import 'package:star_lock/login/login/starLock_login_page.dart'; import 'package:star_lock/tools/appFirstEnterHandle.dart'; import 'package:star_lock/tools/storage.dart'; -import '../blue/blue_manage.dart'; import '../main/lockMian/lockMain/lockMain_page.dart'; class StarLockApplication extends StatefulWidget { @@ -14,8 +13,6 @@ class StarLockApplication extends StatefulWidget { } class _StarLockApplicationState extends State { - - @override void initState() { // TODO: implement initState @@ -27,7 +24,8 @@ class _StarLockApplicationState extends State { Widget build(BuildContext context) { print("StarLockApplication build"); AppFirstEnterHandle().getAppFirstEnter(context, isAgreePrivacy); - AppFirstEnterHandle().getAppFirstEnter(context, isShowUpdateVersion); + getAgreePrivacyShowUpdate(); + return FutureBuilder( future: getLoginStatus(), builder: (context, snapshot) { @@ -57,4 +55,11 @@ class _StarLockApplicationState extends State { } return false; } + + Future getAgreePrivacyShowUpdate() async { + final data = await Storage.getString(isAgreePrivacy); + if (data == isAgreePrivacy) { + AppFirstEnterHandle().getAppFirstEnter(context, isShowUpdateVersion); + } + } } diff --git a/star_lock/lib/tools/appFirstEnterHandle.dart b/star_lock/lib/tools/appFirstEnterHandle.dart index 65fff2eb..57ac9153 100644 --- a/star_lock/lib/tools/appFirstEnterHandle.dart +++ b/star_lock/lib/tools/appFirstEnterHandle.dart @@ -1,20 +1,14 @@ import 'dart:io'; -import 'package:device_info_plus/device_info_plus.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:package_info_plus/package_info_plus.dart'; import 'package:star_lock/appRouters.dart'; import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart'; import 'package:star_lock/tools/storage.dart'; -import '../network/api_repository.dart'; -import '../translations/trans_lib.dart'; import '../versionUndate/versionUndateTool.dart'; -import '../versionUndate/versionUndate_entity.dart'; class AppFirstEnterHandle { Future getAppFirstEnter(BuildContext widgetContext, String flagStr) async { @@ -116,6 +110,7 @@ class AppFirstEnterHandle { onPressed: () { Storage.setString(isAgreePrivacy, isAgreePrivacy); Navigator.of(context).pop(); + getAppFirstEnter(context, isShowUpdateVersion); }, ), ], diff --git a/star_lock/lib/tools/xs_aliyunPush.dart b/star_lock/lib/tools/xs_aliyunPush.dart index 600dfc94..4a922ebb 100644 --- a/star_lock/lib/tools/xs_aliyunPush.dart +++ b/star_lock/lib/tools/xs_aliyunPush.dart @@ -1,3 +1,4 @@ +/* import 'dart:io'; import 'package:aliyun_push/aliyun_push.dart'; @@ -133,3 +134,4 @@ class XSAliyunPushProvider { if (entity.errorCode!.codeIsSuccessful) {} } } +*/ \ No newline at end of file diff --git a/star_lock/lib/versionUndate/versionUndateTool.dart b/star_lock/lib/versionUndate/versionUndateTool.dart index 78310e17..9eafd463 100644 --- a/star_lock/lib/versionUndate/versionUndateTool.dart +++ b/star_lock/lib/versionUndate/versionUndateTool.dart @@ -1,4 +1,3 @@ - import 'dart:io'; import 'package:device_info_plus/device_info_plus.dart'; @@ -17,7 +16,7 @@ import 'versionUndate_entity.dart'; class VersionUndateTool { static VersionUndateTool? _manager; - VersionUndateTool._init(){ + VersionUndateTool._init() { // _initLoadUpdateVersionData(); } @@ -32,7 +31,6 @@ class VersionUndateTool { VersionUndateTool? get manager => shareManager(); void _initLoadUpdateVersionData() { - getVersionData(); } @@ -68,7 +66,7 @@ class VersionUndateTool { currentVersion: version, ); if (entity.errorCode! == 0) { - if(entity.data!.isUpdate! == 1){ + if (entity.data!.isUpdate! == 1) { showUpdateAlertDialog(entity); } } @@ -82,52 +80,60 @@ class VersionUndateTool { content: Column( children: [ Container( - // color: AppColors.mainColor, + // color: AppColors.mainColor, alignment: Alignment.topCenter, height: 50.h, - child: Text('版本更新', style: TextStyle(fontSize: 28.sp, color: Colors.blue),) - ), + child: Text( + '版本更新', + style: TextStyle(fontSize: 28.sp, color: Colors.blue), + )), Container( - padding: EdgeInsets.only(left:20.w, right: 20.w, top: 10.h), + padding: EdgeInsets.only(left: 20.w, right: 20.w, top: 10.h), alignment: Alignment.centerLeft, - child: Text(versionUndateEntity.data!.description!, textAlign:TextAlign.start, style: TextStyle(fontSize: 20.sp)) - ), + child: Text(versionUndateEntity.data!.description!, + textAlign: TextAlign.start, + style: TextStyle(fontSize: 20.sp))), ], ), - actions: versionUndateEntity.data!.isForceUpdate == 0 ? - [ - CupertinoDialogAction( - child: Text("下次再说"), - onPressed: () { - Navigator.pop(context); - Storage.setString(isShowUpdateVersion, isShowUpdateVersion); - }, - ), - CupertinoDialogAction( - child: Text(TranslationLoader.lanKeys!.sure!.tr), - onPressed: () async { - if (await canLaunch(versionUndateEntity.data!.appDownloadUrl!)) { - await launch(versionUndateEntity.data!.appDownloadUrl!); - } else { - throw 'Could not launch ${versionUndateEntity.data!.appDownloadUrl}'; - } - }, - ), - ]: - [ - CupertinoDialogAction( - child: Text(TranslationLoader.lanKeys!.sure!.tr), - onPressed: () async { - if (await canLaunch(versionUndateEntity.data!.appDownloadUrl!)) { - await launch(versionUndateEntity.data!.appDownloadUrl!); - } else { - throw 'Could not launch ${versionUndateEntity.data!.appDownloadUrl}'; - } - }, - ), - ], + actions: versionUndateEntity.data!.isForceUpdate == 0 + ? [ + CupertinoDialogAction( + child: Text("下次再说"), + onPressed: () { + Navigator.pop(context); + Storage.setString( + isShowUpdateVersion, isShowUpdateVersion); + }, + ), + CupertinoDialogAction( + child: Text(TranslationLoader.lanKeys!.sure!.tr), + onPressed: () async { + if (await canLaunchUrl(Uri.parse( + versionUndateEntity.data!.appDownloadUrl!))) { + await launchUrl(Uri.parse( + versionUndateEntity.data!.appDownloadUrl!)); + } else { + throw 'Could not launch ${versionUndateEntity.data!.appDownloadUrl}'; + } + }, + ), + ] + : [ + CupertinoDialogAction( + child: Text(TranslationLoader.lanKeys!.sure!.tr), + onPressed: () async { + if (await canLaunchUrl(Uri.parse( + versionUndateEntity.data!.appDownloadUrl!))) { + await launchUrl(Uri.parse( + versionUndateEntity.data!.appDownloadUrl!)); + } else { + throw 'Could not launch ${versionUndateEntity.data!.appDownloadUrl}'; + } + }, + ), + ], ); }, ); } -} \ No newline at end of file +} diff --git a/star_lock/pubspec.yaml b/star_lock/pubspec.yaml index 54a0eb76..a61eeaee 100644 --- a/star_lock/pubspec.yaml +++ b/star_lock/pubspec.yaml @@ -17,8 +17,9 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. - -version: 1.0.15+2024031501 +# 版本说明: +# 1.0.18+2024032001:修复同意隐私政策前获取SN +version: 1.0.18+2024032001 environment: sdk: '>=2.12.0 <3.0.0' @@ -113,7 +114,7 @@ dependencies: #网络图片缓存 cached_network_image: ^3.2.0 webview_flutter: ^4.2.3 - aliyun_push: ^0.1.6 + jpush_flutter: ^2.5.1 #视频播放器 video_player: ^2.7.1