iOS delayed notification only fires if app closed (FMX)iOS notifications sporadic (FMX)ShowModal window opens NSOpenPanel will be auto closed in Delphi FMXHow to fire notification using TimeEditDelphi+iOS: How to include iOS Extension (.appex) to a FMX-App?Double click file to open in running instance of FMX appHow to load large bitmap in FMX (fire monkey)Delphi/FMX + iOS: UNUserNotificationCenter don't raises the delegate events (local notifications)fire event after mouse moves form - FMX C++Delphi FMX - read only checkbox in opendialog?iOS notifications sporadic (FMX)

Why force the nose of 737 Max down in the first place?

How did the Axis intend to hold the Caucasus?

Interrupt pin type on the 6502

Correlation length anisotropy in the 2D Ising model

Melee or Ranged attacks by Monsters, no distinction in modifiers?

Commercial jet accompanied by small plane near Seattle

When does Haskell complain about incorrect typing in functions?

Heisenberg uncertainty principle in daily life

Did the IBM PC use the 8088's NMI line?

How do I stop my characters falling in love?

What are the different qualities of the intervals?

Why do all my history books divide Chinese history after the Han dynasty?

If a 2019 UA artificer has the Repeating Shot infusion on two hand crossbows, can they use two-weapon fighting?

Pointwise convergence of uniformly continuous functions to zero, but not uniformly

How can I say in Russian "they cannot make the tournament attractive by itself"?

Aftermath of nuclear disaster at Three Mile Island

Vertical tennis ball into fancy new enumerate

Old French song lyrics with the word "baiser."

Am I allowed to use personal conversation as a source?

What is the use of で in this sentence?

Seaborn style plot of pandas dataframe

Word for showing a small part of something briefly to hint to its existence or beauty without fully uncovering it

How did Mysterio have these drones?

Would all these three things have the exact same effect on the flight duration of a glider?



iOS delayed notification only fires if app closed (FMX)


iOS notifications sporadic (FMX)ShowModal window opens NSOpenPanel will be auto closed in Delphi FMXHow to fire notification using TimeEditDelphi+iOS: How to include iOS Extension (.appex) to a FMX-App?Double click file to open in running instance of FMX appHow to load large bitmap in FMX (fire monkey)Delphi/FMX + iOS: UNUserNotificationCenter don't raises the delegate events (local notifications)fire event after mouse moves form - FMX C++Delphi FMX - read only checkbox in opendialog?iOS notifications sporadic (FMX)






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















Based on this Embarcadero example I have the following code in a TButton click in FMX app for iOS. Supposed to pop up a notification after 10 seconds.



void __fastcall TForm1::ScheduleNotificationButtonClick(TObject *Sender)

if (NotificationCenter1->Supported())
TNotification *myNotification = NotificationCenter1->CreateNotification();
__try
myNotification->Name = "MyNotification";
myNotification->AlertBody = "C++ for your mobile device is here!";
// Fire in 10 seconds
myNotification->FireDate = Now() + EncodeTime(0, 0, 10, 0);
// Send notification to the notification center
NotificationCenter1->ScheduleNotification(myNotification);

__finally
myNotification->DisposeOf();





When i click the button nothing happens. But, I accidentally figured out that i can make it fire by closing the app AFTER clicking the button. If i click the button and then close the app, sure enough, at 10 seconds the notification pops up. What could possibly be suppressing the notification from firing while the app is running?



p.s. This is related to my earlier post but this is unique enough i thought clearer to make separate post.










share|improve this question

















  • 2





    You should NOT be disposing of the object that you schedule. Embarcadero's example is wrong in that regard. Get rid of the try..finally altogether and let ARC manage the object lifetime for you.

    – Remy Lebeau
    Mar 26 at 20:46












  • @RemyLebeau - that solved it. Thanks!

    – relayman357
    Mar 29 at 1:22

















0















Based on this Embarcadero example I have the following code in a TButton click in FMX app for iOS. Supposed to pop up a notification after 10 seconds.



void __fastcall TForm1::ScheduleNotificationButtonClick(TObject *Sender)

if (NotificationCenter1->Supported())
TNotification *myNotification = NotificationCenter1->CreateNotification();
__try
myNotification->Name = "MyNotification";
myNotification->AlertBody = "C++ for your mobile device is here!";
// Fire in 10 seconds
myNotification->FireDate = Now() + EncodeTime(0, 0, 10, 0);
// Send notification to the notification center
NotificationCenter1->ScheduleNotification(myNotification);

