0

I am trying to run code when a user selects an action from an interactive push notification. This code needs to do multiple things: update a record on a server, charge a credit card, etc, and I implement these requests by using Parse Cloud Code and the Stripe API.

When these requests are called, it does not seem like the code is actually running, and there is no callback. I then open the app, and everything runs perfectly. Are blocks/callbacks not allowed to be run when the app is inactive? I have researched background fetch and background remote notifications, and I do not think either are applicable, but please tell me if you disagree.

Thanks for your help,

Josh Gafni
  • 2,831
  • 2
  • 19
  • 32
  • 1
    It sounds like the remote notification background mode may be applicable if the activity's being triggered by a push notification. – Lyndsey Scott Sep 29 '14 at 02:25
  • To be clear, when the user receives a regular push notification and selects an action, the code does in fact execute. But the execution of the cloud code requests do not result in any changes on the server side and no callbacks are received. However, when the user chooses to open the app, the callbacks occur instantly. Do you think that executing the code as a result of background push instead would make a difference -- the same code will execute, but the cloud code will actually run? – Josh Gafni Sep 29 '14 at 07:48
  • You were right. This is what I needed: http://stackoverflow.com/questions/11864553/ios-http-request-while-in-background – Josh Gafni Sep 30 '14 at 04:55

0 Answers0