Rich Notifications - local image doesn't show if first on home screen?

I implemented rich notifications on iOS 10, using built-in template with image as attachment, visible on banner and on long view. Everything was working fine.


Now on iOS 11, I find that the image doesn't show if the notification appears on the home screen, and the user goes into the long view.

However, if by chance the notification appears at least once on top of the app UI, the image shows just fine.

From that point on, the image will consistently show, even on the home screen.

Note that my code hasn't changed, except for updating to Swift 4.


Is this a known issue? Should I file a bug for this?

Thank you for any information...and maybe there is a workaround?


Martine

Replying to myself: I figured it out, of course it was not a bug with iOS 11!

It was a race condition with my code... 🙂

I fixed it by putting a global dispatch around the code that creates each notification, and therefore loads the attachment into the request.

It is now working perfectly again!

Apologies to Apple!

Rich Notifications - local image doesn't show if first on home screen?
 
 
Q