rammus 0.0.3

Rammus pub package

阿里云推送Flutter插件.

Rammus是在一位热心网友的赞助下开发的并将其开源。在此特别感谢这位朋友。 欢迎加入QQ群:892398530共同交流。

麻烦先读一下官方文档 #

麻烦读下推送官方文档

Android上的配置 #

设置appKey,appSecret #

AndroidManifest.xml设置appKey,appSecret

        <meta-data
            android:name="com.alibaba.app.appkey"
            android:value="" /> <!-- 请填写你自己的- appKey -->
        <meta-data
            android:name="com.alibaba.app.appsecret"
            android:value="" /> <

也可以动态设置,具体方式看官方文档

初始化SDK #

好吧,由于SDK的限制,用户只能在Application中的onCreate里初始化:

        PushServiceFactory.init(applicationContext)
        val pushService = PushServiceFactory.getCloudPushService()
        val callback = object : 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)
        pushService.setPushIntentService(RammusPushIntentService::class.java)

pushService.setPushIntentService(RammusPushIntentService::class.java)千万不要忘记设置了。

Application在Android原生项目里。不会创建的自行百度。

iOS上的配置 #

稍微有点麻烦。

添加一下源 #

在项目中的PodFile前面加上下面的两句话

source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/aliyun/aliyun-specs.git'

添加一下info.plist #

请参考这个链接把 把info.plist添加到你的项目中。

到此ios配置完了。

关于iOS通知栏 #

如果你想推送通知的时候在通知栏上有显示请确保调用了下面的代码:

  rammus.configureNotificationPresentationOption();

0.0.3 #

  • 修复ios通知栏不显示的问题

0.0.2 #

  • reformat code.

0.0.1 #

  • initial release.

example/README.md

rammus_example #

Demonstrates how to use the rammus plugin.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  rammus: ^0.0.3

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:rammus/rammus.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
24
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
60
Learn more about scoring.

We analyzed this package on Aug 21, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/src/rammus_iml.dart.

Run flutter format to format lib/src/rammus_iml.dart.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test