Automattic / Gravatar-SDK-iOS

Gravatar SDK is a Swift library that allows you to integrate Gravatar features into your own iOS applications.
https://gravatar.com
Mozilla Public License 2.0
41 stars 5 forks source link

Decouple avatarID from Profile model #304

Closed pinarol closed 4 months ago

pinarol commented 4 months ago

Closes https://github.com/Automattic/Gravatar-SDK-iOS/issues/303

Description

Adding a new avatarIdentifier var into ProfileViewConfiguration to let the other parties determine the avatar id independent from the profile response. Profile.avatarUrl always gives the primary email's avatar even if you make the query with a secondary email.

Testing Steps

Prerequisites: Have a secondary email in your Gravatar account and assign a different avatar for that email.

Test 1 - Test old versions of demo apps

This is to test backward compatibility.

Checkout the commit 9262beaa8b9f3bf4f2bfa553215f6253a1dc8996 from this PR and check these demo app screens:

Fetch the profile for the secondary email.

Expected: The primary email's avatar loads and you don't notice a bug.

Test 2 - Test new versions of demo apps

Check the latest commit in this PR.

Check the same screens again with the secondary email.

Expected: The secondary email's avatar loads.