Skip to content
This repository has been archived by the owner on Nov 19, 2018. It is now read-only.

flyme 推送的点击事件目前还不能用是吗 #201

Open
wdeo3601 opened this issue Jan 19, 2018 · 0 comments
Open

flyme 推送的点击事件目前还不能用是吗 #201

wdeo3601 opened this issue Jan 19, 2018 · 0 comments

Comments

@wdeo3601
Copy link

wdeo3601 commented Jan 19, 2018

4.6.1版本:

//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.avos.avoscloud;

import android.content.Context;
import android.content.Intent;
import com.avos.avoscloud.LogUtil.avlog;
import com.meizu.cloud.pushsdk.MzPushMessageReceiver;
import com.meizu.cloud.pushsdk.notification.PushNotificationBuilder;
import com.meizu.cloud.pushsdk.platform.message.PushSwitchStatus;
import com.meizu.cloud.pushsdk.platform.message.RegisterStatus;
import com.meizu.cloud.pushsdk.platform.message.SubAliasStatus;
import com.meizu.cloud.pushsdk.platform.message.SubTagsStatus;
import com.meizu.cloud.pushsdk.platform.message.UnRegisterStatus;

public class AVFlymePushMessageReceiver extends MzPushMessageReceiver {
    private final String FLYME_VERDOR = "mz";

    public AVFlymePushMessageReceiver() {
    }

    private void updateAVInstallation(String flymePushId) {
        if(!AVUtils.isBlankString(flymePushId)) {
            AVInstallation installation = AVInstallation.getCurrentInstallation();
            if(!"mz".equals(installation.getString("vendor"))) {
                installation.put("vendor", "mz");
            }

            if(!flymePushId.equals(installation.getString("registrationId"))) {
                installation.put("registrationId", flymePushId);
            }

            String localProfile = installation.getString("deviceProfile");
            localProfile = null != localProfile?localProfile:"";
            if(!localProfile.equals(AVMixpushManager.flymeDevicePrifile)) {
                installation.put("deviceProfile", AVMixpushManager.flymeDevicePrifile);
            }

            installation.saveInBackground(new SaveCallback() {
                public void done(AVException e) {
                    if(null != e) {
                        avlog.d("update installation error!");
                    } else {
                        avlog.d("flyme push registration successful!");
                    }

                }
            });
        }

    }

    public void onRegister(Context context, String s) {
    }

    public void onMessage(Context context, String s) {
        AVNotificationManager.getInstance().processMixPushMessage(s);
    }

    public void onMessage(Context context, Intent intent) {
    }

    /** @deprecated */
    @Deprecated
    public void onUnRegister(Context context, boolean b) {
    }

    public void onPushStatus(Context context, PushSwitchStatus pushSwitchStatus) {
    }

    public void onRegisterStatus(Context context, RegisterStatus registerStatus) {
        String pushId = registerStatus.getPushId();
        if(!AVUtils.isBlankContent(pushId)) {
            this.updateAVInstallation(pushId);
        }

    }

    public void onUnRegisterStatus(Context context, UnRegisterStatus unRegisterStatus) {
    }

    public void onSubTagsStatus(Context context, SubTagsStatus subTagsStatus) {
    }

    public void onSubAliasStatus(Context context, SubAliasStatus subAliasStatus) {
    }

    public void onUpdateNotificationBuilder(PushNotificationBuilder pushNotificationBuilder) {
    }

    public void onNotificationArrived(Context context, String title, String content, String selfDefineContentString) {
    }

    public void onNotificationClicked(Context context, String title, String content, String selfDefineContentString) {
        AVNotificationManager.getInstance().processMixNotification(selfDefineContentString, "com.avos.avoscloud.flyme_notification_action");
    }

    public void onNotificationDeleted(Context context, String title, String content, String selfDefineContentString) {
    }

    public void onNotifyMessageArrived(Context context, String message) {
    }
}

@wdeo3601 wdeo3601 changed the title flyme flyme 推送的点击事件目前还不能用是吗 Jan 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant