Giter VIP home page Giter VIP logo

mixpush's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mixpush's Issues

onNotificationMessageArrived()和onNotificationMessageClicked()不执行?

onNotificationMessageArrived()和onNotificationMessageClicked()总是不执行? 可能是什么原因呢?我查了半天也找不到可能性的原因?请给与支持一下,谢谢了!

MixPushClient.getInstance().setPushReceiver(new MyMixPushReceiver());
MixPushClient.getInstance().register(this);

public class MyMixPushReceiver extends MixPushReceiver {
public static final String TAG = "mix";
@OverRide
public void onRegisterSucceed(Context context, MixPushPlatform mixPushPlatform) {
// 这里需要实现上传regId和推送平台信息到服务端保存,
//也可以通过MixPushClient.getInstance().getRegisterId的方式实现
register2Backend(mixPushPlatform.getPlatformName().toUpperCase(),mixPushPlatform.getRegId());

}

@OverRide
public void onNotificationMessageClicked(Context context, MixPushMessage message) {
// TODO 通知栏消息点击触发,实现打开具体页面,打开浏览器等。
Log.d(TAG, "onNotificationMessageClicked: " + message);
WebViewActivity.startWebViewShowTitleBarWithFlags(context,"https://www.baidu.com");

}

/**

  • 通知栏消息消息到达回调
    */
    public void onNotificationMessageArrived(Context context, MixPushMessage message) {
    Log.d(TAG, "onNotificationMessageArrived: " + message);
    WebViewActivity.startWebViewShowTitleBarWithFlags(context,"https://www.baidu.com");

}

I can't import the UnifiedPush Class

  • I added this MixPush sdk by the guide.I countered the error in the code screenshot.I wonder why I can't import the UnifiedPush Class.
    image
  • further more, I can't distinguish the MixPush And UniedPush, the are seperated sdk belong to different developers?
    thanks a lot and wating your help!

考虑支持APNS和Huawei Push么

目前国内有远程推送的, 除了魅族和小米外, 还有华为呢, 而苹果远程推送也是比较容易接入, 这一块目前是使用个推做的么?

华为推送的疑问

您好,目前正在测试集成您的这套框架的2.06,采用官网的网页版和我自己的js服务端向单个regid发送消息的办法,目前在测试华为平台时有如下问题:

集成后,onRegisterSucceed()可获得正确的id, 可以收到推送的消息,

但是onNotificationMessageArrived 和 onNotificationMessageClicked两个方法没有反应,IDE也没有相应的日志。

先前在集成小米推送的时候,如果Payload为空,onNotificationMessageArrived正常,onNotificationMessageClicked无反应

但是目前我的测试,使用华为推送,无论Payload是否为空,onNotificationMessageArrived 和 onNotificationMessageClicked两个方法均没有反应

希望得到您的帮助

如不接入华为推送,使用默认的小米推送 在华为android10手机上无法注册成功

目前只有测试了华为荣耀20 android10

1、在不接入华为相关sdk的情况下,也无法成功注册小米推送sdk
提示如下:
register all mi
[Thread:13149] sdk_version = 3_7_6
[Thread:13149] get region from system, region = cn
[Thread:13149] get region from system, region = cn
[Thread:13149] loadClass fail hasContext= false, errMsg = miui.os.Build
[Thread:13149] Don't send message before initialization succeeded!
[Thread:13149] Don't send message before initialization succeeded!

2、在接入华为相关sdk的情况下,如果华为sdk注册失败,无法继续注册小米推送

3、貌似不可以指定支持哪些厂商推送。例如仅接入小米 或者其中的某几个

demo运行出错

Error:Execution failed for task ':client-core:processDebugAndroidTestManifest'.

Manifest merger failed with multiple errors, see logs

华为手机获取MixPush-getRegisterId->超时

项目集成了com.tencent.mm:AndResGuard,当用压缩打包方式的时候,打出来的包在华为手机上获取MixPush-getRegisterId->超时,hms get token failed com.huawei.hms.common.ApiException: 907122050: operation in MAIN thread prohibited https://developer.huawei.com/consumer/cn/doc/development/HMSCore-References-V5/error-code-0000001050255690-V5->com.huawei.hms.common.ApiException: 907122050: operation in MAIN thread prohibited
System.err: at com.mixpush.core.MixPushClient$1.run(MixPushClient.java:185)
按照华为文档上的error码处理方式都检查过了,appid什么的都是配置正确,
很奇怪,如果直接run项目的话,就能获取到华为手机的registerid,就能推送成功,所以怀疑是AndResGuard压缩打包的时候导致的获取失败,但是我暂时还没找到解决办法,只能先不用AndResGuard压缩打包,请问大家这个有好的解决方法吗

接收消息

大佬,请问在收到消息时 并没有走 onNotificationMessageArrived 回调 (只有小米正常回调了) 是什么原因呢? APPID 什么的都没错,

服务端pom似乎需要简单修改

README的

