Giter Club home page Giter Club logo

flyme_push's Introduction

flyme_push

魅族Flyme推送push server sdk for Erlang
集成版本:https://github.com/dcy/epush
使用例子:/src/flyme_push_example.erl

通知栏 varnished notification 两个是一样的

通知栏主要是两个字段Title和Content

varnished(notification): 根据PushIds推送通知栏消息

  • varnished(PayloadMaps) ->
Maps = #{<<"appId">> => 123456,
         <<"messageJson">> => <<"{\"noticeBarInfo\":{\"title\":\"Hello\",\"noticeBarType\":0,\"content\":\"World\"}}">>,
         <<"pushIds">> => list_to_binary(?DEVICE_TOKEN),
         <<"sign">> => "varnished_sign"},
flyme_push:varnished(Maps).
  • varnished(PushIds, Title, Content):
  • varnished(AppId, AppSecret, PayloadMaps) when is_map(PayloadMaps) ->
  • varnished(AppId, AppSecret, PushIds, Title, Content):
flyme_push:notification("PushIds", "Hello", "World").

varnished_tags(notification_tags): 根据tags推送通知栏消息

  • varnished_tags(PayloadMaps) ->
  • varnished_tags(Tags, Scope, Title, Content) ->
  • varnished_tags(AppId, AppSecret, Tags, Scope, Title, Content) -> Scope 0并集 1交集
flyme_push:varnished_tags("tag1,tag2", 0, "hello", "world").

varnished_all(notification_all): 推送全部用户通知栏消息

  • varnished_all(PayloadMaps) ->
  • varnished_all(Title, Content) ->
  • varnished_all(AppId, AppSecret, Title, Content) ->
flyme_push:varnished_all("hello", "world").

透传

主要字段Content

unvarnished: 根据PushIds推送透传消息

  • unvarnished(PayloadMaps) ->
  • unvarnished(PushIds, Content)
  • unvarnished(AppId, AppSecret, PushIds, Content) ->
flyme_push:unvarnished("PushIds", jiffy:encode(#{<<"hello">> => <<"world">>})).

unvarnished_tags: 根据tags推送透传信息

  • unvarnished_tags(PayloadMaps) ->
  • unvarnished_tags(Tags, Scope, Content)
  • unvarnished_tags(AppId, AppSecret, Tags, Scope, Content) ->
flyme_push:unvarnished_tags("tag1,tag2", 0, jiffy:encode(#{<<"hello">> => <<"world">>})).

unvarnished_all: 推送全部用户透传消息

  • unvarnished_all(Maps) when is_map(Maps) ->
  • unvarnished_all(Content)
  • unvarnished_all(AppId, AppSecret, Content) ->
flyme_push:unvarnished_all(jiffy:encode(#{<<"hello">> => <<"world">>})).

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.