Swiftyinsta: 둜그인이 μž‘λ™μ„ λ©ˆμ·„μŠ΅λ‹ˆλ‹€

에 λ§Œλ“  2020λ…„ 07μ›” 23일  Β·  12μ½”λ©˜νŠΈ  Β·  좜처: TheM4hd1/SwiftyInsta

μΊμ‹œ λ˜λŠ” LoginWebViewControllerλ₯Ό ν†΅ν•œ 인증이 λ‹€μŒ 였λ₯˜μ™€ ν•¨κ»˜ μ‹€νŒ¨ν•©λ‹ˆλ‹€.
" https://i.instagram.com/api/v1/accounts/current_user/.\n 잘λͺ»λœ 응닡.\n처리 ν•Έλ“€λŸ¬κ°€ nil λ°˜ν™˜ν–ˆμŠ΅λ‹ˆλ‹€.\n405"

κ°€μž₯ μœ μš©ν•œ λŒ“κΈ€

@alperalb κ°μ‚¬ν•©λ‹ˆλ‹€. 2.3.3 의 μ½”λ“œλ₯Ό μ—…λ°μ΄νŠΈν–ˆμŠ΅λ‹ˆλ‹€.\
κ·ΈλŸ¬λ‚˜ SwiftyInsta λŠ” 더 이상 적극적으둜 μœ μ§€ κ΄€λ¦¬λ˜μ§€ μ•ŠμœΌλ―€λ‘œ 이것은 μ‰¬μš΄ μˆ˜μ •μ΄μ—ˆμ§€λ§Œ ν–₯ν›„ μž‘λ™μ΄ 쀑지될 수 μžˆμŠ΅λ‹ˆλ‹€.

λͺ¨λ“  12 λŒ“κΈ€

κ²Œμ‹œλ¬Όμ—μ„œ UsersHandler CurrentUser λ©”μ„œλ“œλ₯Ό λ³€κ²½ν•˜μ—¬ κ°€μ Έμ˜΅λ‹ˆλ‹€.

