简体   繁体   English

小部件Android Billing Version 3的应用内购买

[英]In-App purchase for widget Android Billing Version 3

I am looking to restrict access to a new widget I have added to one of my Android apps, so that it is available as an In-App purchase. 我希望限制对已添加到我的一个Android应用程序中的新窗口小部件的访问,因此可以作为应用程序内购买来使用。 Is there a way to check to see if the widget as been purchased and if not the stop the user from being able to use it? 有没有一种方法可以检查小部件是否已购买,如果没有,则阻止用户使用它?

I can easily query items in Activity classes but in the AppWidgetProvider I am struggling to get there. 我可以轻松地在Activity类中查询项目,但是在AppWidgetProvider中,我却难以到达那里。

If it is possible, could you provide either a link or some sample code to nudge me in the right direction. 如果可能,您是否可以提供链接或一些示例代码来向正确的方向推动我。

Okay, since there was no help I managed to find a work around myself ;) 好吧,由于没有帮助,我设法在自己周围找到了工作;)

Incase anyone else wants to know :- 如果其他人想知道:

When the In-app product is purchased I add a unique identifier to the shared preferences and recall it when it tries to create the widget. 购买应用内商品后,我会向共享的首选项添加一个唯一的标识符,并在尝试创建窗口小部件时对其进行调用。

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

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