【发布时间】:2019-01-14 23:50:33
【问题描述】:
今天我的应用 Facetocall 被 Google 拒绝了
在按照政策要求请求相关权限之前,您的应用似乎没有提示用户成为默认处理程序。 请进行必要的更改以遵守政策 要求并通过声明表重新提交您的应用。
您的声明表单中列出了默认处理程序功能,但您的应用没有默认处理程序功能。
我的目标是制作一个默认的拨号器应用程序。
这是我的清单
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.gazman.beep"
android:installLocation="preferExternal">
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.READ_CALL_LOG" />
<uses-permission android:name="android.permission.WRITE_CALL_LOG" />
<uses-permission android:name="android.permission.SEND_SMS" />
... and other permissions
<application
android:name=".application.BeepApp"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
tools:ignore="GoogleAppIndexingWarning">
<activity
android:name=".system_intents.IntentsActivity"
android:launchMode="singleTask"
android:noHistory="true"
android:theme="@style/Theme.Transparent">
<intent-filter>
<action android:name="android.intent.action.DIAL" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.DIAL" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="tel" />
</intent-filter>
</activity>
<activity
android:name=".call.CallActivity"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:showForAllUsers="true" />
<service
android:name="com.gazman.beep.call.MyInCallService"
android:permission="android.permission.BIND_INCALL_SERVICE">
<meta-data
android:name="android.telecom.IN_CALL_SERVICE_UI"
android:value="true" />
<intent-filter>
<action android:name="android.telecom.InCallService" />
</intent-filter>
</service>
... And other declarations
</application>
</manifest>
当我的应用启动时,我会这样做:
private void checkDefaultHandler() {
if (isAlreadyDefaultDialer()) {
return;
}
Intent intent = new Intent(TelecomManager.ACTION_CHANGE_DEFAULT_DIALER);
intent.putExtra(TelecomManager.EXTRA_CHANGE_DEFAULT_DIALER_PACKAGE_NAME, getPackageName());
if (intent.resolveActivity(getPackageManager()) != null) {
startActivityForResult(intent, REQUEST_CODE_SET_DEFAULT_DIALER);
}
else{
throw new RuntimeException("Default phone functionality not found");
}
}
private boolean isAlreadyDefaultDialer() {
TelecomManager telecomManager = (TelecomManager) getSystemService(TELECOM_SERVICE);
return getPackageName().equals(telecomManager.getDefaultDialerPackage());
}
我在这里错过了什么?
我尝试再次提交表单,这次我添加了一个video,它在模拟器上显示了我的应用程序(我在所有真实设备上也看到了相同的行为)这是我得到的回复:
- 在按照政策要求请求相关权限之前,您的应用似乎没有提示用户成为默认处理程序。 请进行必要的更改以遵守政策 要求并通过声明表重新提交您的应用。
【问题讨论】:
-
Google 最近宣布,如果应用程序不是默认的 SMS 或 CALL 应用程序,则不应请求 SMS 权限或通话记录权限。出于安全原因,它这样做了。在这里找到文章链接support.google.com/googleplay/android-developer/answer/9047303。在我看来,因为您想充当默认呼叫应用程序并使用上述敏感权限,所以您必须告诉用户您为什么需要这些权限以及为什么他应该在对话的帮助下允许您在继续触发 @ 987654326@.
-
@AbhishekMadan 在您发送给我的链接上,单击:短信和通话记录权限的允许使用,它将显示我的用例。
-
If you believe your app meets the policy requirements for acceptable use or is eligible for an exception, submit a Permissions Declaration Form as soon as possible for Google Play to review. You will be notified if your request has been approved. You do not need to have implemented APK changes in order to submit the Declaration Form.。所以,我相信你只需要按照他们说的提交申报表。 -
是的,我做到了,但我收到了问题中提到的拒绝
-
他们说的是您的应用程序应该是默认处理程序,然后才能询问和使用权限。关键是应用程序在调用
isAlreadyDefaultDialer()之前所做的事情。在成为默认处理程序之前,您是否要求或使用权限?