简体   繁体   English

当用户拒绝时,我可以限制用户使用我的应用程序,比如推送通知

[英]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.

相关问题 向我的应用程序用户发送推送通知 - Send Push Notifications to my app users 如何让用户在我的 android 应用程序中保持登录状态 - How can I let users remain logged in my android app 我无法在Parse的应用程序中收到推送通知 - I can't receive push notifications in app from Parse 如何将Java程序变成可以发送推送通知的“应用程序”? - How do I turn my Java program into an “app” that can send push notifications? 如何使用Pushbots在我现有的Android应用程序中添加推送通知 - how to add push notifications in my existing android app using pushbots 我如何让用户从我的jDeveloper 10g网站下载文件? - How can I let me users download a file from my jDeveloper 10g website? 当我从addMouseListener关闭我的fram时,它说这是不兼容的类型,那么我可以改变它吗? - When i close my fram from addMouseListener it say that this is incompatible type so with what can i change this? 如何使用 Firebase 从我的服务器发送 iOS 推送通知? - How to send iOS push notifications from my server using Firebase? 我如何通过另一个方法(例如主方法)的调用来运行testNG? - How can I run testNG through a call from another method, let's say a main method? 如何限制未授权用户(URL)的请求? - How can i restrict the request from the unauthorized users (url's)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM