Add BillingDependencies and shared implementation.

This commit is contained in:
Alex Hart
2024-09-05 13:46:55 -03:00
committed by Cody Henthorne
parent 36bfd19bcf
commit 982b90d423
6 changed files with 67 additions and 10 deletions

View File

@@ -452,7 +452,7 @@ public class ApplicationDependencyProvider implements AppDependencies.Provider {
@Override
public @NonNull BillingApi provideBillingApi() {
return BillingFactory.create(context, RemoteConfig.messageBackups());
return BillingFactory.create(GooglePlayBillingDependencies.INSTANCE, RemoteConfig.messageBackups());
}
@Override

View File

@@ -0,0 +1,25 @@
/*
* Copyright 2024 Signal Messenger, LLC
* SPDX-License-Identifier: AGPL-3.0-only
*/
package org.thoughtcrime.securesms.dependencies
import android.content.Context
import org.signal.core.util.billing.BillingDependencies
/**
* Dependency object for Google Play Billing.
*/
object GooglePlayBillingDependencies : BillingDependencies {
override val context: Context get() = AppDependencies.application
override suspend fun getProductId(): String {
return "backup" // TODO [message-backups] This really shouldn't be hardcoded into the app.
}
override suspend fun getBasePlanId(): String {
return "monthly" // TODO [message-backups] This really shouldn't be hardcoded into the app.
}
}