Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

推送相关 #24

Closed
xiaorouroudaren opened this issue Nov 23, 2022 · 6 comments
Closed

推送相关 #24

xiaorouroudaren opened this issue Nov 23, 2022 · 6 comments

Comments

@xiaorouroudaren
Copy link

消息推送相关的demo里有吗 集成推送的流程是什么

@imndx
Copy link
Contributor

imndx commented Nov 23, 2022

  1. HBuilder X里面选中manifest.json,然后选中Push-> uniPush 1.0.
  2. 看下uni-push的文档
  3. 部署最新push-server
  4. 仔细阅读push-server的 readme

然后,针对具体的问题进行跟帖讨论

@imndx imndx closed this as completed Mar 21, 2023
@imndx imndx pinned this issue Mar 21, 2023
@imndx
Copy link
Contributor

imndx commented Nov 23, 2023

如果需要是用uniPush 2.0,则不需要部署push-server,可参考他们的文档:uniPush v2

uniPush v1uniPush v2 区别,请参考区别

@imndx
Copy link
Contributor

imndx commented Nov 23, 2023

针对荣耀手机的说明:

目前,uniPush的配置里面,并没有单独配置荣耀推送的地方,需要特别处理,

        plus.push.getClientInfoAsync((info) => {
            let cid = info["clientid"];
            if (cid) {
                console.log('push clientId', cid);
                wfc.setDeviceToken(8, cid);  // 8,用来表示是荣耀推送
            }
        });

然后push-server 判断pushType是 8 的是,单独处理荣耀推送

@ISPANBIAO
Copy link

是否可以取消IM收发消息的时候对用户是否在线的判断,不论用户是否在线都调用推送服务,然后将push-server服务修改为push2云函数。

@imndx
Copy link
Contributor

imndx commented Mar 21, 2024

什么情况下会希望在线也进行推送呢?

如果一定要实现的话,可以采用 消息转发回调 来实现,你可以看下im-server配置文件里面,消息转发部分的注释。

push-server目前不支持 [uniPush v2](https://zh.uniapp.dcloud.io/unipush-v2.html#)push-server是完全开源的,你们可以自行对接

@imndx
Copy link
Contributor

imndx commented Mar 21, 2024

使用unipush-v2的大概思路如下:

  1. 通过云函数 URL 化 提供两个类似push-server推送入口的 http 接口,这些接口对应的方法里面,解析参数,并调用unipush-v2相关的接口进行推送
  2. 将相应的地址配置到 im-server 推送相关配置部分

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants