1.看图解决问题
2.解决出现统计代码提示问题
修改这个java 文件
导入命名空间
import cn.jpush.android.api.JPushInterface;
添加方法
@Override
protected void onResume() {
super.onResume();
JPushInterface.onResume(this);
}
@Override
protected void onPause() {
super.onPause();
JPushInterface.onPause(this);
}
3.是后端调用接口发送推送通知
/配送员相关配置 private static String app_key_deliver = "********"; private static String master_secret_deliver = "*****"; private static String ALERT_deliver = "你有新的配送订单需要处理"; private static String TITLE = "配送订单";
public void SendPushAliasDeliver(string alias) { JPushClient client = new JPushClient(app_key_deliver, master_secret_deliver); PushPayload payload_alias = PushObject_alias_alert_title(alias, ALERT_deliver, TITLE,"id","0"); var result = client.SendPush(payload_alias); }
private static PushPayload PushObject_alias_alert_title(string alias,string alert ,string title,string strkey ,string strvalue) { PushPayload pushPayload_alias = new PushPayload(); pushPayload_alias.platform = Platform.android_ios(); pushPayload_alias.audience = Audience.s_alias(alias); var notification = new Notification().setAlert(ALERT_deliver); notification.AndroidNotification = new AndroidNotification().setTitle(TITLE); notification.AndroidNotification.AddExtra(strkey, strvalue); notification.IosNotification = new IosNotification(); notification.IosNotification.incrBadge(1); notification.IosNotification.AddExtra(strkey, strvalue); pushPayload_alias.notification = notification.Check(); return pushPayload_alias; }