__finally
myNotification->DisposeOf();





When i click the button nothing happens. But, I accidentally figured out that i can make it fire by closing the app AFTER clicking the button. If i click the button and then close the app, sure enough, at 10 seconds the notification pops up. What could possibly be suppressing the notification from firing while the app is running?



p.s. This is related to my earlier post but this is unique enough i thought clearer to make separate post.










share|improve this question

















  • 2





    You should NOT be disposing of the object that you schedule. Embarcadero's example is wrong in that regard. Get rid of the try..finally altogether and let ARC manage the object lifetime for you.

    – Remy Lebeau
    Mar 26 at 20:46












  • @RemyLebeau - that solved it. Thanks!

    – relayman357
    Mar 29 at 1:22













0












0








0


1






Based on this Embarcadero example I have the following code in a TButton click in FMX app for iOS. Supposed to pop up a notification after 10 seconds.



void __fastcall TForm1::ScheduleNotificationButtonClick(TObject *Sender)

if (NotificationCenter1->Supported())
TNotification *myNotification = NotificationCenter1->CreateNotification();
__try
myNotification->Name = "MyNotification";
myNotification->AlertBody = "C++ for your mobile device is here!";
// Fire in 10 seconds
myNotification->FireDate = Now() + EncodeTime(0, 0, 10, 0);
// Send notification to the notification center
NotificationCenter1->ScheduleNotification(myNotification);

__finally
myNotification->DisposeOf();





When i click the button nothing happens. But, I accidentally figured out that i can make it fire by closing the app AFTER clicking the button. If i click the button and then close the app, sure enough, at 10 seconds the notification pops up. What could possibly be suppressing the notification from firing while the app is running?



p.s. This is related to my earlier post but this is unique enough i thought clearer to make separate post.










share|improve this question














Based on this Embarcadero example I have the following code in a TButton click in FMX app for iOS. Supposed to pop up a notification after 10 seconds.



void __fastcall TForm1::ScheduleNotificationButtonClick(TObject *Sender)

if (NotificationCenter1->Supported())
TNotification *myNotification = NotificationCenter1->CreateNotification();
__try
myNotification->Name = "MyNotification";
myNotification->AlertBody = "C++ for your mobile device is here!";
// Fire in 10 seconds
myNotification->FireDate = Now() + EncodeTime(0, 0, 10, 0);
// Send notification to the notification center
NotificationCenter1->ScheduleNotification(myNotification);

__finally
myNotification->DisposeOf();





When i click the button nothing happens. But, I accidentally figured out that i can make it fire by closing the app AFTER clicking the button. If i click the button and then close the app, sure enough, at 10 seconds the notification pops up. What could possibly be suppressing the notification from firing while the app is running?



p.s. This is related to my earlier post but this is unique enough i thought clearer to make separate post.







firemonkey c++builder






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 26 at 18:48









relayman357relayman357

1621 silver badge11 bronze badges




1621 silver badge11 bronze badges







  • 2





    You should NOT be disposing of the object that you schedule. Embarcadero's example is wrong in that regard. Get rid of the try..finally altogether and let ARC manage the object lifetime for you.

    – Remy Lebeau
    Mar 26 at 20:46












  • @RemyLebeau - that solved it. Thanks!

    – relayman357
    Mar 29 at 1:22












  • 2





    You should NOT be disposing of the object that you schedule. Embarcadero's example is wrong in that regard. Get rid of the try..finally altogether and let ARC manage the object lifetime for you.

    – Remy Lebeau
    Mar 26 at 20:46












  • @RemyLebeau - that solved it. Thanks!

    – relayman357
    Mar 29 at 1:22







2




2





You should NOT be disposing of the object that you schedule. Embarcadero's example is wrong in that regard. Get rid of the try..finally altogether and let ARC manage the object lifetime for you.

– Remy Lebeau
Mar 26 at 20:46






You should NOT be disposing of the object that you schedule. Embarcadero's example is wrong in that regard. Get rid of the try..finally altogether and let ARC manage the object lifetime for you.

– Remy Lebeau
Mar 26 at 20:46














@RemyLebeau - that solved it. Thanks!

– relayman357
Mar 29 at 1:22





@RemyLebeau - that solved it. Thanks!

– relayman357
Mar 29 at 1:22












0






active

oldest

votes










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55364315%2fios-delayed-notification-only-fires-if-app-closed-fmx%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55364315%2fios-delayed-notification-only-fires-if-app-closed-fmx%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript