简体   繁体   English

android每次(dayli)在线和离线验证来自应用程序的订阅有效性,无需个人服务器

[英]android verify subscription validity from app every time (dayli) online and offline without a personal server

The problem: I have an app that is provided in subscription. 问题:我有一个订阅中提供的应用程序。 The user may or may not have an internet connection after they have purchased it. 用户购买后可能有也可能没有互联网连接。 I need to check the status of the subscription from the app but without a support server. 我需要从应用程序检查订阅的状态,但没有支持服务器。 It is strongly advised not to use API access directly from the app. 强烈建议不要直接从应用程序使用API​​访问。 How the hell do I warn the user that the subscription has expired and need to renew it so that it may block the use of the application? 我该如何警告用户订阅已过期并需要续订以便它可能会阻止使用该应用程序? I'm studying API OAuth2.0 access to use Purchases.subscriptions in my app so I can periodically check my subscription status and block the application if it's over, but I have a lot of difficulty implementing it. 我正在学习API OAuth2.0访问以在我的应用程序中使用Purchases.subscriptions,所以我可以定期检查我的订阅状态并阻止应用程序,如果它已经结束,但我实现它有很多困难。 I also thought about putting an alarm in the app so that when the subscription expires notice the user who needs to renew it (I have already implemented the purchase libraries for the purpose) but that means saving data on the user's device and I do not like . 我还想过在应用程序中发出警报,以便在订阅到期时通知需要更新它的用户(我已经为此目的实现了购买库)但这意味着在用户的设备上保存数据而我不喜欢。 All the tips are well accepted. 所有提示都被广泛接受。

If you don't plan to use a back end server, then you have to use API access directly from the app as you mention...there really is no way around it. 如果您不打算使用后端服务器,那么您必须直接从应用程序中使用API​​访问...正如您所说的那样。 I do think it is annoying that it is not easier to get basic subscription expiration information more easily for smaller developers who are not going to be running a backend server. 我认为,对于不打算运行后端服务器的小型开发人员而言,更容易获得基本订阅到期信息并不容易。

Without calling the API, you can get the autorenew boolean value from the purchase object to know if the subscription has been cancelled or not. 如果不调用API,您可以从购买对象获取autorenew布尔值,以了解订阅是否已被取消。 However you won't have the expiration date with is pretty important. 但是,您没有过期日期非常重要。

I'd say that if your app is not going to be a crazy popular one that others will try to reverse engineer then you can take the chance to call the API from within the app to get the detailed subscription information. 我要说的是,如果你的应用程序不是一个疯狂的流行应用程序,其他人会尝试进行逆向工程,那么你可以抓住机会从应用程序内调用API来获取详细的订阅信息。 Also, saving data about the subscription should be fine in sharedpreferences on the user device. 此外,保存有关订阅的数据应该在用户设备上的共享偏好中正常。

Please share how it's been going for you so far. 请分享到目前为止你的情况。

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

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