https://pub.flutter-io.cn/packages/jpush_flutter

 

JPush's officially supported Flutter plugin (Android & iOS). 极光推送官方支持的 Flutter 插件(Android & iOS)。 http://docs.jiguang.cn

#

在工程 pubspec.yaml 中加入 dependencies

dependencies:
  jpush_flutter: 0.0.11

#

#

在 /android/app/build.gradle 中添加下列代码:

android: {
  ....
  defaultConfig {
    applicationId "替换成自己应用 ID"
    ...
    ndk {
	//选择要添加的对应 cpu 类型的 .so 库。
	abiFilters 'armeabi', 'armeabi-v7a', 'x86', 'x86_64', 'mips', 'mips64', 'arm64-v8a',        
    }

    manifestPlaceholders = [
        JPUSH_PKGNAME : applicationId,
        JPUSH_APPKEY : "appkey", // NOTE: JPush 上注册的包名对应的 Appkey.
        JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可.
    ]
  }    
}
#
  • 在 xcode8 之后需要点开推送选项: TARGETS -> Capabilities -> Push Notification 设为 on 状态

#

import 'package:jpush_flutter/jpush_flutter.dart';

#

注意 : 需要先调用 JPush.setup 来初始化插件,才能保证其他功能正常工作。

 

相关文章:

  • 2022-12-23
  • 2021-12-04
  • 2021-08-12
  • 2021-12-04
  • 2021-08-17
  • 2021-06-21
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-23
  • 2021-11-15
  • 2022-12-23
  • 2021-12-04
  • 2021-12-04
  • 2021-07-22
  • 2021-04-06
相关资源
相似解决方案