Jump to content

Dave Nottage

Members
  • Content Count

    1276
  • Joined

  • Last visited

  • Days Won

    28

Everything posted by Dave Nottage

  1. Dave Nottage

    Receive PUSH notifications in the background in the iOS app

    It works when the app is not running, or not active too. As mentioned before the payload being sent must be correct for it to work, as well as having the correct UIBackgroundModes
  2. Dave Nottage

    Macbook processor relevant?

    It matters only if you're targeting simulator, where Delphi requires the Mac to have an M1, M2 or M3
  3. My Google-fu seems to be off at the moment. I have a DLL project that was originally for Visual Studio that I'm attempting to port to C++Builder. I'm struggling to find any tips on making this migration, other than apparently some time ago C++Builder had a method of importing Visual C++ projects. Does any method exist for importing such a project, or perhaps a site that gives tips about it? I've created a C-based DLL project in C++Builder and am attempting to include the original VS (C-based) code, however I'm receiving a bunch of compiler errors, which are different each time I load the project and hit "Build". The motivation for moving it from VS is to have the ability to include Delphi code in the project. Additional issue: I have a .lib file that is used in the VS project, but no corresponding .dll, so that I can use implib to import a .lib that C++Builder will link to. Is there a way I can create a .dll in VS so that everything in the .lib is imported?
  4. Dave Nottage

    Receive PUSH notifications in the background in the iOS app

    Good to hear Well, it's a solution, apparently? I assume whatever implementation you are using sends a local notification, which to my mind is unnecessary. I use Delphi's built-in FCM support, however even if the messages are not going via FCM, it should be a simple matter of subscribing to TPushRemoteNotificationMessage, e.g.: TMessageManager.DefaultManager.SubscribeToMessage(TPushRemoteNotificationMessage, PushRemoteNotificationMessageHandler); ..and in the handler: procedure TForm1.PushRemoteNotificationMessageHandler(const Sender: TObject; const M: TMessage); begin if M is TPushRemoteNotificationMessage then // Use this value (which is JSON): TPushRemoteNotificationMessage(M).Value.Notification end;
  5. Dave Nottage

    Receive PUSH notifications in the background in the iOS app

    Does it contain content-available, as I mentioned? Yes What do you mean by "activate the application"? The OS "wakes up" the application in the background, and the message receive handler (in your case, apparently OnReceiveNotificationEvent) gets called, when the message is received. Possibly because you do not have the content-available member in the payload of the message. As mentioned, in the message receive handler . As per the section "Receive Background Notifications" in the same link, you have up to 30 seconds of processing time. Ignore the parts about the app delegate and completion handler - they are handled for you in the FMX code. Incidentally, I've found that trying to make background notifications like this work is a complete nightmare, mainly because of this (from the same link): "The system treats background notifications as low priority: you can use them to refresh your app’s content, but the system doesn’t guarantee their delivery. In addition, the system may throttle the delivery of background notifications if the total number becomes excessive. The number of background notifications allowed by the system depends on current conditions, but don’t try to send more than two or three per hour." It makes testing such things extremely difficult. Whatever you're attempting to do, you might need to do it some other way.
  6. Dave Nottage

    Receive PUSH notifications in the background in the iOS app

    I was referring to what needs to be in the payload of the notification being sent (i.e. nothing to do with the code in the Delphi app). See the "Create a background notification" section at that link.
  7. Dave Nottage

    Receive PUSH notifications in the background in the iOS app

    If you want to be able to process the notification without user interaction (i.e. not open the application visibly), you need to follow the rules set out here: https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/pushing_background_updates_to_your_app?language=objc
  8. Dave Nottage

    Receive PUSH notifications in the background in the iOS app

    Do you have remote-notification selected in the UIBackgroundModes value, in the Version Info section of Project Options?
  9. Dave Nottage

    Unable to execute '"C:\Program Files\Java\jdk-17.0.1\bin\java.exe" 

    Did you check programmer2k's suggestion? Having other JDKs on the system where the path appears before that of the Adoptium JDK can cause trouble.
  10. Perhaps the file content is being passed as a property of the JSON payload?
  11. Dave Nottage

    Delphi 11 and onClose on macOS is still not called

    It works when the form is not shown modally Please see the edits in my first reply.
  12. Dave Nottage

    Delphi 11 and onClose on macOS is still not called

    Works for me in Delphi 11.3. EDIT: That's when the form is not opened modally - I do note that there are these issues outstanding related to modal forms: https://quality.embarcadero.com/browse/RSP-39547 https://quality.embarcadero.com/browse/RSP-40158 So you may need to be more specific about how you are showing the form(s)
  13. Dave Nottage

    Call for Delphi 12 Support in OpenSource projects.

    Isn't this statement a breach of the NDA? 😉 If I was participating (in theory, because I am not admitting either way), that's what I'd do, because I think the conditions are still fuzzy 🙂
  14. Dave Nottage

    Call for Delphi 12 Support in OpenSource projects.

    What about when a third party has both source code changes that make the code compatible (i.e. doesn't refer to new functionality), in addition to having code that does take advantage of new features (i.e. both kinds of changes in the same release)? It would seem to exclude them from doing anything at all, or at least hold off on the latter part, since it would be a breach? I wonder how many this would apply to? I know from the changes going from Delphi 10.4 to Delphi 11 that it would definitely apply to me.
  15. Dave Nottage

    %G equivalent in FormatFloat?

    %g can be used with the Format statement, e.g: Format('This is a float value: %g', [Value])
  16. Dave Nottage

    ios sdk version

    11.3 is backward compatible for devices that have at least iOS 14, possibly earlier
  17. Dave Nottage

    Testers needed for GExperts Instant Grep expert

    Not there for me. I'm assuming I'm doing something wrong 🙂 I'll take a look at the code later...
  18. Dave Nottage

    Testers needed for GExperts Instant Grep expert

    Something is amiss for me: I'm building from r4065 and I can see files referring to Instant Grep, but there appears to be no menu item - is it not under the GExperts item? On a side note: is there a plan to make GExperts respect the IDE theme?
  19. Dave Nottage

    How do I execute code after FormShow ?

    Using a background thread is extremely normal.
  20. Dave Nottage

    IOS shared document path access

    I have added a demo to the HowTo repo that demonstrates how to achieve this. Please read the readme for instructions. Note that there is no special folder - it's a case of configuration in order to share files from the documents folder.
  21. Dave Nottage

    How to detect when a Form is active in Designer

    Thanks.. your ticket is the explanation I was looking for.
  22. Dave Nottage

    How to detect when a Form is active in Designer

    Just so I understand: why do you need to do this?
  23. Dave Nottage

    How to detect when a Form is active in Designer

    Can you explain this in another way? It sounds very confusing.
  24. Dave Nottage

    Help me to fix compilation error for iOS

    I always install macOS support anyway, so had not noticed. I haven't seen the requirement anywhere (as yet), so someone might want to report the issue 😉
  25. Dave Nottage

    Rad 12 Beta - Link to News

    I was going to expand on it, but Uwe has done it! https://www.uweraabe.de/Blog/2023/10/04/tzipfile-improvements-in-delphi-12/
×