Jump to content

toufik

Members
  • Content Count

    75
  • Joined

  • Last visited

Everything posted by toufik

  1. 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
  2. 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;
  3. 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 ...
  4. 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
  5. 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 .....
  6. 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
  7. 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
  8. toufik

    Tlistview SQLite pagination

    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
  9. toufik

    Tlistview SQLite pagination

    @programmerdelphi2k i did try it and worked fine thats alot
  10. 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);
  11. toufik

    backup and restore database sqllite

    the error i'm having on android not windows ,windows every thing fine i just can use filecopy to do that ,,thanks for reply
  12. toufik

    backup and restore database sqllite

    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 .
  13. toufik

    tedit hint not working

    what i'm missing ? 2022-10-01 18-19-15.mp4
  14. toufik

    tedit hint not working

    the problem was fixed by changing the rc file name ''resource file'' thank you all for help
  15. 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;
  16. toufik

    TControlList delete an item

    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;
  17. toufik

    FMX and Excel application

    is there any free component or demos to how manipulate an excel file on android ..? i just want to import some values and export it again
  18. toufik

    FMX and Excel application

    thanks for reply but i'm looking for free solution right now thanks
  19. toufik

    tedit hint not working

    can you explain more how to do that please?
  20. toufik

    tedit hint not working

    the new project working fine ? 2022-10-01 21-53-22.mp4
  21. toufik

    tedit hint not working

    you were right its a ''focus'' problem now i feel very stupid thank you for all your help
  22. toufik

    tedit hint not working

    yes that s what i want if you watched the video, you can see that
  23. toufik

    tedit hint not working

    i don't want to show a balloon hint i want to show a hint inside an edit once the user selects it , it clear
  24. toufik

    FMX and Excel application

    thanks for reply i will try that and get back to you
  25. help need please .............I'm using Delphi 10.4 I'm having a very silly problem restoring i'm trying to store or save tlistbox index that select by the user (ItemIndex) and restore it later on create event the save work just fine i think the problem with restore . save : var Myinifile := TIniFile; SkinFile := string Myinifile := TIniFile.Create(ExtractFilePath (application.ExeName)+'my.ini'); Myinifile.WriteString('LastDiskSkin', SkinFile, lst1.ItemIndex.ToString); restore : if lst1.ItemIndex < 0 then EXIT; // Myinifile := TIniFile.Create('tabibi.ini'); try lst1.ItemIndex :=Myinifile.ReadString('LastDiskSkin',SkinFile,'').ToInteger; ShowMessage(SkinFile); finally Myinifile.Free; end;
×