How can I change the profile picture with anywhere?


#1

I’m using anywhere for an app that must allow the users to change their profile picture. As far as I know, the anywhere T object does not include a default connection with POST account/update_profile_image, so I tried to sent a custom post request, but it says that the “Origin is not allowed by Access-Control-Allow-Origin”. I know it can be done with server-side authentication, but: Is there a way to do it with anywhere?

Thanks a lot.


#2

Hi @sadasant,

As you’ve discovered, @Anywhere doesn’t support image uploads/profile image uploads. This is currently only supported through server-to-server integrations.


#3

:frowning: ok, thanks.


#4

What about a plugin to the anywhere api? I’m reading the api.bundle.js and I think something like this should work:

(function () { var B = twttr.anywhere.api.util.chainableMethod; var C = twttr.anywhere.api.util.aliasMethod; var A = twttr.anywhere.api.util.callMethod; twttr.anywhere.api.util.model("twttr.anywhere.api.models.ProfileImage").belongsTo("User").statics({ send: B("ProfileImage", function (I) { A({ url: "update_profile_image", params: [{ image: I }], dataSource: ["profile_image"] }) }) }); }());

Any clues?


#5

Or, I know how to confirm the user on the server with the twitter_anywhere_identity, is there a way to obtain the oauth privileges with this so I could upload the profile image?

edit: I’ve read about oauth_bridge_code, does it still working?


#6

We don’t support using the underlying JSAPI that powers @Anywhere. I wouldn’t recommend this approach.


#7

The oauth_bridge_code approach was never officially supported and has been removed. Server-based OAuth is really the best way to accomplish these goals.


#8

Ok thank you :slight_smile:


#9

Suhani Sham Aur Chandni Raaten
Jharno Ka Paani,Barsaat Ka Mausam
Tere Bin Jalwagaar Na The
Tez Dhoop Aur Garam Hawayen
Aankh Ka Paani,Ghamon Ka Mausam
Ye Sach Hai ,Tere Sang Asardaar Na The.


#10

#11