首页 > 关于我们 > 技术文摘
OA系统:O2OA移动端APP直连版本如何开启消息推送
发布时间:

O2OA移动端目前支持通过自己编译的方式,在不连接我们的O2云服务器的情况下使用。包括修改App的图标名称等等,我们会提供全部源码,请自行编译打包。

App源码修改编译说明

Screen Shot 2019-11-11 at 16.58.07.png

如何编译成直连版本

Android版App

在源码目录中的app 这个文件夹下有一个build.gradle文件,找到 android -> buildTypes ,把BuildConfigField参数InnerServer改成 true

如下图:

image


然后在源码目录中的app 这个文件夹下找到assets 目录下找到server.json文件,把里面的centerHost 、 centerPort、httpProtocol改成你们自己的O2OA中心服务器地址相关信息。

如下图:

image





Ios版App

首先找到在 O2Platform -> config -> config.swift 文件。在文件中有一个O2IsConnect2Collect参数,修改如下:


//改为false就是直连版本
let O2IsConnect2Collect = false


然后找到O2Platform -> Info.plist 文件,把里面的centerHost 、 centerPort、httpProtocol改成你们自己的O2OA中心服务器地址相关信息。

如下图:

image




如何开启直连版本App消息推送

找到你们O2OA服务器部署目录,在configSample目录中找到jpushConfig.jsonmessages.json两个配置文件,把它们复制到config目录下,并且修改这个配置文件如下:


jpushConfig.json


{
  "enable": true,
  "appKey": "9aca7cc20fe0cc987cd913ca",
  "masterSecret": "96ee7e2e0daffd51bac57815",
  "###enable": "是否启用.###",
  "###appKey": "极光推送应用的AppKey .###",
  "###masterSecret": "极光推送应用的Master Secret .###"
}

这个配置文件就三个参数,

第一个enable改成true,开启消息推送。

第二个appKey,是极光推送那边你们自己注册的应用的key

第三个masterSecret,是极光推送那边你们自己注册的应用的服务端key

如下图,极光推送上应用key的查看位置:

Screen Shot 2019-11-11 at 16.58.07.png



messages.json

把这个配置文件中所有模块下的消费者consumers下的pms都改成pmsinner , 如下

{
  "attachment_editor": {
    "consumers": [
      "ws",
      "pmsinner",
      "dingding",
      "zhengwuDingding",
      "qiyeweixin"
    ]
  },
  "attachment_editorCancel": {
    "consumers": [
      "ws",
      "pmsinner",
      "dingding",
      "zhengwuDingding",
      "qiyeweixin"
    ]
  },
  "attachment_editorModify": {
    "consumers": [
      "ws",
      "pmsinner",
      "dingding",
      "zhengwuDingding",
      "qiyeweixin"
    ]
  },
  "attachment_share": {
    "consumers": [
      "ws",
      "pmsinner",
      "dingding",
      "zhengwuDingding",
      "qiyeweixin"
    ]
  },
  "attachment_shareCancel": {
    "consumers": [
      "ws",
      "pmsinner",
      "dingding",
      "zhengwuDingding",
      "qiyeweixin"
    ]
  },
  "meeting_delete": {
    "consumers": [
      "ws",
      "pmsinner",
      "dingding",
      "zhengwuDingding",
      "qiyeweixin"
    ]
  },
  "meeting_invite": {
    "consumers": [
      "ws",
      "pmsinner",
      "dingding",
      "zhengwuDingding",
      "qiyeweixin"
    ]
  },
  "readCompleted_create": {
    "consumers": []
  },
  "readCompleted_delete": {
    "consumers": []
  },
  "read_create": {
    "consumers": [
      "ws",
      "pmsinner",
      "dingding",
      "zhengwuDingding",
      "qiyeweixin"
    ]
  },
  "read_delete": {
    "consumers": []
  },
  "taskCompleted_create": {
    "consumers": []
  },
  "taskCompleted_delete": {
    "consumers": []
  },
  "task_create": {
    "consumers": [
      "ws",
      "pmsinner",
      "dingding",
      "zhengwuDingding",
      "qiyeweixin"
    ]
  },
  "task_delete": {
    "consumers": []
  },
  "task_press": {
    "consumers": [
      "ws",
      "pmsinner",
      "dingding",
      "zhengwuDingding",
      "qiyeweixin"
    ]
  },
  "calendar_alarm": {
    "consumers": [
      "ws",
      "pmsinner",
      "dingding",
      "zhengwuDingding",
      "qiyeweixin"
    ]
  },
  "cms_publish": {
    "consumers": [
      "ws",
      "pmsinner",
      "dingding",
      "zhengwuDingding",
      "qiyeweixin",
      "111111111111"
    ]
  },
  "###clean": "清理设置.###",
  "clean": {
    "enable": true,
    "cron": "30 30 6 * * ?",
    "keep": 7.0,
    "###enable": "是否启用###",
    "###cron": "定时cron表达式###",
    "###keep": "消息保留天数###"
  }
}