Delphi Can
Google Play Billing Versiyon Sorunu[ÇÖZÜLDÜ] - Baskı Önizleme

+- Delphi Can (https://www.delphican.com)
+-- Forum: Delphi (https://www.delphican.com/forumdisplay.php?fid=3)
+--- Forum: Mobil Platform - FireMonkey (FMX) (https://www.delphican.com/forumdisplay.php?fid=7)
+--- Konu Başlığı: Google Play Billing Versiyon Sorunu[ÇÖZÜLDÜ] (/showthread.php?tid=8347)

Sayfalar: 1 2


Cvp: Google Play Billing Versiyon Sorunu - codder71 - 31-07-2026

(31-07-2026, Saat: 06:41)emailx45 Adlı Kullanıcıdan Alıntı: If the freezing has stopped, that is already a good sign. It means the errors have been isolated and the flow is successfully reaching its destination. However, that doesn't guarantee that your implementation is 100% correct!

In any case, never use modal windows to display messages in a mobile environment—especially within a thread! It is always better to delegate these tasks to the system's messaging mechanism, for instance.

You could create a class using the Observer pattern to send your messages, or use the standard "TMessageManager" class, which allows you to subscribe an object—such as the active form—to receive them.

Regarding the event that isn't firing, you need to check exactly when the "Billing" library triggers it. Unfortunately, I am not very familiar with this library, so you will need to research it further to understand which events it triggers and when.

Here is a draft I put together based on your code.

Galiba sorunun ne olduğunu buldum. Yukarıda paylaştığım kodu billing-8.0.0 dan geri eski billing-7.1.1 getirdiğimde ve manifesti o duruma göre düzenlediğimde uygulama direk çalışıyor ve onProductDetailsResponse tetikleniyor. Hatta satın alma metotları da aktif oluyor galiba IDE 8.0.0 desteklemiyor. Bu durumda ne yapabilirim yeni sürüm mü çıkmasını beklemem lazım yoksa buna bir çözüm var mı yardımlarınızı bekliyorum.


Cvp: Google Play Billing Versiyon Sorunu - emailx45 - 31-07-2026


  1. First you must be aware of Google's new requirements to use version 8.0 of Billing... some methods have been removed or reformulated, and require new parameters. Therefore, there are modifications that were not required until version 8.0.
  2. Second, if you use the Delphi Settings menu to set Billing permissions or options in the Project->Options menu, you will necessarily be using the settings for version v7.1.1, so to use version v8.0 (currently in Delphi 13.x), you should not use the ide menu, but enter the information manually in AndroidManifest.Template.xml. (Who knows, in Delphi 13.2 Embarcadero will already use version 8.0 of Billing)
  3. When using the unit I send you ("AndroidAPi.JNI.InAppBilling.pas") note that the methods may differ from the v7.1.1 version in the parameterization.
  4. Here are some methods:
    When using the unit I send you ("AndroidAPi.JNI.InAppBilling.pas") note that the methods may differ from the v7.1.1 version in the parameterization.

    Here are some methods:
    1) BillingStateListener: 
         procedure onBillingServiceDisconnected; cdecl; 
         procedure onBillingSetupFinished( billingResult: JBillingResult ); cdecl;
    2) PurchasesUpdatedListener: 
         constructor Create( const AOnPurchaseUpdated: TProc<JBillingResult, JList> ); 
         procedure onPurchasesUpdated( billingResult: JBillingResult; purchases: JList ); cdecl;
    3) BillingConnection:
         procedure HandlePurchasesUpdated( ABillingResult: JBillingResult; APurchases: JList );
    4) BillingPurchase
         function LaunchPurchaseFlow( ABillingClient: JBillingClient; AProductDetails: JProductDetails ): Boolean;
    5) PurchasesResponseListener 
         constructor Create( const AOnResponse: TProc<JBillingResult, JList> ); 
         procedure onQueryPurchasesResponse( billingResult: JBillingResult; purchasesList: JList ); cdecl;
    6) BillingQueryPurchases
         procedure HandleResponse( ABillingResult: JBillingResult; APurchasesList: JList );
         procedure QueryActivePurchases( ABillingClient: JBillingClient );
    7) ConsumeResponseListener 
         constructor Create( const AOnResponse: TProc<JBillingResult, JString> ); 
         procedure onConsumeResponse( billingResult: JBillingResult; purchaseToken: JString ); cdecl;
    8) BillingConsume
         procedure HandleResponse( ABillingResult: JBillingResult; APurchaseToken: JString );
         procedure Consume( ABillingClient: JBillingClient; const APurchaseToken: string );
    9) BillingCatalog
         procedure HandleResponse( ABillingResult: JBillingResult; AProductDetailsList: JList );
         procedure QueryProducts( ABillingClient: JBillingClient; const AProductIds: TArray<string> );
    10) AcknowledgePurchaseResponseListener
         constructor Create( const AOnResponse: TProc<JBillingResult> ); 
         procedure onAcknowledgePurchaseResponse( billingResult: JBillingResult ); cdecl;
    11) BillingAcknowledge
         procedure HandleResponse( ABillingResult: JBillingResult );
         procedure Acknowledge( ABillingClient: JBillingClient; const APurchaseToken: string );


  5. example: LBuilder.enablePendingPurchases( LJPendingPurchasesParams );



