随笔 - 23  文章 - 0  评论 - 16  阅读 - 82172
 
摘要: 前段需要在业务中实现某些时间段的简单定时任务,类似crontab的调度,因为业务会放在docker中,所以不想用直接用crontab,在网上搜了一下,发现一个开源的实现 Pomelo.AspNetCore.TimedJob,使用简单,但是因为是时间间隔执行,不太符合指定时间段要求,不过感谢此开源代码 阅读全文
posted @ 2019-07-22 16:20 aquilahkj 阅读(1016) 评论(3) 推荐(1) 编辑
 
摘要: 还在dotnet framework 2.0的时代,当时还没有EF,而NHibernate之类的又太复杂,并且自己也有一些特殊需求,如查询结果直接入表、水平分表和新增数据默认值等,就试着折腾个轻量点ORM框架,就慢慢有了这个Light.Data,也一直在公司和个人的项目使用,后来陆陆续续也支持了跨数 阅读全文
posted @ 2019-05-22 17:36 aquilahkj 阅读(989) 评论(7) 推荐(3) 编辑
  2021年7月13日

已成功用极光通道收到推送,为了能在app被杀的情况下继续收推送,需要接入厂家通道,接华为的时候踩了一顿坑

新建Flutter项目,使用官方jpush_flutter包,版本2.1.4

 

 

第一步:生成jks签名文件

见 Flutter中生成Android的jks签名文件并使用

获取SHA256签名指纹 

 

第二步:在华为AGC上对应的项目下配置签名信息并下载agconnect-services.json

 

指纹填完后记得点勾保存,再下载文件,很重要,不然拿不到token

第三步 在极光后台配置华为通道的app资料

 

 

 

 第四步 修改项目gradle,加入华为库maven

 

 

 第五步 修改模块gradle

加入插件代码

1
apply plugin: 'com.huawei.agconnect'  

配置极光参数,接入华为通道minSdkVersion要17以上

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
defaultConfig {
    applicationId "com.xxx.jpush.demo"
    ndk {
      //选择要添加的对应 cpu 类型的 .so 库。
      abiFilters 'armeabi', 'armeabi-v7a', 'x86', 'x86_64', 'mips', 'mips64', 'arm64-v8a'  
    }
    manifestPlaceholders = [
        JPUSH_PKGNAME : applicationId,
        JPUSH_APPKEY : "xxxxxxxxxxxxxxxx", //JPush 上注册的包名对应的 Appkey.
        JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可.
    ]
    minSdkVersion 17
    targetSdkVersion 30
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
}

 加入华为依赖包

1
2
3
4
5
6
dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    // // 接入华为厂商
    implementation 'com.huawei.hms:push:5.3.0.301'
    implementation 'cn.jiguang.sdk.plugin:huawei:4.0.9'// 极光厂商插件版本与接入 JPush 版本保持一致,下同
}

 jpush_flutter我用的2.1.4,翻源码SDK版本是 cn.jiguang.sdk:jpush:4.0.9

修改AndroidManifest.xml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.example.jpush_demo"
  xmlns:tools="http://schemas.android.com/tools">
  <permission android:name="${applicationId}.permission.JPUSH_MESSAGE"
    android:protectionLevel="signature"/>
  <uses-permission android:name="${applicationId}.permission.JPUSH_MESSAGE" />
  <uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" />
  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.READ_PHONE_STATE" />
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
  <application android:name="io.flutter.app.FlutterApplication"
    android:label="jpush_demo"
    android:icon="@mipmap/ic_launcher"
    android:usesCleartextTraffic="true"
    tools:replace="android:label">
    <activity android:name=".MainActivity"
      android:launchMode="singleTop"
      android:theme="@style/LaunchTheme"
      android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
      android:hardwareAccelerated="true"
      android:windowSoftInputMode="adjustResize">     
      <!-- Specifies an Android theme to apply to this Activity as soon as
                 the Android process has started. This theme is visible to the user
                 while the Flutter UI initializes. After that, this theme continues
                 to determine the Window background behind the Flutter UI. -->
      <meta-data android:name="io.flutter.embedding.android.NormalTheme"
        android:resource="@style/NormalTheme" />
      <!-- Displays an Android View that continues showing the launch screen
                 Drawable until Flutter paints its first frame, then this splash
                 screen fades out. A splash screen is useful to avoid any visual
                 gap between the end of Android's launch screen and the painting of
                 Flutter's first frame. -->
      <meta-data android:name="io.flutter.embedding.android.SplashScreenDrawable"
        android:resource="@drawable/launch_background" />
      <intent-filter>
        <action android:name="android.intent.action.MAIN"/>
        <category android:name="android.intent.category.LAUNCHER"/>
      </intent-filter>
    </activity>
    <service android:name="cn.jpush.android.service.DaemonService"
      android:enabled="true"
      android:exported="true">
      <intent-filter >
        <action android:name="cn.jpush.android.intent.DaemonService" />
        <category android:name="${applicationId}"/>
      </intent-filter>
    </service>
    <service android:name=".services.HmsService"
      android:exported="false">
      <intent-filter>
        <action android:name="com.huawei.push.action.MESSAGING_EVENT" />
      </intent-filter>
    </service>   
    <!-- Don't delete the meta-data below. This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
    <meta-data android:name="flutterEmbedding"
      android:value="2" />
  </application>