        <dependency>
            <groupId>com.mixpush</groupId>
            <artifactId>mixpush-sender</artifactId>
            <version>2.0.2</version>
            <type>pom</type>
        </dependency>

似乎只导入了依赖,但没有导入sender本身;去掉<type>后正常:

        <dependency>
            <groupId>com.mixpush</groupId>
            <artifactId>mixpush-sender</artifactId>
            <version>2.0.2</version>
        </dependency>

如何不启用某个厂商推送的通道?

你好,我是个个人开发者,只能申请到小米、华为、魅族的推送权限,无法申请到 OPPO 和 VIVO 的,因为这两家需要企业开发者才能申请。所以当我尝试去掉 OPPO 和 VIVO 的依赖时,发现 MixPush 初始化的时候报错了,提示无法找到 OPPO 和 VIVO 的相关类,导致无法完成初始化,也就没法拿到 regId。若不去除 OPPO 和 VIVO 的依赖,则初始化时提示没有找到 OPPO 对应的 appId(因为我没有,我的机型是 OPPO)

所以请问可以实现我只开启小米、华为、魅族的厂商通道,而其他机型一律使用默认的小米 Push 来接收吗?

推荐的本地开发方式?

你好,

我想fork这个库,在本地开发加些功能,然后再merge回来。不知道有什么推荐的方式吗?

尝试了jitpack,这个项目因为有多个子目录好像不支持;尝试直接gradle导入(settings.gradle做include),好像和Flutter冲突了。

谢谢

注册后回调方法中platform总是等于null

之前集成后是正常的可以获取到platform信息的,今天运行项目突然发现这个回调得到的platform总是空,请问可能是什么问题导致的呢?谢谢!代码如下:
MixPushClient.getInstance().setPushReceiver(new MyPushReceiver());
MixPushClient.getInstance().register(this);
MixPushClient.getInstance().getRegisterId(this, new GetRegisterIdCallback() {
public void callback(MixPushPlatform platform) {
if (platform != null) {
Log.i("mixpush","platform: " + platform.getPlatformName() +" regId: " + platform.getRegId());
// TODO MyPushReceiver的回调中或者在这里 上报regId给服务端,调用我们自己提供的接口

            } else {
                Log.i("mixpush","platform: null");
            }   
        }
    });

小米手机推送报错

老师你好!
按照demo以及注册了华为和小米开发者平台,华为推送测试ok,小米手机利用服务端推送则报错.
有效报错log:
[ messageId=Xcm60262621473762966Eb errorCode=21301 reason=Invalid application secret. trace_id=Xcm60262621473762966Eb ]
UnifiedPushMessage{title='这里是标题', content='这里是副标题', platform='null', payload='{"url":"http://www.baidu.com"}', passThrough=false}

华为推送(后端)无法使用,报错:No appropriate protocol (protocol is disabled or cipher suites are inappropriate)

No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:436)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:384)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:376)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
at com.huawei.push.messaging.HuaweiMessageClientImpl.sendRequest(HuaweiMessageClientImpl.java:144)
at com.huawei.push.messaging.HuaweiMessageClientImpl.send(HuaweiMessageClientImpl.java:76)
at com.huawei.push.messaging.HuaweiMessaging.sendMessage(HuaweiMessaging.java:134)
at com.huawei.push.messaging.HuaweiMessaging.sendMessage(HuaweiMessaging.java:86)
at ....mix_push_source.provider.HuaweiPushProvider.sendMessageToSingle(HuaweiPushProvider.java:41)

