playhaven/sdk-ios — comment on commit 0839d81328e02ec201d3bf7eacd716170c9f68f4
File: src/PHPublisherContentRequest.m line 54
By jfrndz:

The finish method in PHPublisherContentRequest cancels any outstanding (meaning actively connecting to the API) subcontent requests when the content request is dismissed/canceled.

If by backend you mean background, that's correct. Register the notification on send and unregister in dealloc. For now, only do this in content requests.

Other request types might need a different backgrounding behavior. For instance, we'd still like to finish Open requests even if the app is backgrounded. That's outside of the scope of this story. Let's focus on getting this working for content requests and we'll consider the other requests later.

> OK, was thinking about other requests (such as Open, Meta, etc.) but just now realizing the finish method only cancels those with the ContentRequest as delegate.
>
> So after registering in send, I should leave it registered and not unregister when loaded, correct? After all, if I'm understanding the task correctly, we want to dismiss everything when we enter the backend, even if the request has completed.
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/playhaven/sdk-ios/commit/0839d81328e02ec201d3bf7eacd716170c9f68f4#commitcomment-723407