Skip to content

Commit

Permalink
clean up ios app: readme and configurable api base url
Browse files Browse the repository at this point in the history
  • Loading branch information
anitarua committed Aug 16, 2024
1 parent d357af3 commit ee9a61d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
3 changes: 2 additions & 1 deletion ios/ModeratedChat/ModeratedChat/TranslationApi.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Alamofire
@MainActor
class TranslationApi: ObservableObject {
static let shared = TranslationApi()
private let baseUrl = "https://57zovcekn0.execute-api.us-west-2.amazonaws.com/prod";
private let baseUrl: String = ProcessInfo.processInfo.environment["API_BASE_URL"]!
@Published var selectedLanguageCode: String = "en"
@Published var supportedLanguages: [Language] = []
@Published var currentUsername: String = ""
Expand All @@ -17,6 +17,7 @@ class TranslationApi: ObservableObject {
}

func createToken() async -> MomentoToken {

do {
let user = getUser()
currentUsername = user.username
Expand Down
25 changes: 21 additions & 4 deletions ios/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
# Moderated Chat using iOS Client
# iOS Moderated Chat App

## Running the example using the Xcode simulator
This directory contains an iOS client of the Moderated Chat demo.

1. Open the `ios/moderated_chat` directory as an Xcode project.
3. Click Run (in the Product menu).
## Prerequisites

- [Xcode](https://developer.apple.com/xcode/)

## Running the demo

Create an environment variable to specify the base URL for your API endpoints.

```bash
VITE_API_BASE_URL="https://chat-api.your-chosen-domain-name.com"
```

You may also need to specify a variable to enable logging output:

```bash
IDEPreferLogStreaming=YES
```

To run the app using a simulator, simply open the `ios/moderated_chat` directory as an Xcode project and click "Run".

0 comments on commit ee9a61d

Please sign in to comment.