-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix(Swift): Addressing some gaps in Geo Gen2 doc pages #7573
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -209,21 +209,18 @@ dependencies { | |
<InlineFilter filters={['swift']}> | ||
The Geo plugin is dependent on Cognito Auth. | ||
|
||
<BlockSwitcher> | ||
|
||
<Block name="Swift Package Manager"> | ||
1. To install the Amplify Libraries in your application, open your project in Xcode and select **File > Add Packages...**. | ||
|
||
1. To install Amplify Geo and Authentication to your application, open your project in Xcode and select **File > Add Packages...**. | ||
2. Enter the **Amplify Library for Swift** GitHub repo URL (`https://github.com/aws-amplify/amplify-swift`) into the search bar and click **Add Package**. | ||
|
||
1. Enter the **Amplify Library for Swift** GitHub repo URL (`https://github.com/aws-amplify/amplify-swift`) into the search bar and and hit **Enter** Wait for the result to load. You'll see the repository rules for which version of amplify-ios-mapLibre you want Swift Package Manager to install. | ||
<Callout> | ||
|
||
1. Choose the dependency rule **Up to Next Major Version**, as it will use the latest compatible version of the dependency, then click **Add Package**. | ||
**Note:** **Up to Next Major Version** should be selected from the **Dependency Rule** dropdown. | ||
|
||
1. Lastly, choose **AWSLocationGeoPlugin**, **AWSCognitoAuthPlugin**, and **Amplify**. Then click Finish. | ||
</Callout> | ||
|
||
</Block> | ||
1. Lastly, add **AWSLocationGeoPlugin**, **AWSCognitoAuthPlugin**, and **Amplify** to your target. Then click **Add Package**. | ||
|
||
</BlockSwitcher> | ||
</InlineFilter> | ||
|
||
## Initialize Amplify Geo | ||
|
@@ -340,12 +337,23 @@ Initialized Amplify | |
</InlineFilter> | ||
|
||
<InlineFilter filters={['swift']}> | ||
To initialize the Amplify Geo, use the `Amplify.addPlugin()` method to add the AWSLocationGeoPlugin. Next, finish configuring Amplify by calling `Amplify.configure()`. | ||
<Callout warning> | ||
Make sure to generate the `amplify_outputs.json` file by running the following command: | ||
|
||
```bash title="Terminal" showLineNumbers={false} | ||
npx ampx sandbox | ||
``` | ||
Comment on lines
+341
to
+345
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should this be moved outside the swift block? I think we should keep the prose relatively the same across platforms (with a few exceptions) for maintainability and a concise UX There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could explore doing that in the future as a docs clean up, but right now each platform is doing its own thing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. platform-specific callouts were (mostly) cleaned up when content was ported into this new structure. swift has the callout to move the file into the project, which is fine, but prose should be relatively the same |
||
|
||
Next, move the file to your project. You can do this by dragging and dropping the file into your Xcode project. | ||
</Callout> | ||
|
||
To initialize Amplify Geo, use the `Amplify.add(plugin:)` method to add the AWS Location Geo plugin. Next, finish configuring Amplify by calling `Amplify.configure(with:)`. | ||
|
||
Open the main file of the application - `AppDelegate.swift` or `<YOUR_APP_NAME>App.swift` depending on the app's life cycle - and **add the following** import statements at the top of the file: | ||
|
||
```swift | ||
import Amplify | ||
import AWSCognitoAuthPlugin | ||
import AWSLocationGeoPlugin | ||
``` | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.