-
Content Count
1276 -
Joined
-
Last visited
-
Days Won
28
Everything posted by Dave Nottage
-
Receive PUSH notifications in the background in the iOS app
Dave Nottage replied to Vanar's topic in FMX
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 -
It matters only if you're targeting simulator, where Delphi requires the Mac to have an M1, M2 or M3
-
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?
-
Receive PUSH notifications in the background in the iOS app
Dave Nottage replied to Vanar's topic in FMX
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; -
Receive PUSH notifications in the background in the iOS app
Dave Nottage replied to Vanar's topic in FMX
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. -
Receive PUSH notifications in the background in the iOS app
Dave Nottage replied to Vanar's topic in FMX
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. -
Receive PUSH notifications in the background in the iOS app
Dave Nottage replied to Vanar's topic in FMX
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 -
Receive PUSH notifications in the background in the iOS app
Dave Nottage replied to Vanar's topic in FMX
Do you have remote-notification selected in the UIBackgroundModes value, in the Version Info section of Project Options? -
Unable to execute '"C:\Program Files\Java\jdk-17.0.1\bin\java.exe"
Dave Nottage replied to William23668's topic in FMX
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. -
PDF File Send as Base64 from c# to Delphi REST
Dave Nottage replied to mazluta's topic in Network, Cloud and Web
Perhaps the file content is being passed as a property of the JSON payload? -
Delphi 11 and onClose on macOS is still not called
Dave Nottage replied to softtouch's topic in Cross-platform
It works when the form is not shown modally Please see the edits in my first reply. -
Delphi 11 and onClose on macOS is still not called
Dave Nottage replied to softtouch's topic in Cross-platform
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) -
Call for Delphi 12 Support in OpenSource projects.
Dave Nottage replied to Tommi Prami's topic in Delphi Third-Party
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 🙂 -
Call for Delphi 12 Support in OpenSource projects.
Dave Nottage replied to Tommi Prami's topic in Delphi Third-Party
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. -
%g can be used with the Format statement, e.g: Format('This is a float value: %g', [Value])
-
11.3 is backward compatible for devices that have at least iOS 14, possibly earlier
-
Testers needed for GExperts Instant Grep expert
Dave Nottage replied to dummzeuch's topic in GExperts
Not there for me. I'm assuming I'm doing something wrong 🙂 I'll take a look at the code later... -
Testers needed for GExperts Instant Grep expert
Dave Nottage replied to dummzeuch's topic in GExperts
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? -
Using a background thread is extremely normal.
-
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.
-
How to detect when a Form is active in Designer
Dave Nottage replied to luciano_f's topic in GExperts
Thanks.. your ticket is the explanation I was looking for. -
How to detect when a Form is active in Designer
Dave Nottage replied to luciano_f's topic in GExperts
Just so I understand: why do you need to do this? -
How to detect when a Form is active in Designer
Dave Nottage replied to luciano_f's topic in GExperts
Can you explain this in another way? It sounds very confusing. -
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 😉
-
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/