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

Set Image URL #70

Closed
adisiji opened this issue Aug 10, 2021 · 5 comments
Closed

Set Image URL #70

adisiji opened this issue Aug 10, 2021 · 5 comments

Comments

@adisiji
Copy link

adisiji commented Aug 10, 2021

I'm trying to set the imageUrl of MesiboProfile

Code:

val mesiboProfile = Mesibo.getProfile(profileId)
mesiboProfile.imageUrl = "https://pathtoimage.jpg"
mesiboProfile.save()

But when I try to get the profile again, it return the imageUrl is null
How is this possible?

Android SDK Mesibo Version:

  • MESIBO_API = "1.5.5"
  • MESIBO_CALLS = "1.5.2"
  • MESIBO_UI = "1.5.2"

Thank You

@mesibo
Copy link
Owner

mesibo commented Aug 10, 2021

Read "Before you send us a Support Request" section here https://mesibo.com/support/

@mesibo mesibo closed this as completed Aug 10, 2021
@adisiji
Copy link
Author

adisiji commented Aug 10, 2021

Updated

@mesibo
Copy link
Owner

mesibo commented Aug 10, 2021

I tried the below code with latest API (1.6.4) and it worked as expected. Ensure that your database is set.

MesiboProfile g = Mesibo.getProfile(profileId);
g.setImageUrl("https://pathtoimage.jpg");
g.save();
String imageUrl = g.getImageUrl();

Also, it is generally recommended to use a self profile to set any properties and not to modify the profile returned by the getProfile. Read profile documentation.

@mesibo mesibo reopened this Aug 10, 2021
@adisiji
Copy link
Author

adisiji commented Aug 10, 2021

Ok. I've updated the SDK to latest API (1.6.4)

If I set the imageUrl and then get imageUrl, it is not null. But when I get the imageUrl from the other device, the imageUrl is null.
I also have setup the database as below:

        val mesiboToken = tokenRepository.loadMesiboToken()
        val setAccessToken = Mesibo.setAccessToken(mesiboToken)
        Timber.d("SetAccessToken Mesibo : $setAccessToken")

        val setDatabase = Mesibo.setDatabase("mesibo.db", 0)
        Timber.d("SetDB Mesibo : $setDatabase")

        // Now start mesibo
        val startMesibo = Mesibo.start()
        Timber.d("Start Mesibo : $startMesibo")

@mesibo
Copy link
Owner

mesibo commented Aug 10, 2021

Did you read my comment? YOU MUST publish your self profile so that others can read it from another device. You can't modify others' profiles and expect them to be available from other devices. If that is allowed, that would be a major security issue.

Read documentation. https://mesibo.com/documentation/api/real-time-api/profiles/

closing ticket.

@mesibo mesibo closed this as completed Aug 10, 2021
Repository owner locked and limited conversation to collaborators Aug 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants