[GH-ISSUE #570] Is an OAuthSwift object Codable #374

Closed
opened 2026-03-03 16:48:10 +03:00 by kerem · 2 comments
Owner

Originally created by @IAINATTWATER on GitHub (Jan 27, 2020).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/570

Description:

Question - I need to pass an OAuthswift object from the iOS App to the Watch Extension (using WatchConnectivity). Clearly such an object is not a Property List type so interested in passing as Data. Can the object be encoded/decoded? Doesn't look like it conforms. Or is there a convenience or helper function that can make a request after the tokens have been secured so that just the tokens can be passed to the watch. Thank you.

OAuth Provider? (Twitter, Github, ..):

Twitter

OAuth Version:

  • Version 1
  • Version 2

OS (Please fill the version) :

  • iOS :
  • OSX :
  • TVOS :
  • WatchOS :

Installation method:

  • Carthage
  • CocoaPods
  • Swift Package Manager
  • Manually

Library version:

  • head
  • v2.1.0
  • v2.0.0
  • v1.4.1
  • v1.2 (Swift 4.0)
  • other: (Please fill in the version you are using.)

Xcode version:

  • 11.x (Swift 5.1)

  • 10.x (Swift 5.0)

  • 10.x (Swift 4.1)

  • 9.3 (Swift 4.1)

  • 9.0 (Swift 4.0)

  • other: (Please fill in the version you are using.)

  • objective c

Originally created by @IAINATTWATER on GitHub (Jan 27, 2020). Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/570 ### Description: Question - I need to pass an OAuthswift object from the iOS App to the Watch Extension (using WatchConnectivity). Clearly such an object is not a Property List type so interested in passing as Data. Can the object be encoded/decoded? Doesn't look like it conforms. Or is there a convenience or helper function that can make a request after the tokens have been secured so that just the tokens can be passed to the watch. Thank you. ### OAuth Provider? (Twitter, Github, ..): Twitter ### OAuth Version: - [x] Version 1 - [ ] Version 2 ### OS (Please fill the version) : - [x] iOS : - [ ] OSX : - [ ] TVOS : - [x] WatchOS : ### Installation method: - [ ] Carthage - [x] CocoaPods - [ ] Swift Package Manager - [ ] Manually ### Library version: - [ ] head - [ ] v2.1.0 - [x] v2.0.0 - [ ] v1.4.1 - [ ] v1.2 (Swift 4.0) - [ ] other: (Please fill in the version you are using.) ### Xcode version: - [x] 11.x (Swift 5.1) - [ ] 10.x (Swift 5.0) - [ ] 10.x (Swift 4.1) - [ ] 9.3 (Swift 4.1) - [ ] 9.0 (Swift 4.0) - [ ] other: (Please fill in the version you are using.) - [ ] objective c
kerem 2026-03-03 16:48:10 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@phimage commented on GitHub (Jan 28, 2020):

please format correctly the message markdown (edit: i have done it)

yes credential is Codable
a search show it
https://github.com/OAuthSwift/OAuthSwift/search?q=Codable&unscoped_q=Codable
oauthswift.client.credential


for others, passing to watch or extension, we could use UserDefaults or Keychain with app/access group
for instance with https://github.com/phimage/Prephirences
(an old project for that https://github.com/phimage/ApplicationGroupKit )

<!-- gh-comment-id:579138257 --> @phimage commented on GitHub (Jan 28, 2020): please format correctly the message markdown (edit: i have done it) yes credential is `Codable` a search show it https://github.com/OAuthSwift/OAuthSwift/search?q=Codable&unscoped_q=Codable `oauthswift.client.credential` --- for others, passing to watch or extension, we could use UserDefaults or Keychain with app/access group for instance with https://github.com/phimage/Prephirences (an old project for that https://github.com/phimage/ApplicationGroupKit )
Author
Owner

@IAINATTWATER commented on GitHub (Jan 29, 2020):

Thank you Eric. I managed to make that work.

Sent from my iPhone

On Jan 29, 2020, at 6:50 AM, Eric Marchand notifications@github.com wrote:


Closed #570.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

<!-- gh-comment-id:579621383 --> @IAINATTWATER commented on GitHub (Jan 29, 2020): Thank you Eric. I managed to make that work. Sent from my iPhone > On Jan 29, 2020, at 6:50 AM, Eric Marchand <notifications@github.com> wrote: > >  > Closed #570. > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub, or unsubscribe.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/OAuthSwift#374
No description provided.