简体   繁体   English

如何解决此“无法在运行时权限之前触发默认处理程序提示”

[英]how to fix this "Unable to trigger default handler prompt prior to runtime permissions"

Today i received this mail from google team my app publishing status: Rejected.今天我收到了来自谷歌团队的这封邮件我的应用程序发布状态:被拒绝。

Unable to trigger default handler prompt prior to runtime permissions *If your app is a default handler, the default handler prompt must precede the runtime permission prompt.无法在运行时权限提示之前触发默认处理程序提示*如果您的应用程序是默认处理程序,则默认处理程序提示必须在运行时权限提示之前。

Based on our review, your app doesn't appear to properly trigger the default handler prompt prior to the runtime permissions prompt.根据我们的审查,您的应用似乎没有在运行时权限提示之前正确触发默认处理程序提示。 Please add the default handler prompt prior to any runtime permissions prompt.*请在任何运行时权限提示之前添加默认处理程序提示。*

Please help for solve this and i also used default handler prompt but don't know why google sent me this mail.请帮助解决这个问题,我也使用了默认处理程序提示,但不知道谷歌为什么给我发这封邮件。

You need to explicitly prompt the default handler instead of simply declaring permissions in the manifest.您需要明确提示默认处理程序,而不是简单地在清单中声明权限。

RoleManager roleManager = (RoleManager) 
activity.getSystemService(Context.ROLE_SERVICE);
Intent intent = roleManager.createRequestRoleIntent(RoleManager.ROLE_DIALER);
activity.startActivityForResult(intent, requestCode);

For changing the default handler:要更改默认处理程序:

Intent setDefaultSmsIntent = new Intent(Telephony.Sms.Intents.ACTION_CHANGE_DEFAULT);
setDefaultSmsIntent.putExtra(Telephony.Sms.Intents.EXTRA_PACKAGE_NAME, getPackageName());
startActivityForResult(setDefaultSmsIntent, requestCode);

From Google's Android documentation, this about the Play Store policy .来自 Google 的 Android 文档,这是关于Play Store policy的。

Given the sensitive user information that an app accesses while serving as a default handler, your app cannot become a default handler unless it meets the following Play Store listing and core functionality requirements:鉴于应用在作为默认处理程序时访问的敏感用户信息,您的应用不能成为默认处理程序,除非它满足以下 Play 商店列表和核心功能要求:

Your app must be able to perform the functionality for which it's a default handler.您的应用程序必须能够执行其作为默认处理程序的功能。 For example, a default SMS handler should be able to send text messages.例如,默认的 SMS 处理程序应该能够发送文本消息。

Your app must provide a privacy policy.您的应用必须提供隐私政策。

Your app must make its core functionality clear in the Play Store description.您的应用必须在 Play 商店说明中明确说明其核心功能。

For example, a default Phone handler should describe its phone-related capabilities in the description.例如,默认电话处理程序应在描述中描述其与电话相关的功能。

Your app must declare permissions that are appropriate for its use case.您的应用程序必须声明适合其用例的权限。 For more details about which permissions you can declare as a given handler, see the guidance on using SMS or call log permission groups in the Play Console Help Center.有关您可以将哪些权限声明为给定处理程序的更多详细信息,请参阅 Play 管理中心帮助中心中有关使用短信或通话记录权限组的指南。

Your app must ask to become a default handler before it requests the permissions associated with being that handler.您的应用程序必须先请求成为默认处理程序,然后才能请求与成为该处理程序相关的权限。 For example, an app must request to become the default SMS handler before it requests the READ_SMS permission.例如,应用程序必须先请求成为默认的 SMS 处理程序,然后才能请求 READ_SMS 权限。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM