Jump to content

ToddFrankson

Members
  • Content Count

    80
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by ToddFrankson

  1. ToddFrankson

    Looking for a certain component

    Explain how else you display a sum to the user, without displaying the data in a control This will be good to learn.
  2. ToddFrankson

    TRestRequest and IOS...

    Are there any Issues with TRestRequest and IOS? The following Code runs on Android, Windows 32bit & 64bit, and MacOS fine, but on IOS I get nothing in the TRestResponse contents: procedure TForm1.Button1Click(Sender: TObject); begin Memo1.lines.clear; TTask.run(Procedure Begin RestRequest1.execute; End).Start; end; And the RestRequest Handler- procedure TForm1.RESTRequest1AfterExecute(Sender: TCustomRESTRequest); begin Try Begin Accesstoken:=restresponse1.JSONValue.GetValue<string>('access_token'); Memo1.lines.add(Accesstoken); TDialogservice.showmessage('Access Token: ' + AccessToken); End; Except on E:Exception do TDialogservice.showmessage(E.message); End; end; Everytime I hit Accesstoken:=restresponse1.JSONValue.GetValue<string>('access_token'); the restresponse content is ''. But only on IOS. Anyone have ideas where to look? Maybe a property I need to set? I can post the form code if needed.
  3. ToddFrankson

    TRestRequest and IOS...

    And just like that, Response code of 0 with ZERO code changes. Even the Postman App on IOS fails following the instructions from the website. There's something fishy with REST and IOS
  4. ToddFrankson

    TRestRequest and IOS...

    Got it. It seems IOS had to have a slightly different URL............ The API provider needs better documentation. All is good in the universe again. Thanks for helping me brainstorm
  5. ToddFrankson

    TRestRequest and IOS...

    1-It should be, bu tit is not. Content=''.- Works on all platforms but IOS-I used the REST Debugger to generate the objects. 2-On all other platforms it is, but not on IOS 3- the response code is 0- i have been digging into the HTTPClient in the rest Request. It seems on IOS it's doing a handoff to the OS with a callback. Line 517-522 of System.Net.HTTPClient.mac is where it fails on IOS Emulator (So I can step through the code) LResponse.FDone := False; FDataTasks.AddTask(LRequest.FDataTask, LResponse); try LRequest.FDataTask.resume; while not LResponse.FDone do InternalWaitMessage(0.01); --> This procedure Located at 330-338: procedure InternalWaitMessage(AInterval: Single); var TimeoutDate: NSDate; begin TimeoutDate := TNSDate.Wrap(TNSDate.OCClass.dateWithTimeIntervalSinceNow(AInterval)); TNSRunLoop.Wrap(TNSRunLoop.OCClass.currentRunLoop).runMode(NSDefaultRunLoopMode, TimeoutDate); if TThread.CurrentThread.ThreadID <> MainThreadID then Sleep(Trunc(AInterval * 1000)); end; Lines 1309-on in System.Net.HTTPCLient is where the LResponse.Cancelled is set to true: if LRequest.FCancelled then----->Cancelled is false; Exit; LExecResult := DoExecuteRequest(LRequest, LResponse, AContentStream); if LRequest.FCancelled then--------------Cancelled is true Exit; case LExecResult of TExecutionResult.Success: ------>Status is success, but the exit above spits us out begin if not SameText(LRequest.FMethodString, sHTTPMethodHead) and (LResponse.FStream <> nil) then LResponse.DoReadData(LResponse.FStream); if LRequest.FCancelled then Exit; Status := LResponse.GetStatusCode;------------Status code is 200 but Cancelled set to true means we've exited case Status of 200: begin Break; end; 401: ...... And today I get an SSL error at line 529 of System.Net.HTTPClient.mac: else if LResponse.FError <> nil then-------------------------> raise ENetHTTPClientException.CreateResFmt(@SNetHttpClientErrorAccessing, [LResponse.FError.code, LRequest.FURL.ToString, NSStrToStr(LResponse.FError.localizedDescription)]) End;
  6. ToddFrankson

    How to generate aab file

    https://docwiki.embarcadero.com/RADStudio/Athens/en/Submitting_Your_Android_App_to_Google_Play#Android_App_Bundle_Support
  7. ToddFrankson

    TRestRequest and IOS...

    Same issue. That was where this started. procedure TForm1.Button1Click(Sender: TObject); begin RESTRequest1.AcceptEncoding := 'gzip, deflate, br'; Memo1.lines.clear; RestRequest1.ExecuteAsync(MyHandler,true,true,nil); end; procedure TForm1.myHandler; begin Try Accesstoken:=restresponse1.JSONValue.GetValue<string>('access_token'); Memo1.lines.add(Accesstoken); showmessage('Access Token: ' + AccessToken); Except on E:Exception do showmessage(E.message); End; When I tap button1 to fire RestRequest1.ExecuteAsync(MyHandler,true,true,nil); almost immediately I go right to Accesstoken:=restresponse1.JSONValue.GetValue<string>('access_token'); Then it hits the Exception, where Accesstoken is '', and never shows the error message.
  8. ToddFrankson

    TRestRequest and IOS...

    I tried that too, It works on all platforms except IOS. Thats what lead me to try this. It's like the RESTRequest1AfterExecute comes back before the request is completed
  9. ToddFrankson

    Android and services...

    Not necessarily solved. Just trying to understand the process.......... I've read that foreground services have some specific permissions that need to be requested, along with specific reasons why. I think I have a grasp on that now... As for the notifications, I can get that working by modifying your Kastri Demo Actually.....I used the JNotification_Builder and JNotificationManager to create the first Notification. For updates, I used the JNotificationCompat_Builder Still having issues getting the App Icon Using the following: var MainAppContext: JContext; AppIcon: Integer; Begin // Get the main application context by package name MainAppContext := TAndroidHelper.Context.getApplicationContext; // Fetch the application icon from the main application context AppIcon := MainAppContext.getPackageManager.getApplicationInfo( MainAppContext.getPackageName, 0).icon; ...... //other code related to building either the Notification_Builder or JNotificationCompat_Builder. .... End; The Icon is always a white box.
  10. So out of the box, the demo doesn't work for me. The first problem was the Read and Write External Storage permissions are deprecated. So, I changed the permissions to use the media files..... changed the line in the service from : LFileName := TPath.Combine(TPath.GetSharedDownloadsPath, LFileName); to LFileName := TPath.Combine(TPath.GetDocumentsPath, LFileName); in hopes it would work. Still nothing. This is my first pass at services, so I don't know diddly...... 1-Can I debug a service? I have tried but can't seem to make it happen. 2- Does the service and the App reside in the same "directory" on android, and have access to the same folders? I'm at a point where the app runs fine, but no notification comes from the server indicating the file downloaded, and the app never loads it....... Any one have 2 cents??
  11. Disregard.....Needed the Post notification permission
  12. ToddFrankson

    What new features would you like to see in Delphi 13?

    Dave, it would be best to have a private conversation regarding why. I actually have been thinking of reaching out to you.... I'll PM you.
  13. ToddFrankson

    What new features would you like to see in Delphi 13?

    While that is awesome, it should have been provided, and in the future, should be provided by the producer of the software. No one there ever thought, "I bet people will love installing 200+ addons one at a time, instead of a select a group and install...."
  14. ToddFrankson

    What new features would you like to see in Delphi 13?

    Android Auto built in Apple CarPlay Built In IOS Debugging (not on emulator) Ability to select multiple Getit Packages and install at once instead of having to select and install each one
  15. For some reason, the Android Service Demos don't work for me. I follow the instructions, and deploy fine, but the service never starts. Is there a "fix" or something I need to do? Embarcadero® Delphi 12 Version 29.0.51961.7529 12.1 patch
  16. ToddFrankson

    Mobile Zoom & Pan

    I have been looking into Zoom and Pan on mobile.... Almost every example I find involves zooming and panning an Image... Anyone have an example using a TVertScrollBox and the components on it?
  17. ToddFrankson

    Weird new IOS Issue-

    So, I have been working on a multi platform project, that has worked fine on Windows Android and IOS. IOS just updated to 17.5.1 The code works fine Prior to the update, but not after. I use TNetHttpClient to do a get of a web page. Prior to the Get, a Head returns just fine, to ensure internet access. I made a simple sample of the code. tap a button to initiate the Get and load the same page in a Twebbrowser. Can anyone text the attached code and tell me why the Get doesn't "get"? And why it works fine Prior to 17.5.1, and on all other platforms?? When the button is clicked, the Webbrowser browses the page, and the memo never gets filled. AndroidManifest.template.xml Entitlement.TemplateiOS.xml info.plist.TemplateiOS.xml Project1.deployproj Project1.dpr Project1.dproj Project1.dproj.local Project1.dsk Project1.identcache Project1.res Unit1.fmx Unit1.pas
  18. ToddFrankson

    Weird new IOS Issue-

    Yes, several files. Everytime I get a cannot write..... user doesn't have sufficient rights error, only displaying when I specifically show the error in a message. When I remove the try except, the file doesn't exist to open. I just spent the day on the main project, using message dialogs to find this out. I am now using temppath.
  19. ToddFrankson

    Weird new IOS Issue-

    Ios 17.5.1? 17.5 sdk?
  20. ToddFrankson

    Weird new IOS Issue-

    The failure Occurs in the code i posted with the Stringlist.SavetoFile. No ERROR PRESENTED. I had to wrap almost everything with message Dialogs to find the failure. I tried Assign /reset just on a whim . I have attached a new unit.pas. On line 92 & 93 put a URL you know you can get too. Unit1.pas
  21. ToddFrankson

    Weird new IOS Issue-

    So, I have figured out my problem. Please alter the code with a web page you can hit. It seems that IOS No longer likes Getdocumentspath....A Stringlist failed to write to it, using Assign and reset failed to open or read the file.... All in development mode. Can anyone check this?
  22. ToddFrankson

    Weird new IOS Issue-

    Can Anyone else get to this website https://gis.cravencountync.gov/images/activebookings.html ?
  23. ToddFrankson

    Weird new IOS Issue-

    Interesting. It's a local county government page.
  24. ToddFrankson

    Weird new IOS Issue-

    I never had to set anything before. Especially in the sandbox.
  25. ToddFrankson

    Payment - Monetization - Good international PSP

    Do you have sample code of the paypal processing? I want to use paypal for a project and need guidance. Not to well versed in JSon
×