Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PhotoData #10

Open
Patresko opened this issue Feb 2, 2022 · 2 comments
Open

PhotoData #10

Patresko opened this issue Feb 2, 2022 · 2 comments

Comments

@Patresko
Copy link

Patresko commented Feb 2, 2022

ServicesManager.sharedInstance().myUser.contact?.photoData

Return always nil, even the profile image is set and visible at web-sandbox.openrainbow.com

@vyskocil
Copy link
Collaborator

vyskocil commented Feb 2, 2022

We just fixed the Swift sample app, may you have a look at this code as it is displaying contact photo and it is working for me.

@Patresko
Copy link
Author

Patresko commented Feb 2, 2022

Nope does not work at all.

First I think you have wrong parameter anyway in function down bellow. Parameters should be NSNotification instead of Notification

@objc func didGetInfo(notification : Notification) {
        if let contact = notification.object as? Contact {
            self.updateUI(contact)
        }
    }

Then if statements is wrong and self.updateUI will never will be executed . Because NSNotification is NSDictionary and correct declaration should be

guard let data:NSDictionary = notification.object as? NSDictionary else {return}
        
guard let contact:Contact = data.object(forKey: "contact") as? Contact else { return }

But property contact.photoData is still nil. Even I called

servicesManager?.contactsManagerService.fetchRemoteContactDetail(servicesManager?.myUser.contact)

which by documentation is not necessary for personal profile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants