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

Update AWS iOS Swift example code #3245

Closed
davepander opened this issue Sep 28, 2023 · 12 comments
Closed

Update AWS iOS Swift example code #3245

davepander opened this issue Sep 28, 2023 · 12 comments
Assignees
Labels
documentation Documentation improvements

Comments

@davepander
Copy link

Describe the bug

The code samples here: https://aws.amazon.com/getting-started/hands-on/build-ios-app-amplify/

...are a bit out-dated given the updates for iOS 17.

Steps To Reproduce

Follow the instructions given here:
https://aws.amazon.com/getting-started/hands-on/build-ios-app-amplify/

find errors based on deprecated code.

Expected behavior

Compilation.

Amplify Framework Version

5.0.14

Amplify Categories

Auth

Dependency manager

Swift PM

Swift version

5.7

CLI version

12.5.1

Xcode version

15.0

Relevant log output

<details>
<summary>Log Messages</summary>


INSERT LOG MESSAGES HERE
```

Is this a regression?

No

Regression additional context

No response

Platforms

iOS

OS Version

17

Device

iPhone

Specific to simulators

No response

Additional context

This was brought up in the discord, and it was suggested that I open this issue.
Screenshot_2023-09-11_at_5 16 15_PM
Screenshot_2023-09-11_at_5 17 10_PM

@harsh62 harsh62 added the documentation Documentation improvements label Sep 28, 2023
@harsh62
Copy link
Member

harsh62 commented Sep 28, 2023

@davepander Thanks for opening the issue. Our team will work on updating this documentation to reflect the latest platform versions.

@atierian atierian self-assigned this Oct 16, 2023
@davepander
Copy link
Author

@atierian Any thoughts or questions on this update?

@atierian
Copy link
Member

atierian commented Nov 3, 2023

We're working on updating the documentation -- we'll update you here once that's complete. In the meantime, are there any specific questions around usage that we can help you with?

@atierian atierian added the work in progress Issues was triaged and investigation done label Nov 3, 2023
@GitPappaBaker
Copy link

Updates? I have hit these two issues. If you have an update (or workaround) please provide it even if you can not update the official documentation yet. Thanks! (PS: there is actually another issue in the example code where some print statements are not terminated properly. If you give a fix to these issues I'll open a defect for that component)

@harsh62
Copy link
Member

harsh62 commented Nov 21, 2023

@GitPappaBaker Thanks for following up. Our team is actively working on updating the documentation. I will try to get some clarifications posted on this issue.

@ruisebas ruisebas assigned ruisebas and unassigned atierian Nov 21, 2023
@GitPappaBaker
Copy link

GitPappaBaker commented Nov 21, 2023

I'll put my own update in here. Not sure this is how it is supposed to function, but this will get you through.

  1. to fix the async issue just wrap each of the self.updateUserData call in a task. here is an example, repeated for each one:
            case HubPayload.EventName.Auth.signedIn:
                print("==HUB== User signed In, update UI")
                Task{
                    await self.updateUserData(withSignInStatus: true)
                }
  1. for the Amplify.Auth.signInWithWebUI call, just make an empty call: Amplify.Auth.signInWithWebUI()

  2. Although it is not mentioned in this defect, there are quite a few improperly terminated strings in a series of case statements. Here is one example "case" from the switch that has been fixed:

        case let .partial(revokeTokenError, globalSignOutError, hostedUIError):
            if let hostedUIError = hostedUIError {
                print("HostedUI error  \(String(describing: hostedUIError))")
            }

I just mention this so no one overthinks the errors that this series of switch/case generates.

I'm happy to have someone tell me a different way to fix these issues but for now...the code is working ;)

@ruisebas ruisebas added pending-release Code has been merged but pending release Code has been merged but pending release and removed work in progress Issues was triaged and investigation done labels Nov 29, 2023
@ruisebas
Copy link
Member

ruisebas commented Nov 30, 2023

Hi all, I wanted to provide an update.

The team is working on re-writing the old sample tutorial found at https://aws.amazon.com/getting-started/hands-on/build-ios-app-amplify/ in order to use the latest tools, practices and features from both Swift and Amplify.

We appreciate your patience while we complete and publish this update.

In the meantime, you can visit our official Amplify Documentation for Swift website, where you will also find:

Thanks!

@atierian
Copy link
Member

The updated guide is queued up for release -- we'll let you know once it's complete.

@davepander
Copy link
Author

The updated guide is queued up for release -- we'll let you know once it's complete.

Any update on the release?

@atierian
Copy link
Member

atierian commented Jan 8, 2024

No updates at this time. We'll be sure to let you know on this issue once the updated guide is released.

Please let us know if you have any concrete questions on getting started with Amplify Swift after reviewing the links posted a few comments up.

In the meantime, you can visit our official Amplify Documentation for Swift website, where you will also find:

Thanks!

@ruisebas
Copy link
Member

The updated tutorial has been published.

Thanks to all for your patience.

@github-actions github-actions bot removed the pending-release Code has been merged but pending release Code has been merged but pending release label Jan 25, 2024
Copy link
Contributor

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation improvements
Projects
None yet
Development

No branches or pull requests

5 participants