zoukankan      html  css  js  c++  java
  • Ionic JPush极光推送二

    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;
            }


  • 相关阅读:
    Java学习第一篇废话写在前面
    使用UI Automation实现自动化测试7.2 (模拟键盘复杂操作在自动化测试中的应用)
    生活随想之 积累经验篇
    赌一把
    重启职业及生存旅途计划
    partial class在自动化测试中的使用
    您们用什么广告平台
    Crazy English 900 Expressions (Android App)
    生存之道
    个税计算器完美终极版
  • 原文地址:https://www.cnblogs.com/linsu/p/6022887.html
Copyright © 2011-2022 走看看