TheM4hd1 / SwiftyInsta

Instagram Private API Swift

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Follow and Unfollow methods are not working.

ahmetkocu opened this issue · comments

Hi,

I am using your library and I am developing an iOS app.

I try to follow or unfollow users but not working this methods.

Can you check these methods?

Hello,
methods are fine and updated with latest instagram changes.
read here: #218

Hi,

I know all api changes, I developed an android app and published it. Everything is working good.

Also I know about api limits.

However when I can make follow or unfollow in my android app, with your latest version of library, I can not do that.

I simply add as a pod and call your methods like you describe.

I can not understand what is the problem.

it may be related to user-agent.
check the other library, and update this issue please.
https://github.com/sbertix/Swiftagram

I think your should sign follow and unfollow request with igSignatureValue.
and you should send ig_sig_key_version in request body.

I checked that library and they sign the body excatly I do in my android code. for follow and unfollow methods.

https://github.com/sbertix/Swiftagram/blob/d2016870a2184d72ce951523cc02406000b83e5d/Sources/SwiftagramCrypto/Extensions/Crypto.swift

You should check here.

there is no need to sign the requests with signature key in recent versions.

Yes, you are right, I checked it.

However I can not achieve follow action with your library.

It is indeed related to the user agent. It's a long known issue with SwiftyInsta.

Basically, authentication cookies and actual API requests are not mocked to be fetched by the same device, so some endpoints automatically fail, like these ones.
Adjusting the user agent for the web view authenticator in your code, so that it matches the device used for all other requests, and logging back in should to the trick @ahmetkocu.

(I'm reopening this as it is indeed an issue somebody might want to fix)

Hi,

In this library, it can be fixed I think.

I checked the user agent that is for API call, these are android device brands and models. However in loginwebview, using a different user agent, it is iphone device.

Sure it can be fixed 😊

If you wanna work on a fix you can just port Swiftagram's implementation here.
You have my blessings @ahmetkocu 💪

check the development branch, I added a temporary way, lmk if it fixed your problem.