Cvp: Google Play Billing Versiyon Sorunu - codder71 - 01-08-2026

Merhabalar yardımlarınız için çok teşekkür ederim sorun çözülmüştür

Google play developer sitesindeki Billing 8.0 değişiklikleri  Androidapi.JNI.InAppBilling uyguladıktan sonra listener tetiklendi ve sorun çözüldü.
Altta düzenlenmiş Androidapi.JNI.InAppBilling pas dosyası mevcut.

{$IFDEF ANDROID}
type
 // Bağlantı durumunu dinleyen sınıf
 TBillingClientStateListener = class(TJavaLocal, JBillingClientStateListener)
 private
   FOnConnected: TThreadProcedure;
   FOnDisconnected: TThreadProcedure;
 public
   constructor Create(AOnConnected, AOnDisconnected: TThreadProcedure);
   procedure onBillingSetupFinished(billingResult: JBillingResult); cdecl;
   procedure onBillingServiceDisconnected; cdecl;
 end;

type
 // Satın alma sonuçlarını dinleyen zorunlu listener
 TPurchasesUpdatedListener = class(TJavaLocal, JPurchasesUpdatedListener)
 public
   procedure onPurchasesUpdated(billingResult: JBillingResult; purchases: JList); cdecl;
 end;

type
 // Ürün sorgulama sonucunu dinleyen sınıf

 TProductDetailsResponseListener = class(TJavaLocal, JProductDetailsResponseListener)
 private
 public
   constructor Create;
   procedure onProductDetailsResponse(billingResult: JBillingResult; productDetailsResult: JQueryProductDetailsResult); cdecl; // Bu kısım düzenlendi.
 end;
{$ENDIF}

Google Play Listener :

procedure TProductDetailsResponseListener.onProductDetailsResponse(
 billingResult: JBillingResult;
 productDetailsResult: JQueryProductDetailsResult); cdecl;
var
 LProductList: JList;
 I: Integer;
begin
 if (billingResult <> nil) and (billingResult.getResponseCode = TJBillingClient_BillingResponseCode.JavaClass.OK) then
 begin
   if productDetailsResult <> nil then
   begin
     LProductList := productDetailsResult.getProductDetailsList;

     if (LProductList <> nil) and (LProductList.size > 0) then
     begin
       frmSG_AnaForm.FProductDetailsList.Clear; // Önceki listeyi temizle

       for I := 0 to LProductList.size - 1 do
       begin
         // JObject'i JProductDetails'e çevirip TList'e ekliyoruz
         frmSG_AnaForm.FProductDetailsList.Add(
           TJProductDetails.Wrap(LProductList.get(I))
         );
       end;
     end;
   end;
 end;
end;