LeonardoCardoso / SwiftLinkPreview

It makes a preview from an URL, grabbing all the information such as title, relevant texts and images.
https://leocardz.com/swift-link-preview-5a9860c7756f
MIT License
1.37k stars 196 forks source link

Update user-agent String to imitate iMessage's #140

Closed bdhazman closed 2 years ago

bdhazman commented 3 years ago

Changes

The user-agent string I used is the same (or extremely similar) to the one Apple sends to receive metadata for their link previews in iMessage. After changing to this user-agent string Tweets (which were previously not loading correctly) stopped warning about needing Javascript.

LeonardoCardoso commented 3 years ago

Thanks, @bdhazman. I will check it out ASAP.

ghost commented 3 years ago
1 Error
:no_entry_sign: Please include a CHANGELOG entry.
You can find it at CHANGELOG.md.

Generated by :no_entry_sign: Danger

lhunath commented 3 years ago

Might be useful to try and identify which parts of this new user agent string are actually beneficial and which parts are not contributing anything.

LeonardoCardoso commented 3 years ago

Indeed. Some websites that use Cloudfare block iMessage user agent used in a URLRequest.