[英]Can i restrict users from using my app when user has declined let say, like push notifications
I am currently working on app, that in my thougths require push notifications, users can turn them off, but app needs them, so i am just showing alert to user "You need to allow push notifications to use this app", is it allowed in Android and IOS?我目前正在开发应用程序,在我看来需要推送通知,用户可以关闭它们,但应用程序需要它们,所以我只是向用户显示警报“您需要允许推送通知使用此应用程序”,是否允许在安卓和IOS? Are there any restrictions, like "i have to let user use the app even when notifications turned off"
是否有任何限制,例如“即使通知关闭,我也必须让用户使用该应用程序”
Apple's app review guidelines: Apple 的应用审查指南:
4.5.4 Push Notifications must not be required for the app to function, and should not be used for advertising, promotions, or direct marketing purposes or to send sensitive personal or confidential information.
4.5.4 推送通知不得是应用程序运行所必需的,不得用于广告、促销或直接营销目的或发送敏感的个人或机密信息。 Abuse of these services may result in revocation of your privileges.
滥用这些服务可能会导致您的特权被撤销。
https://developer.apple.com/app-store/review/guidelines/#design https://developer.apple.com/app-store/review/guidelines/#design
There is a method called ContextCompat.checkSelfPermission()
which you can use in android to automatically check every time when user is using your app.有一个名为
ContextCompat.checkSelfPermission()
的方法,您可以在 android 中使用它在每次用户使用您的应用程序时自动检查。 Something like below:像下面这样:
if (ContextCompat.checkSelfPermission(yourCurrentActivity, Manifest.permission.YOUR_PERMISSION)
!= PackageManager.PERMISSION_GRANTED) {
// Permission is not granted (You can perform whatever functionality you want to if permission is denied)
}
If the app has the permission, the method returns PERMISSION_GRANTED
, and the app can proceed with the operation.如果应用有权限,该方法返回
PERMISSION_GRANTED
,应用可以继续操作。 If the app does not have the permission, the method returns PERMISSION_DENIED
, and the app has to explicitly ask the user for permission.如果应用程序没有权限,则该方法返回
PERMISSION_DENIED
,应用程序必须明确要求用户授予权限。
You can read more in here.你可以在这里阅读更多。
However, this is not the case with IOS applications.但是,IOS 应用程序并非如此。 You cannot restrict the application to use a certain permission like push notification in your case.
在您的情况下,您不能限制应用程序使用某些权限,例如推送通知。 You can follow some best practices.
您可以遵循一些最佳实践。 These are stringent guidelines from developers as well which you have to stick to.
这些都是来自开发人员的严格指导方针,您也必须遵守。 Read this for the IOS push notification guidelines.
阅读此内容以了解 IOS 推送通知指南。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.