func current(delay: ClosedRange<Double>?, completionHandler: <strong i="6">@escaping</strong> (Result<User, Error>) -> Void) { guard let storage = handler.response?.storage else { return completionHandler(.failure(GenericError.custom("Invalid 인증.응닡 in APIHandler.respon`. λ‹€μ‹œ λ‘œκ·ΈμΈν•˜μ‹­μ‹œμ˜€.")))
}
// let body = ["_uuid": handler.settings.device.deviceGuid.uuidString,
// "_uid": storage.dsUserId,
// "_csrftoken": storage.csrfToken]

    requests.request(User.self,
                     method: .get,
                     endpoint: Endpoint.Accounts.current,
                     //body: .parameters(body),
                     delay: delay,
                     process: { User(rawResponse: $0.user) },
                     completion: completionHandler)
}`

κ²Œμ‹œλ¬Όμ—μ„œ UsersHandler CurrentUser λ©”μ„œλ“œλ₯Ό λ³€κ²½ν•˜μ—¬ κ°€μ Έμ˜΅λ‹ˆλ‹€.

func current(delay: ClosedRange<Double>?, completionHandler: <strong i="7">@escaping</strong> (Result<User, Error>) -> Void) { guard let storage = handler.response?.storage else { return completionHandler(.failure(GenericError.custom("Invalid 인증.응닡 in APIHandler.respon`. λ‹€μ‹œ λ‘œκ·ΈμΈν•˜μ‹­μ‹œμ˜€.")))
}
// let body = ["_uuid": handler.settings.device.deviceGuid.uuidString,
// "_uid": storage.dsUserId,
// "_csrftoken": storage.csrfToken]

    requests.request(User.self,
                     method: .get,
                     endpoint: Endpoint.Accounts.current,
                     //body: .parameters(body),
                     delay: delay,
                     process: { User(rawResponse: $0.user) },
                     completion: completionHandler)
}`

κ·€ν•˜μ˜ μ†”λ£¨μ…˜μ„ 기반으둜 μ‹œλ„ν–ˆμ§€λ§Œ μž‘λ™ν•˜μ§€ μ•ŠλŠ” 것 κ°™μŠ΅λ‹ˆλ‹€.

κ²Œμ‹œλ¬Όμ—μ„œ UsersHandler CurrentUser λ©”μ„œλ“œλ₯Ό λ³€κ²½ν•˜μ—¬ κ°€μ Έμ˜΅λ‹ˆλ‹€.
func current(delay: ClosedRange<Double>?, completionHandler: <strong i="8">@escaping</strong> (Result<User, Error>) -> Void) { guard let storage = handler.response?.storage else { return completionHandler(.failure(GenericError.custom("Invalid 인증.응닡 in APIHandler.respon`. λ‹€μ‹œ λ‘œκ·ΈμΈν•˜μ‹­μ‹œμ˜€.")))
}
// let body = ["_uuid": handler.settings.device.deviceGuid.uuidString,
// "_uid": storage.dsUserId,
// "_csrftoken": storage.csrfToken]

    requests.request(User.self,
                     method: .get,
                     endpoint: Endpoint.Accounts.current,
                     //body: .parameters(body),
                     delay: delay,
                     process: { User(rawResponse: $0.user) },
                     completion: completionHandler)
}`

κ·€ν•˜μ˜ μ†”λ£¨μ…˜μ„ 기반으둜 μ‹œλ„ν–ˆμ§€λ§Œ μž‘λ™ν•˜μ§€ μ•ŠλŠ” 것 κ°™μŠ΅λ‹ˆλ‹€.

이것은 λ‚˜λ₯Ό μœ„ν•΄ μΌν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€ ..
ν¬λ“œλ₯Ό μ‚¬μš©ν•˜λŠ” 경우 ν”„λ‘œμ νŠΈλ₯Ό λ‹€μ‹œ λΉŒλ“œν•˜μ—¬ λ¨Όμ € λͺ¨λ“  것을 정리(command-shift-K)ν•˜κ±°λ‚˜ νŒŒμƒ 데이터λ₯Ό 정리해야 ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
λ³€κ²½λœ 라인은 13번째 쀄뢀터 UserHandler.swift νŒŒμΌμ— μžˆμŠ΅λ‹ˆλ‹€.

κ²Œμ‹œλ¬Όμ—μ„œ UsersHandler CurrentUser λ©”μ„œλ“œλ₯Ό λ³€κ²½ν•˜μ—¬ κ°€μ Έμ˜΅λ‹ˆλ‹€.

func current(delay: ClosedRange<Double>?, completionHandler: <strong i="7">@escaping</strong> (Result<User, Error>) -> Void) { guard let storage = handler.response?.storage else { return completionHandler(.failure(GenericError.custom("Invalid 인증.응닡 in APIHandler.respon`. λ‹€μ‹œ λ‘œκ·ΈμΈν•˜μ‹­μ‹œμ˜€.")))
}
// let body = ["_uuid": handler.settings.device.deviceGuid.uuidString,
// "_uid": storage.dsUserId,
// "_csrftoken": storage.csrfToken]

    requests.request(User.self,
                     method: .get,
                     endpoint: Endpoint.Accounts.current,
                     //body: .parameters(body),
                     delay: delay,
                     process: { User(rawResponse: $0.user) },
                     completion: completionHandler)
}`

@alperalb κ°μ‚¬ν•©λ‹ˆλ‹€, μ €λ₯Ό μœ„ν•΄ μΌν•˜μ„Έμš”.

κ²Œμ‹œλ¬Όμ—μ„œ UsersHandler CurrentUser λ©”μ„œλ“œλ₯Ό λ³€κ²½ν•˜μ—¬ κ°€μ Έμ˜΅λ‹ˆλ‹€.
func current(delay: ClosedRange<Double>?, completionHandler: <strong i="9">@escaping</strong> (Result<User, Error>) -> Void) { guard let storage = handler.response?.storage else { return completionHandler(.failure(GenericError.custom("Invalid 인증.응닡 in APIHandler.respon`. λ‹€μ‹œ λ‘œκ·ΈμΈν•˜μ‹­μ‹œμ˜€.")))
}
// let body = ["_uuid": handler.settings.device.deviceGuid.uuidString,
// "_uid": storage.dsUserId,
// "_csrftoken": storage.csrfToken]

    requests.request(User.self,
                     method: .get,
                     endpoint: Endpoint.Accounts.current,
                     //body: .parameters(body),
                     delay: delay,
                     process: { User(rawResponse: $0.user) },
                     completion: completionHandler)
}`

κ·€ν•˜μ˜ μ†”λ£¨μ…˜μ„ 기반으둜 μ‹œλ„ν–ˆμ§€λ§Œ μž‘λ™ν•˜μ§€ μ•ŠλŠ” 것 κ°™μŠ΅λ‹ˆλ‹€.

이것은 λ‚˜λ₯Ό μœ„ν•΄ μΌν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€ ..
ν¬λ“œλ₯Ό μ‚¬μš©ν•˜λŠ” 경우 ν”„λ‘œμ νŠΈλ₯Ό λ‹€μ‹œ λΉŒλ“œν•˜μ—¬ λ¨Όμ € λͺ¨λ“  것을 정리(command-shift-K)ν•˜κ±°λ‚˜ νŒŒμƒ 데이터λ₯Ό 정리해야 ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
λ³€κ²½λœ 라인은 13번째 쀄뢀터 UserHandler.swift νŒŒμΌμ— μžˆμŠ΅λ‹ˆλ‹€.

덕뢄에 νŒŒμƒ 데이터λ₯Ό μ§€μš°κ³  μ •μƒμ μœΌλ‘œ μž‘λ™ν•©λ‹ˆλ‹€.

@alperalb κ°μ‚¬ν•©λ‹ˆλ‹€. 2.3.3 의 μ½”λ“œλ₯Ό μ—…λ°μ΄νŠΈν–ˆμŠ΅λ‹ˆλ‹€.\
κ·ΈλŸ¬λ‚˜ SwiftyInsta λŠ” 더 이상 적극적으둜 μœ μ§€ κ΄€λ¦¬λ˜μ§€ μ•ŠμœΌλ―€λ‘œ 이것은 μ‰¬μš΄ μˆ˜μ •μ΄μ—ˆμ§€λ§Œ ν–₯ν›„ μž‘λ™μ΄ 쀑지될 수 μžˆμŠ΅λ‹ˆλ‹€.

λΉ λ₯Έ μ—…λ°μ΄νŠΈ κ°μ‚¬ν•©λ‹ˆλ‹€. κ·Έλž˜λ„ 적극적으둜 μœ μ§€ κ΄€λ¦¬λ˜μ§€ μ•ŠλŠ” 것은 맀우 μŠ¬ν”ˆ μΌμž…λ‹ˆλ‹€. imho ν˜„μž¬λ‘œμ„œλŠ” κ°€μž₯ λΉ λ₯Έ Instagram ν”„λ ˆμž„ μ›Œν¬μ΄λ©° 죽게 λ‘λŠ” 것은 λ‚­λΉ„μž…λ‹ˆλ‹€.

@sbertix λŠ” μœ μ§€ 관리λ₯Ό λ„μ™€λ“œλ¦½λ‹ˆλ‹€. 곡지가 μ–΄λ””μžˆλ‚˜μš”?

pod 'SwiftyInsta', :git => 'https://github.com/TheM4hd1/SwiftyInsta', :branch => 'master' λ₯Ό μ‚¬μš©ν•΄μ•Ό

@sbertix λ¦΄λ¦¬μŠ€μ— νƒœκ·Έκ°€ μ§€μ •λ˜μ—ˆμŠ΅λ‹ˆκΉŒ?

λΉ λ₯Έ μ—…λ°μ΄νŠΈ κ°μ‚¬ν•©λ‹ˆλ‹€. κ·Έλž˜λ„ 적극적으둜 μœ μ§€ κ΄€λ¦¬λ˜μ§€ μ•ŠλŠ” 것은 맀우 μŠ¬ν”ˆ μΌμž…λ‹ˆλ‹€. imho ν˜„μž¬λ‘œμ„œλŠ” κ°€μž₯ λΉ λ₯Έ Instagram ν”„λ ˆμž„ μ›Œν¬μ΄λ©° 죽게 λ‘λŠ” 것은 λ‚­λΉ„μž…λ‹ˆλ‹€.

ν˜„μž¬ κ΅¬ν˜„μ— "문제"κ°€ λ„ˆλ¬΄ λ§Žμ•„ μ•žμœΌλ‘œ @biox86을 μ™„μ „νžˆ 정리해야 ν•©λ‹ˆλ‹€.

λ‚΄κ°€ SwiftyInsta 2.0 μž‘μ„±ν•  λ•Œ, 기본적으둜 ν¬νŒ…μ΄μ—ˆλ˜ μ›λž˜ κ΅¬ν˜„μ— λŒ€ν•΄ μ—¬μ „νžˆ "μ§„μ •ν•œ" λ°©μ‹μœΌλ‘œ μž‘μ„±ν–ˆμŠ΅λ‹ˆλ‹€.

κ·Έ μ΄ν›„λ‘œ SwiftλŠ” 많이 λ°”λ€Œμ—ˆκ³  μš”μ²­ μ·¨μ†Œ, 인증 응닡을 μœ„ν•œ 닀쀑 μ €μž₯μ†Œ 지원, μž‘λ™ 쀑인 μ‚¬μš©μž 이름 및 λΉ„λ°€λ²ˆν˜Έ 인증, κ²°ν•© 지원, μ‚¬μš©μž μ •μ˜ 인증 λ“± λ§Žμ€ κΈ°λŠ₯을 μ½”λ“œλ² μ΄μŠ€μ— λ‹¨μˆœνžˆ μΆ”κ°€ν•  수 μ—†μŠ΅λ‹ˆλ‹€.

κ·Έλž˜μ„œ μ €λŠ” μ‚¬μš©ν•˜κΈ° 쉽고 μœ„μ˜ λͺ¨λ“  문제λ₯Ό ν•΄κ²°ν•  수 μžˆλŠ” μ΅œμ‹  Swift, Swiftagram을 μ‚¬μš©ν•˜μ—¬ μƒˆ ν”„λ‘œμ νŠΈλ₯Ό μ‹œμž‘ν–ˆμŠ΅λ‹ˆλ‹€. μ²˜μŒλΆ€ν„° μ‹œμž‘ν•˜λŠ” 것은 정말 ν•„μš”ν–ˆμŠ΅λ‹ˆλ‹€.

@sbertix λŠ” μœ μ§€ 관리λ₯Ό λ„μ™€λ“œλ¦½λ‹ˆλ‹€. 곡지가 μ–΄λ””μžˆλ‚˜μš”?

곡식 λ°œν‘œκ°€ μ—†μŠ΅λ‹ˆλ‹€. λ‚˜λŠ” μƒˆλ‘œμš΄ λ¬Έμ œκ°€ λ³΄λ‚΄μ§ˆ λ•Œλ§ˆλ‹€ μ‚¬λžŒλ“€μ—κ²Œ μƒκΈ°μ‹œμΌœ μ£Όκ³€ ν•©λ‹ˆλ‹€.

μ €λŠ” Swiftagram μ—μ„œ μž‘μ—…ν•˜λ©΄μ„œ μ—¬μ „νžˆ μ€‘μš”ν•œ 문제(예: 이와 같은)λ₯Ό μˆ˜μ •ν•  μ˜ˆμ •μ΄μ§€λ§Œ 여기에 μƒˆλ‘œμš΄ κΈ°λŠ₯μ΄λ‚˜ κ°œμ„  사항을 ν‘Έμ‹œν•˜μ§€ μ•Šμ„ κ²ƒμž…λ‹ˆλ‹€(예λ₯Ό λ“€μ–΄ Swiftagram BasicAuthenticator μ΄μ‹ν•˜μ§€ μ•Šμ„ κ²ƒμž…λ‹ˆλ‹€. κ²°ν•© κΈ°λŠ₯).

SwiftyInsta 에 νˆ¬μžν•˜κ³  PR을 톡해 κΈ°μ—¬ν•˜κ³  이λ₯Ό ν™œμ„±ν™”ν•˜κ³  μ‹Άλ‹€λ©΄ @mycroftcannerλ₯Ό ν™˜μ˜

pod 'SwiftyInsta', :git => 'https://github.com/TheM4hd1/SwiftyInsta', :branch => 'master' λ₯Ό μ‚¬μš©ν•΄μ•Ό

@sbertix λ¦΄λ¦¬μŠ€μ— νƒœκ·Έκ°€ μ§€μ •λ˜μ—ˆμŠ΅λ‹ˆκΉŒ?

λ„€. λͺ¨λ“  νƒœκ·Έ 및 ν¬λ“œ 버전 μ—…λ°μ΄νŠΈβ€¦ πŸ€”
μ™œ κ·Έλ ‡κ²Œ ν•˜λŠ”μ§€ 잘 λͺ¨λ₯΄κ² μŠ΅λ‹ˆλ‹€.

이 νŽ˜μ΄μ§€κ°€ 도움이 λ˜μ—ˆλ‚˜μš”?
0 / 5 - 0 λ“±κΈ‰