Code Monkey home page Code Monkey logo

ipush's Introduction

IPush

融合多推送平台,提高推送到达率

  • 支持个推,SDK_version_2.14.0.0
  • 支持小米,SDK_version_3.7.6
  • 支持华为,SDK_version_2.6.1.301
  • 支持oppo,SDK_version_1.5.0
  • 支持vivo,SDK_version_2.3.1

Last-Version

1.0.0

#项目引入 添加Maven仓库:

allprojects {
    repositories {
        //个推
        maven {
            url "http://mvn.gt.igexin.com/nexus/content/repositories/releases/"
        }
        //华为
        maven { url 'http://developer.huawei.com/repo/' }
    }
}

maven.png

添加Gradle引用:

  compile 'com.github.binbinrd:push:{lastVersion}'

添加各个平台的appkey:

manifestPlaceholders = [
        PUSH_SCHEME:"yb",
        GETUI_APP_ID : "",
        GETUI_APP_KEY : "",
        GETUI_APP_SECRET : "",
        XIAOMI_APP_ID : "",
        XIAOMI_APP_KEY : "",
        VIVO_APP_ID : "",
        VIVO_APP_KEY : "",
        HUAWEI_APP_ID : "",
        OPPO_APP_KEY : "",
        OPPO_APP_SECRET : ""
]

appkey.png

自定义Service 用来接收数据:

public class PushHandleService extends BasePushIntentService {
    @Override
    public void onReceiveToken(Context context, PushMessageBean token) {
        Log.e("IPush", token.getPlatform() + " token:" + token.getData());
        Log.e("IPush", " pid:" + android.os.Process.myPid());
    }

    @Override
    public void onReceivePassThroughMessage(Context context, PushMessageBean message) {
        Log.e("IPush", "onReceivePassThroughMessage:" + message);
        Log.e("IPush", " pid:" + android.os.Process.myPid());
    }

    @Override
    public void onNotificationMessageClicked(Context context, PushMessageBean message) {
        Log.e("IPush", "onNotificationMessageClicked:" + message);
        Log.e("IPush", " pid:" + android.os.Process.myPid());
    }

    @Override
    public void onNotificationMessageArrived(Context context, PushMessageBean message) {
        Log.e("IPush", "onNotificationMessageArrived:" + message);
        Log.e("IPush", " pid:" + android.os.Process.myPid());
    }
}
<service android:name=".PushHandleService">
     <intent-filter>
           <action android:name="ipush_action_receive_token" />
           <action android:name="ipush_action_receive_pass_through_message" />
           <action android:name="ipush_action_receive_notification_message_clicked" />
           <action android:name="ipush_action_receive_notification_message_arrived" />
     </intent-filter>
</service>

在application中启动push

PushManager.getInstance()
           .register(this);

#使用规则 个推

GeTuiIcon.png

GeTui.png

小米

XiaoMi.png

华为

${PUSH_SCHEME}://${packageName}/push/huawei?Parm1=3&Parm2=2000

HuaWei.png

Oppo

${PUSH_SCHEME}://${packageName}/push/oppo?Parm1=3&Parm2=2000

Oppo.png

Vivo

Vivo.png

ipush's People

Contributors

yuanbinbinbin avatar

Watchers

James Cloos 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.