魅族手机不回调 onNotificationMessageClicked 方法的情况

环境:
Meizu Pro5
Android 7.0
你好,我在使用推送时出现 “必须设置 setPushReceiver() 才能正常工作”。出现操作,App没有进程时(App杀死状态),收到的推送消息,这是点击推送消息正常是会回调 onNotificationMessageClicked 方法。但是现在点击推送时只有如下日志打印:
E/MixPush: onNotificationMessageClicked UnifiedPushMessage{title='推送', content='推送推送推送', platform='meizu', payload='{"url":"app://lineUpPlay"}', passThrough=false}

推测方法是在 DefaultMixPushReceiver->onNotificationMessageClicked()中。

我的项目初始化是在Appcalition中的onCreate()方法中。

MixPushPlatform为空

在Application初始化中,回调的MixPushPlatform 一直为空是怎么回事

MixPushClient.getInstance().getRegisterId(this, new GetRegisterIdCallback() {
public void callback(MixPushPlatform platform) {
Log.e("GetRegisterIdCallback", platform.toString());
}
});

onRegisterSucceed和getRegisterId的关系?

你好,

请问onRegisterSucceed和getRegisterId的关系,如果在onRegisterSucceed中上传了regid,是否就可以无视getRegisterId(阅读README,我猜可能是?)

p.s. 用于正在开发的flutter库

谢谢

设置默认推送平台无效

我在Application文件中设置
MixPushClient.getInstance().register(this,"huawei");

但是在Receiver里的onRegisterSucceed中,getPlatformName仍然是mi

华为推送

1:直接使用华为的推送,在杀死应用的情况下,可以拉起指定页面;集成MixPush,在杀死应用的情况下,在自定义的Receiver收不到华为点开通知的回调

小米推送register时是否要判断主进程

文档(https://dev.mi.com/console/doc/detail?pId=41 )中提到,

注意:

因为推送服务XMPushService在AndroidManifest.xml中设置为运行在另外一个进程,这导致本Application会被实例化两次,所以我们需要让应用的主进程初始化。
在非MIUI平台下,如果targetSdkVersion>=23,需要动态申请电话和存储权限,请在申请权限后再调用注册接口,否则会注册失败。

相关示例代码

public class DemoApplication extends Application {

...

    @Override
    public void onCreate() {
        super.onCreate();
        //初始化push推送服务
        if(shouldInit()) {
            MiPushClient.registerPush(this, APP_ID, APP_KEY);
        }
...
    }

    private boolean shouldInit() {
        ActivityManager am = ((ActivityManager) getSystemService(Context.ACTIVITY_SERVICE));
        List<RunningAppProcessInfo> processInfos = am.getRunningAppProcesses();
        String mainProcessName = getApplicationInfo().processName;
        int myPid = Process.myPid();
        for (RunningAppProcessInfo info : processInfos) {
            if (info.pid == myPid && mainProcessName.equals(info.processName)) {
                return true;
            }
        }
        return false;
    }
}

但读了一下MixPush源码,好像没有判断这个

谢谢

MixPush的注册方法可以移除某个渠道吗?

你好,我们的app,oppo推送后台表示不支持,也就是说我们无法用oppo推送的,请问这个情景我如何解决比较便捷呢?有办法直接把oppo去掉,用小米推送去掉去代替吗?谢谢!

需要适配Android 12 ,否则无法安装

com.mixpush.huawei.HmsMessageReceiveActivity: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present'

需要添加android:exported="true"

华为10.0闪退

Attempt to invoke interface method 'void com.mixpush.core.MixPushPassThroughReceiver.onReceiveMessage

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.