1. 服务器通过sdk已经发送了消息,Android客户端没有收到怎么是怎么回事?
如果你的app不在前台,请先阅读FAQ3。
遇到这个问题,请参考以下步骤:
步骤1,请确认demo中AndroidManifest.xml关于service,broadcast,permission的声明都copy到了你的AndroidManifest.xml中。注意,AndroidManifest中的PushMessageHandler需要定义在和MiPushClient.initialize调用在同一进程。安卓刷榜
步骤2,打开客户端的日志。方法参照2。
步骤3,杀掉你app,重新启动app。观察日志。push的客户端的初始化需要完成以下几步:1,创建帐号;2,创建长连接connect,3,认证bind;认证结束即表示连接建立成功,可以收发消息。如果上述步骤中出错,日志都会打印出来,根据日志具体问题具体分析。
步骤4,如果步骤3连接建立正常,此时请检查服务器发送的返回结果。如果服务器显示发送成功,但是客户端没有及时收到。请将服务器端返回值,发送消息时的topic,alias或者regid以及客户端对应的regid发送到devpush@xiaomi.com。
2. 如何打开客户端push的日志方便调试?
参照DemoApplication中的用法,在class的静态代码块中执行:app推广渠道
static {LoggerInterface newLogger = new LoggerInterface() {
@Override
public void setTag(String tag) {
// ignore
}
@Override
public void log(String content, Throwable t) {
Log.d(TAG, content, t);
}
@Override
public void log(String content) {
Log.d(TAG, content);
}
};
Logger.setLogger(newLogger);
}
3. push client sdk在混淆时出错怎么办?
client sdk已经混淆过了,不需要再混淆。请使用keep命令保留client sdk的内容;小米应用商店 app
-keepclasseswithmembernames class com.xiaomi.**{*;}
-keep public class * extends com.xiaomi.mipush.sdk.PushMessageReceiver
注:混淆时遇到 Warning: com.xiaomi.push.service.a.a: can’t find referenced method void setExact(int,long,android.app.PendingIntent)’ in class android.app.AlarmManager这个提示,请将安卓SDK到19以上(包含19),或者添加 -dontwarn com.xiaomi.push.service.a.a
原创文章,作者:youou,如若转载,请注明出处:https://xue.youounet.com/825.html
评论列表(4条)
dapoxetine priligy More aggressive interventions include gene therapy and stem cell transplantation
priligy generic Mass market mash ups include Taco BellГў s Doritos Locos a taco with a shell made from Doritos; Kentucky Fried ChickenГў s Double Down two fried chicken patties cradling bacon and cheese; and WendyГў s pretzel bacon cheeseburger a pretzel bun
All a calorie is, is a measure of energy the amount of heat energy it takes to raise one gram of water by one degree Celsius we use kilocalories, or Calories, with a capital C, which is 1, 000 times the energy of a calorie free samples of priligy Amplification is characterized by a second wave of secretion and aggregation and is further enhanced by platelet mediated release of thrombin, adenosine diphosphate ADP, and thromboxane A 2 TXA 2
can you buy cytotec without rx Epidemiologic studies and metaanalyses have not shown an increased risk of genital or non genital birth defects including cardiac anomalies and limb reduction defects following maternal exposure to low dose CHCs prior to conception or during early pregnancy