This is not so much a software development topic as it is an iOS / iCloud issue that does not seem to be well-documented, but was solved only after discussing with Apple Support.
The scenario here is where an iOS device (an iPhone 8 Plus, in this case) gets restored from backup. During the time between the backup was made and was later restored onto the iPhone, a number of photos had been taken and uploaded to iCloud. After the phone was restored, the pictures were missing from the iPhone, yet could still be seen in the Photos app on a MacBook.
When looking up this issue, I found time after time, there does not seem to be a documented definitive way to force sync iCloud with your iOS device.
Having had some similar experience with this sort of thing before, I thought that turning off iCloud Photo Sharing in Settings and turning it back on might force a sync.
Before I turned it off, only ten or so pictures were missing. Now several thousand pictures disappeared from the iPhone. Needless to say, I was not pleased at this point. I checked Photos on the Mac, and they were still there, so I breathed a sigh of relief.
I then turned off Upload to My Photo Stream in Settings.
This didn’t seem to change anything, so I turned it back on. I then turned iCloud Photo Sharing back on, which automatically then turned Upload to My Photo Stream back off. I turned it back on so that both settings were on, as they were after the iPhone was restored. I then rebooted the iPhone. Still no change.
At this point, I thought time might solve the problem. Perhaps the photos needed to be re-downloaded from iCloud. I let the iPhone sit overnight to see if there was some change in the morning. By the next morning, there was still no change.
Time to contact Apple Support. After talking to a support tech for just a few minutes, a suggestion was made: on the Mac, navigate to iCloud.com, log in, and open Photos on the website. After doing so, all of the pictures – including the ones that were originally missing – appeared on the iPhone!
Whether or not this always works remains to be tested, but it solved my problem in this instance. For such an easy and quick fix, it’s worth trying.