</manifest>

 根节点加入命名空间属性  xmlns:tools="http://schemas.android.com/tools" application节点加入属性 tools:replace="android:label"

 加入两个Service

 

运行程序,成功连接华为日志出现以下文字

 

 成功后在极光后台检测集成,就会出现华为通道已集成

 

 测试下发时选择厂商优先

 

 

 

posted @ 2021-07-13 15:05 aquilahkj 阅读(2201) 评论(0) 推荐(0) 编辑
摘要: 本人的开发环境是mac+vscode,所以操作都是在改环境下进行 第一步:生成jks文件 在Terminal下执行命令 keytool -genkey -v -keystore <keystore-file> -keyalg RSA -keysize 2048 -validity 10000 -al 阅读全文
posted @ 2021-07-13 11:36 aquilahkj 阅读(1465) 评论(0) 推荐(0) 编辑
  2020年8月16日
摘要: ABP Vnext支持Sqlserver、Mysql、PostgreSql等数据库,通过CLI模板建立的项目默认使用SqlServer,需要进行一定变更才支持其他数据库,下面以使用Mysql举例 1. 使用CLI建立一个带UI的MVC项目 abp new Acme.BookStoreUi --tem 阅读全文
posted @ 2020-08-16 22:04 aquilahkj 阅读(690) 评论(3) 推荐(1) 编辑
  2019年8月6日
摘要: 在ElementUI的Dialog中,需要实现其宽度随浏览器宽度变化而变化,并设定默认值,当浏览器宽度大于该值时,Dialog保持该宽度,小于该值时,使用100%宽度。 代码使用 window.onresize 事件触发变化,具体Demo代码如下 效果如下 阅读全文
posted @ 2019-08-06 15:31 aquilahkj 阅读(15257) 评论(0) 推荐(1) 编辑
摘要: 前端时间需要在页面的输入框输入地址,搜索并在百度地图上获取选定结果的坐标,前端使用了Vue + Element-ui,地图方面直接使用了封装好的百度地图vue组件-vue-baidu-map 输入框使用自动完成的Input组件,在输入地址时不断更新地图搜索结果和地图当前定位。 以下是demo代码 效 阅读全文
posted @ 2019-08-06 13:09 aquilahkj 阅读(8069) 评论(0) 推荐(3) 编辑
  2019年6月5日
摘要: 建立一个HttpRunnerManager的环境需要Mysql,RabbitMQ服务,为简单部署,全部使用Docker 1. 在服务器建立Docker环境 2.建立Mysql容器 建立后在mysql中创建数据库httprunner 3.建立RabbitMQ容器 4.建立HttpRunner容器 配置 阅读全文
posted @ 2019-06-05 16:11 aquilahkj 阅读(1118) 评论(2) 推荐(0) 编辑
  2019年5月24日
摘要: 参考教程 https://blog.coder666.cn/2018/08/30/blog11/ 直接搭建成功。 但服务器上的80端口还有其他服务要使用,所以就使用Nginx作反向代理,Nginx也是使用Docker搭建 1. 新建立一个docker的bridge网络,目的是可以直接指定docker 阅读全文
posted @ 2019-05-24 23:52 aquilahkj 阅读(8) 评论(0) 推荐(0) 编辑
  2012年12月12日
摘要: Mac OS中使用VMware Fusion下安装Win8并启用Hyper-V需要先做以下设置.1.- 停止虚拟机2.- 在VMWare虚拟机列表, 右键点击Windows 8的虚拟机名称,然后点击 "在Finder中显示".3.- 右键点击虚拟机的文件,然后点击 "显示包内容", 然后用文本编辑器打开扩展名为.vmx的文件.4.- 在文件末尾添加下列两行文字(需首先检查是否已经在前面出现):hypervisor.cpuid.v0 = "FALSE"vhv.enable = "TRUE"5.- 在VMWare虚拟机 阅读全文
posted @ 2012-12-12 14:00 aquilahkj 阅读(948) 评论(0) 推荐(0) 编辑
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示