android、flutter离线推送插件,支持oppo、vivo、小米、华为

项目说明

项目地址:https://github.com/haomiao33/ym_flutter_push

起因

目前github上面搜索发现没有合适的flutter和android 推送原生插件,所以自己参考和借鉴了(https://github.com/taoweiji/MixPush)项目,这个mixpush太老了,我这边更新了不少,去除了不需要的部分,更新了最新的jar和aar。

大家有什么问题可以提issues。

可以搭配配套的im系统:https://github.com/haomiao33/minim

功能

复制代码
1、支持vivo、oppo、华为、小米
2、目前支持获取到regId
3、支持服务端发送推送打开应用首页和子页面(可以附加不同的schema或者intent参数)

集成方法

1、库不需要修改,直接使用项目下的example

2、修改example下如下地方

复制代码
a、在android目录下的gradle.properties 各个值即可:


    EXAMPLE_APPLICATION_ID=com.xiaogongqiu.app
    EXAMPLE_VIVO_APP_ID=XX
    EXAMPLE_VIVO_APP_KEY=XX
    EXAMPLE_MI_APP_ID=XX
    EXAMPLE_MI_APP_KEY=XX
    EXAMPLE_OPPO_APP_KEY=XX
    EXAMPLE_OPPO_APP_SECRET=XX
    EXAMPLE_MEIZU_APP_ID=XX
    EXAMPLE_MEIZU_APP_KEY=XX

b、修改android app目录下build.gradle android.jks是自己的apk签名,改成自己的就行:
     signingConfigs {
        release {
            keyAlias 'key0'
            keyPassword "xxxx"
            storePassword "xxxx"
            storeFile file('android.jks')
        }
    }

c、替换改android app 目录下华为推送配置文件 arconnect-services.json 文件,替换成自己的。

d、修改app/src/AndroidManifest.xml 包名改成自己的(这个是属于小米的部分配置):
     <permission
        android:name="com.xiaogongqiu.app.permission.MIPUSH_RECEIVE"
        android:protectionLevel="signature" />
    <uses-permission android:name="com.xiaogongqiu.app.permission.MIPUSH_RECEIVE" />

e、 这个属于定义打开的activity的 scheme,可以自己定义,不过小米、vivi、oppo、华为有的使用时intent参数有的是使用scheme。
   <intent-filter>
            <action android:name="android.intent.action.VIEW"/>
            <category android:name="android.intent.category.DEFAULT"/>
            <category android:name="android.intent.category.BROWSABLE"/>
            <data
                android:scheme="ymappscheme"
                android:host="com.xiaogongqiu.app"
                android:path="/message"
                />
        </intent-filter>
相关推荐
海雅达手持终端PDA3 小时前
巡线、深井、爆管抢修与极寒水网的硬件矩阵怎么配?海雅达水务巡检终端PDA选型指南
android·物联网·5g·集成测试·能源·政务
行者-全栈开发4 小时前
Flutter 插件 device_calendar_plus 开源鸿蒙适配实战:从权限弹窗失灵到循环日程跑通
flutter·跨平台·harmonyos·arkts·日历·适配·开源鸿蒙
恋猫de小郭5 小时前
Flutter 开始支持 Jetpack Compose Platform View
android·前端·flutter
SoaringHeart16 小时前
Flutter 查缺补漏:@JsonKey 属性全解,让模型层不再被后端字段牵着走
flutter
三少爷的鞋18 小时前
Android 架构七条铁律:架构师真正设计的不是代码,而是秩序
android
xiangxiongfly91519 小时前
Android GsonFactory总结
android·gson·gsonfactory
WythePlus21 小时前
Android 14 SELinux策略深度解析
android·安全策略·selinux策略
俩个逗号。。1 天前
Kotlin flow 详解
android·开发语言·kotlin
橙光成长1 天前
android-ad-cleaner:android免 Root 批量关闭系统开屏与营销推送
android·1024程序员节
深圳雨林凯AI1 天前
图案裂变的底色衰减:alpha通道、亮度对比与白墨分色的量化拆解
android