Hi can anyone please solve the issue have added billing lifecycle events in android component lifecycle events but i am getting annotation getting deprecated library i am using
def lifecycle_version = "2.2.0" implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version" implementation "androidx.lifecycle:lifecycle-runtime:$lifecycle_version" annotationProcessor "androidx.lifecycle:lifecycle-compiler:$lifecycle_version"
I am using google billing version as
implementation "com.android.billingclient:billing:4.0.0" my class
public class BillingClientLifecycle implements DefaultLifecycleObserver, PurchasesUpdatedListener,
> BillingClientStateListener, SkuDetailsResponseListener{
> @OnLifecycleEvent(Lifecycle.Event.ON_CREATE)
> public void create() {
> Log.d(TAG, "ON_CREATE");
> Create a new BillingClient in onCreate().
> Since the BillingClient can only be used once, we need to create a new instance
> after ending the previous connection to the Google Play Store in onDestroy().
> billingClient = BillingClient.newBuilder(app)
> .setListener(this)
> .enablePendingPurchases() // Not used for subscriptions.
> .build();
> SharedPreferences msharedPreferences= PreferenceManager.getDefaultSharedPreferences(app);
> editor = msharedPreferences.edit();
> if (!billingClient.isReady()) {
> Log.d(TAG, "BillingClient: Start connection...");
> billingClient.startConnection(this);
> }
> }
> }
>
after subscription expires the billing lifecycle not calling onCreate method which is causing unlocking features
I exteneded LifecycleObserver class which is not working properly