Due to Safari's automatic privacy settings, you might get an error message instead of the code to refer your friend.
To fix it, you'll need to turn off the 'Hide IP Address' option in your Safari privacy settings, then click the referral link again. Go to Settings, scroll down to Safari and press it. You will see an option to turn on and off Hide IP Address under Privacy & Security.