Coder Social home page Coder Social logo

sona's Introduction

logo pub package

sona makes possible using getui push in flutter.

简介

Sona是个推推送SDK在Flutter上的实现。通过Sona,可以在Flutter上轻松使用个推推送。 使用Sona之前,请到个推官网进行应用注册。

初始化

鉴于AndroidiOS的差异化,对应平台设置还需手动设置,具体请参考官网。 在Flutter中通过Sona初使化个推推送:

    import 'package:sona/sona.dart' as sona;
    sona.register(
        appID: "your app id",
        appKey: "your app key",
        appSecret: "app secret"
    );

appIDappKeyappSecret目前仅在iOS上生效,因为在android上,这些配置是在build.gradle中完成的,所以使用Sona之前 一定要在android工程配置appIDappKey以及appSecret

defaultConfig {
        //some configrations

        manifestPlaceholders = [
                GETUI_APP_ID : "APP_ID",
                GETUI_APP_KEY : "APP_KEY",
                GETUI_APP_SECRET : "APP_SECRET"
        ]
    }

接收透传

通过监听receivedMessageData可以获取个推推送的透传数据:

   sona.receivedMessageData.listen((payload){
      //接收到透传
      });

其中payloadMap<dynamic,dynamic>根据平台不台,其包含的key也不同:

  • appID:String
  • taskID:String
  • messageID:String
  • offLine:bool
  • payload:String or null
  • pkgName:String,仅安卓平台

sona's People

Contributors

jarvanmo avatar rockerflower avatar tgarm avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.