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

vivo新款手机需要添加权限才可以 #366

Open
Zachary46 opened this issue Jun 29, 2021 · 2 comments
Open

vivo新款手机需要添加权限才可以 #366

Zachary46 opened this issue Jun 29, 2021 · 2 comments

Comments

@Zachary46
Copy link

具体实现

a. 添加权限:

b. 应用在需要显示桌面角标的场景,通过广播将信息发送给vivoLauncher:

广播参数:

action:launcher.action.CHANGE_APPLICATION_NOTIFICATION_NUM

packageName:应用包名

className:主类名

notificationNum:未读消息数目

简单示例:

Intent intent = new Intent();

int missedCalls = 10;

intent.setAction("launcher.action.CHANGE_APPLICATION_NOTIFICATION_NUM");

intent.putExtra("packageName", "com.android.xxxx");

intent.putExtra("className", "com.android.xxxx.Mainxxxx");

intent.putExtra("notificationNum", missedCalls);

intent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);

sendBroadcast(intent);

注意:

在8.0上,还需要给Intent加上下面的flag

Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND

@ousq
Copy link

ousq commented Aug 16, 2021

launcher.action.CHANGE_APPLICATION_NOTIFICATION_NUM

as 这个打不出来 FLAG_RECEIVER_INCLUDE_BACKGROUND

@yfdyh000
Copy link

launcher.action.CHANGE_APPLICATION_NOTIFICATION_NUM

as 这个打不出来 FLAG_RECEIVER_INCLUDE_BACKGROUND

#368 试一下。

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