Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
marcprux committed Jan 20, 2024
1 parent d310e54 commit c7ca1c4
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 18 deletions.
49 changes: 34 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,40 @@
# FireSide

This is a [Skip](https://skip.tools) dual-platform app project.
It builds a native app for both iOS and Android.

## Building

This project is both a stand-alone Swift Package Manager module,
as well as an Xcode project that builds and transpiles the project
into a Kotlin Gradle project for Android using the Skip plugin.

Building the module requires that Skip be installed using
[Homebrew](https://brew.sh) with `brew install skiptools/skip/skip`.

This will also install the necessary transpiler prerequisites:
Kotlin, Gradle, and the Android build tools.

Installation prerequisites can be confirmed by running `skip checkup`.
It creates a native app for both iOS and Android.

This app shows Skip's integration with the Firebase backend cloud computing services
using the official native Firebase SDKs for iOS and Android.

<video id="intro_video" style="width: 100%" controls autoplay>
<source style="width: 100;" src="https://assets.skip.tools/videos/SkipFirebaseExample.mov" type="video/mp4">
Your browser does not support the video tag.
</video>


## Quickstart

This repository contains an Xcode project with a SwiftUI app that uses the
Skip plugin to transpile the app into Kotlin then build and launch it on Android.
To get started:

1. Install skip (requires macOS 13+ with [Homebrew](https://brew.sh), [Xcode](https://developer.apple.com/xcode/), and [Android Studio](https://developer.android.com/studio)):
```
$ brew install skiptools/skip/skip
```
2. Configure and launch an Android emulator from the [Android Studio device manager](https://developer.android.com/studio/run/emulator-launch-without-app), or by launching a pre-existing emulator:
```
$ ~/Library/Android/sdk/emulator/emulator @Pixel_6_API_30
```
3. Download this [repository as a zip file](https://github.com/skiptools/skipapp-fireside/archive/main.zip) and unzip it, or clone the repository:
```
$ git clone https://github.com/skiptools/skipapp-fireside.git
```
4. Open the Xcode project in the *Darwin* folder:
```
$ open skipapp-fireside/Darwin/FireSide.xcodeproj
```
5. Select and Run the `FireSide` target with an iOS simulator destination; the app will build and run side-by-side on the iOS simulator and Android emulator.

## Testing

Expand Down
5 changes: 3 additions & 2 deletions Sources/FireSide/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ let fmt2: DateFormatter = {
return f
}()

let isAndroid = ProcessInfo.processInfo.environment["java.io.tmpdir"] != nil

struct MessagesListView : View {
@State var messageList: MessageList? = nil

Expand Down Expand Up @@ -114,8 +116,7 @@ struct MessagesListView : View {
ForEach(["♥️", "💙", "💛", "💚"], id: \.self) { emoji in
Button(emoji) {
Task.detached {
let isJava = ProcessInfo.processInfo.environment["java.io.tmpdir"] != nil
let msg = emoji + " from " + (isJava ? "Android" : "iOS")
let msg = emoji + " from " + (isAndroid ? "Android" : "iOS")
await sendMessage(msg)
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/FireSideModel/FireSideModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public actor FireSideStore {

fileprivate init(_ collection: CollectionReference) {
let listener = collection.addSnapshotListener(includeMetadataChanges: true, listener: { [weak self] snap, err in
logger.log("snapshot: \(snap) error=\(err)")
//logger.log("snapshot: \(snap) error=\(err)")
var msgs: [Message] = []
if let snap = snap {
for doc in snap.documents {
Expand Down

0 comments on commit c7ca1c4

Please sign in to comment.