Skip to content
java
@Override
protected void onResume(){
    super.onResume();
    XGPushClickedResult click = XGPushManager.onActivityStarted(this);
    if(click!=null){
        String cusContent = click.getCustomContent();
        if(!Guard.isNullOrEmpty(cusContent)){
            Log.w(TAG,cusContent);
        }
    }
}
 
@Override
protected void onPause() {
    super.onPause();
    XGPushManager.onActivityStoped(this);
}

只要把这个加在Actvity页面就行了。没有那么复杂。很多方法都能在XGPushManager中找到。

在项目指定一个固定页面来处理所有的通知,通过约定的枚举自定义参数来由指定页面打开不同的页面。这样应该会方便些吧。正在实践中。。。

转换自: https://www.cnblogs.com/atwind/p/5232281.html