-
Content Count
75 -
Joined
-
Last visited
-
billing library 5.2.0 D11, Play billing Library 5.2.0
toufik replied to toufik's topic in Cross-platform
after i add the code below no error nothing just like the first submit any idea ? types procedure InAppPurchase1Error(Sender: TObject; ErrorKind: TFailureKind; const ErrorMessage: string); procedure TFormMain.FormCreate(Sender: TObject); begin // the code before then ....this InAppPurchase1.OnError := InAppPurchase1Error; end; procedure TFormMain.InAppPurchase1Error(Sender: TObject; ErrorKind: TFailureKind; const ErrorMessage: string); begin ShowMessage('Une erreur est survenue pendant l''achat : ' + ErrorMessage); end; -
hello everyone a few days ago i did tried to implement a one time purchase (make a paid android app ) there is no error showing except the message that i will show you next thing i did consider: Make sure the product ID in your code matches the ID of the product you created in the Google Play Console. Make sure that the product is published and active in the Google Play Console. Make sure that the account you are using to test the app is not the same account you used to create the product in the Google Play Console. i don't know what I'm missing i keep thinking that the new library is the problem (because its come with new change to how to implement purchase) i did publish the app in Internal testing. i did multiply approach and multiply attempt to fix this with no luck yet with the help of chat gpt . ps : following this topic. D11,unsupported version of Play billing - Cross-platform - Delphi-PRAXiS [en] (delphipraxis.net) my code: uses FMX.InAppPurchase; types procedure InAppPurchaseSetupComplete(Sender: TObject); procedure InAppPurchaseProductsRequestResponse(Sender: TObject; const Products: TIAPProductList; const InvalidProductIDs: TStrings); procedure InAppPurchasePurchaseCompleted(Sender: TObject; const ProductID: string; NewTransaction: Boolean); private function Purchase(const ProductId: string): Boolean; const NoAdsId = 'barcoderpro'; var FProductIsValid: Boolean; fisPurchased :Boolean; procedure TFormMain.FormCreate(Sender: TObject); {$IFDEF ANDROID} InAppPurchase1.ApplicationLicenseKey := 'key part 1'+ 'key part 2'; InAppPurchase1.ProductIDs.Add(NoAdsId); InAppPurchase1.OnSetupComplete := InAppPurchaseSetupComplete; InAppPurchase1.OnProductsRequestResponse := InAppPurchaseProductsRequestResponse; InAppPurchase1.OnPurchaseCompleted := InAppPurchasePurchaseCompleted; {$ENDIF} end; procedure TFormMain.InAppPurchaseSetupComplete(Sender: TObject); begin FIsPurchased := False; try InAppPurchase1.QueryProducts; except on E: Exception do ShowMessage(e.Message); end; end; procedure TFormMain.InAppPurchaseProductsRequestResponse(Sender: TObject; const Products: TIAPProductList; const InvalidProductIDs: TStrings); var Product: TProduct; begin FIsPurchased := False; for Product in Products do begin if NoAdsId = Product.ProductID then begin FProductIsValid := True; if InAppPurchase1.IsProductPurchased(NoAdsId) then begin FIsPurchased := True; // PURCHASED! ShowMessage('La version professionnelle est déjà activée'); end; end; end; end; procedure TFormMain.InAppPurchasePurchaseCompleted(Sender: TObject; const ProductID: string; NewTransaction: Boolean); begin if NewTransaction then begin ShowMessage('La version professionnelle activée'); FIsPurchased := True; end else ShowMessage('L''achat a été annulé'); end; function TFormMain.Purchase(const ProductId: string): Boolean; begin Result := False; {$IFDEF ANDROID} if InAppPurchase1.IsSetupComplete and InAppPurchase1.CanMakeInAppPurchases then begin InAppPurchase1.PurchaseProduct(ProductId); Result := True; end else ShowMessage('L''achat n''est pas possible pour le moment. Essayez plus tard.'); {$ENDIF} end; procedure TFormMain.btn7Click(Sender: TObject); begin // User is not registered yet or trial period has expired, proceed with purchase if Purchase(NoAdsId) then begin // Purchase successful //active the app pro // no trial period end; //////or if FIsPurchased then begin ShowMessage('La version professionnelle est déjà activée'); end else begin // User is not registered yet or trial period has expired, proceed with purchase if Purchase(NoAdsId) then begin // Purchase successful ShowMessage('La version professionnelle est activée.....'); end; end; Screenrecorder-2023-05-17-07-50-25-454.mp4
-
i read that the new library come with some few new properties change i'm looking to it. Google Play Billing Library 4 to 5 Migration Guide | Google Play's billing system | Android Developers
-
I'm trying to implement one time pruchase (i'm making a paid app ) so i did finish the code using belling v 4 i did not test it yet , i can share it so i do not know at all how handle the new update . uses FMX.InAppPurchase types procedure InAppPurchaseSetupComplete(Sender: TObject); procedure InAppPurchaseProductsRequestResponse(Sender: TObject; const Products: TIAPProductList; const InvalidProductIDs: TStrings); // procedure InAppPurchaseError(Sender: TObject; // FailureKind: TFailureKind; const ErrorMessage: string); procedure InAppPurchasePurchaseCompleted(Sender: TObject; const ProductID: string; NewTransaction: Boolean); const Nodemotrail = 'com.********.nameappid'; var FProductIsValid: Boolean; var fisPurchased :Boolean; procedure TFormMain.FormCreate(Sender: TObject); begin {$IFDEF ANDROID} InAppPurchase1.ApplicationLicenseKey := 'LicenseKey part1'+ 'LicenseKey part2'; InAppPurchase1.ProductIDs.Add(Nodemotrail); InAppPurchase1.OnSetupComplete := InAppPurchaseSetupComplete; {$ENDIF} procedure TFormMain.InAppPurchaseProductsRequestResponse(Sender: TObject; const Products: TIAPProductList; const InvalidProductIDs: TStrings); var Product: TProduct; begin fisPurchased := false; for Product in Products do begin if Nodemotrail = Product.ProductID then begin FProductIsValid := True; if InAppPurchase1.IsProductPurchased(Nodemotrail) then begin fisPurchased := true; // PURCHASED! end end; end; end; procedure TFormMain.InAppPurchasePurchaseCompleted(Sender: TObject; const ProductID: string; NewTransaction: Boolean); begin ShowMessage('La version professionnelle activée'); fisPurchased := True end; procedure TFormMain.InAppPurchaseSetupComplete(Sender: TObject); begin fisPurchased := False; try InAppPurchase1.QueryProducts; except on E:Exception do ShowMessage(e.Message); end; end; function TFormMain.Purchase(const ProductId: string): Boolean; begin Result := False; {$IFDEF ANDROID} if InAppPurchase1.IsSetupComplete and InAppPurchase1.CanMakeInAppPurchases then begin InAppPurchase1.PurchaseProduct(ProductId); Result := True; end else ShowMessage('Purchase not possibl now try later'); {$ENDIF} end; procedure TFormMain.btn7Click(Sender: TObject); begin // User is not registered yet or trial period has expired, proceed with purchase if Purchase(NoAdsId) then begin // Purchase successful .....
-
maybe this can help someone Potential fix for out-... | Unofficial RAD Studio Documentation (code-kungfu.com) the app got accpted in the google play store with no warning... i just need to update the code somehow
-
as you can see all the library there but say billing library is 4.0.0 wish mean that google needed 5 and up how to update it ? and i added <uses-permission android:name="com.android.vending.BILLING" /> to the AndroidManifest.template.xml file and this line to uses FMX.InAppPurchase
-
hi all When i use the Google Play In-app Billing service in my app i did tried to upload it i did get this message i'm using delphi 11.3 ce ,thank you ...
-
@programmerdelphi2k i did try it and worked fine thats alot
-
hello every one ... I'm trying pagination with SQLite database using live binding with a tlistview i did try using this guide: DB Pagination and TListView question - Databases - Delphi-PRAXiS [en] (delphipraxis.net) with some modification so i added the implement of pagination on PullToRefresh of the tlistview and work's fine . the problem that .... i want to keep the items that added to the tlistview every PullToRefresh and so on the code I used, can anyone point me to the right direction. procedure TFormMain.ListView2MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Single); begin if PullToRefreshCheck then begin if (Y-RefreshPos)>40 then begin if (FDTableTask.RecordCount < lMyMaxRecordsByPage) then exit; // FDTableTask.Disconnect; FDTableTask.FetchOptions.RecsSkip := FDTableTask.FetchOptions.RecsSkip + lMyMaxRecordsByPage; FDTableTask.Open(); Label48.Text := '...تحديث'; Label48.Visible := True; Timer3.Enabled := True; PullToRefreshCheck := False; RefreshPos := 0; end else begin Label48.Text := 'u retched the end '; end; end; bandicam_2023-01-22_20-18-24-671_(1).mp4
-
maybe i wasn't very clear,,,, i want the user to be able to back up the db in any folder i chose too for example : GetSharedPicturesPath . with all its structure and data and restore if he wants too to answer the second question, i create the db on create ,, and filled the table and its structure, the last part i will try it and get back to you soon as possible,,, thanks for taking the time to reply .
-
the problem was fixed by changing the rc file name ''resource file'' thank you all for help
-
hello every one ; using delphi 10.4.2 i need some help im trying to backup a sqllite database like this : var msg,CommonPath: string; SourceFile: string; BackupFile: string; begin FireTaskList.connected := False; SourceFile := TPath.combine(TPath.GetDocumentsPath,'tasks.s3db');// TPath.GetDocumentsPath +PathDelim+ 'tasks.s3db'; BackupFile := TPath.Combine( TPath.GetSharedPicturesPath, 'MyBackup.s3db'); if not FileExists(SourceFile) then Exit; msg := 'Create a file in the following location ' + sLineBreak+ ExtractFilePath(BackupFile); TDialogService.MessageDialog( msg, TMsgDlgType.mtConfirmation, mbYesNo, TMsgDlgBtn.mbYes, 0, procedure(const AResult: TModalResult) begin if AResult=mrYes then begin try FDSQLiteBackup1.Database := SourceFile; FDSQLiteBackup1.DestDatabase := BackupFile; FDSQLiteBackup1.Backup; ShowMessage( ExtractFileName(BackupFile)+' ...'+'saved' ); except on E: Exception do begin msg := E.ClassName + sLineBreak + E.Message; ShowMessage( msg ); mmo1.text := BackupFile; end; end; end; end ); end; and im keep getting an error message i did set the read and write permissions and i connected the database like this try FireTaskList.Connected := False; FireTaskList.Params.Clear; FireTaskList.LoginPrompt := False; FireTaskList.Params.Values['OpenMode'] :='=ReadWrite'; FireTaskList.Params.DriverID := 'SQLite'; FireTaskList.Params.Values['Database'] := TPath.combine(TPath.GetDocumentsPath,'tasks.s3db'); except on E: EDatabaseError do ShowMessag('cant connect' + E.Message);
-
the answer is procedure TForm1.Delete; begin dm.fdmedcin.RecNo := ControlList1.ItemIndex + 1; // seems like you add one in your OnBeforeDrawItem too dm.fdmedcin.Delete; ControlList1.ItemCount := fdmedcin.RecordCount; end;
-
I'm new to using component TControlList can someone help with this How exactly can a selected field or item from the TControlList can be deleted? i'm loding the items like this procedure TForm1.ControlList1BeforeDrawItem(AIndex: Integer; ACanvas: TCanvas; ARect: TRect; AState: TOwnerDrawState); begin dm.fdmedcin.RecNo := AIndex+1; lbl5.Caption := 'Spc:' +TStringField( dm.fdmedcin.FieldByName('Spc_doc') ).AsString ; ......... ......... ........ procedure TDM.fdmedcinAfterOpen(DataSet: TDataSet); begin form1.ControlList1.ItemCount := fdmedcin.RecordCount;