In the case of cats, it can be the saliva that it spreads on the animal's hair as it grooms itself.
Third, instead of shaving your dog, - I do hope you are keeping him inside or at least in a very shaded area until he grows his coat back, - you can bathe or just rinse him down once a week to wash away any loose hair as well as all the dander.
Ask your veterinarian for a gentle shampoo. Again, be sure to rinse and dry him thoroughly.
Fourth, after mentioning cat's saliva, I am thinking that some canine breeds, and certain individuals of other breeds, also lick their paws and other parts of their bodies. The weekly rinsing may help, but this allergen might need the advice of the allergist who is able to prescribe medication or allergy shots if needed.
Fifth, if your boyfriend knows that the dog is the allergen, then you can exclude the animal from the room or rooms that your friend visits. Of course, this suggestion will not work if your apartment is the open style with just room dividers instead of doors.
However, even with this layout, you can try using infant gates to keep the dog confined to areas that your friend does not frequent.
Regular vacuuming with a vacuum that traps the dust and microscopic particles will help as will the use of electronic air filters.
Finally, be aware that airing and cleaning the house, confining the dog to certain areas, and trying to control the hair and dander shed by the animal will not immediately eliminate the allergens.
You are talking about microscopic particles, and it will take several weeks or even months of routine cleaning before these are eliminated sufficiently to make a difference.
I failed to ask you what kind of allergic response your friend is experiencing. If he is severely allergic, you may want to look for another home for your pet - if your relationship is becoming serious, that is.