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 docs and store links #668

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 5 additions & 87 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
# Download

The PrioBike app is available for download:
- On Google Play: https://play.google.com/apps/testing/de.tudresden.priobike
- On TestFlight: https://testflight.apple.com/join/GXdqWpdn
- On Google Play: https://play.google.com/store/apps/details?id=de.tudresden.priobike&hl=de
- On App Store: https://apps.apple.com/de/app/priobike/id1634224594

# Quickstart

Expand All @@ -32,90 +32,8 @@ Make sure to `cp android/gradle.properties.example android/gradle.properties` an

Also make sure to `cp android/key.properties.example android/key.properties` and `cp android/fastlane/example-keystore.jks android/fastlane/keystore.jks` to be able to sign the app for local release builds. This is different from our Google Play upload keystore and therefore not confidential.

## Generating App Icons and Splash Screen

This project uses [flutter_launcher_icons](https://pub.dev/packages/flutter_launcher_icons) to
generate app icons. To generate them, replace `assets/icon.png` and then
run: `flutter pub run flutter_launcher_icons:main`.

To provide a splash screen, this project
uses [flutter_native_splash](https://pub.dev/packages/flutter_native_splash). To generate the splash
screens for Android and iOS, replace `assets/splash.png` and then
run: `flutter pub run flutter_native_splash:create`.

### Note: Android 12 Splash Screen Support

Since Android 12 implements its own splash screen, a solution must be found for this version, since
otherwise there will be two different splash screens. It was decided to keep the Android 12 splash
screen (since this one can't be deactivated) and replace the second unwanted splash screen with a
uniform color. For this purpose, a separate `launch_background` drawable file was created for
Android v31. More information can be
found [here](https://pub.dev/packages/flutter_native_splash#android-12-support).

```diff
+ android/app/src/main/res/drawable-night-v31/launch_background;
+ android/app/src/main/res/drawable-v31/launch_background;
```

## Continuous Delivery

![Flutter App Development](https://user-images.githubusercontent.com/27271818/208384012-5259dae4-abad-4705-9390-ac1bcf007ac7.png)

On push to `dev` or `beta`, a build workflow will be triggered to distribute our app.

## Clean up Android logs

Since we use the textureView for our Mapbox Maps, the log gets spammed with the following message:

```
updateAcquireFence: Did not find frame.
```

According to [this](https://github.com/flutter/flutter/issues/104268#issuecomment-1134964433), this
is meaningless for us. Therefore we can use filters in our IDE to exclude this message from the
log (ensuring a clean log).

For Android Studio include the following filter when using Logcat:

```
package=:de.tudresden.priobike -message:"updateAcquireFence: Did not find frame."
```

For Visual Studio Code it is not that important because it groups the messages already such that
they are not that annoying. To exclude those use the following filter:

```
!updateAcquireFence: Did not find frame.
```

## Documentation for Flutter

For help getting started with Flutter, view the
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.

## Troubleshooting

### IOS-Simulator doesn't work on M1-Macs

Currently (Nov. 2022) XCode still has legacy applications that don't fully work on Apple's M1-Chips.
One such application is the iOS-Simulator. There
are [several options](https://blog.sudeium.com/2021/06/18/build-for-x86-simulator-on-apple-silicon-macs/)
to fix this.

The easiest fix is to
change `PrioBike/priobike-flutter-app/ios/Pods/Pods.xcodeproj/project.pbxproj`:

```diff
- VALID_ARCHS[sdk=iphonesimulator*] = "$(ARCHS_STANDARD)";
+ VALID_ARCHS[sdk=iphonesimulator*] = x86_64;
```

Also, if there is a problem with the iPhoneOS-Deployment-Target, change it to 11.0 in the same file:

```diff
- IPHONEOS_DEPLOYMENT_TARGET = 8.0;
- IPHONEOS_DEPLOYMENT_TARGET = 9.0;
- IPHONEOS_DEPLOYMENT_TARGET = 10.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 11.0;
```
- On push to `dev`, a build workflow will be triggered to distribute the app to our internal testing at Testflight and Playstore.
- On push to `beta-x`, a build workflow will be triggered to distribute the app to the closed (later open) beta test tracks at Testflight and Playstore.
- When tagging a commit on the `dev` branch with the naming scheme `release-vX.X.X`, a build workflow will be triggered to distribute the app to the Appstore and Playstore (publicly available).
6 changes: 4 additions & 2 deletions lib/home/models/shortcut.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ abstract class Shortcut {
// Try to resolve a potential short link.
String? longLink = await LinkShortener.resolveShortLink(link);

// If resolving failed we don't have a corresponding long link, this either means the link
// got created with an old version of the app (thus the short link is already a long link) or the link is invalid.
// If resolving failed, this can have two reasons.
// 1. The short link was invalid. If this is the case, the subsequent steps will fail, but since we are catching this, this is not a problem.
// 2. The link is already a short link. This can be the case, if the link got resolved before opening the app.
// This is usually the case, when the short link is opened in a browser, and due to the resolving of the link in the browser, the app gets openend.
longLink ??= link;

// Create a new shortcut from the long link.
Expand Down
4 changes: 2 additions & 2 deletions lib/home/views/shortcuts/edit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ class EditOptionsViewState extends State<EditOptionsView> {
String? shortLink = await LinkShortener.createShortLink(longLink);
if (shortLink == null) return;
const getAppText = 'Falls Du die PrioBike App noch nicht hast, kannst Du sie Dir hier holen:';
const playStoreLink = 'https://play.google.com/apps/testing/de.tudresden.priobike';
const appStoreLink = 'https://testflight.apple.com/join/GXdqWpdn';
const playStoreLink = 'https://play.google.com/store/apps/details?id=de.tudresden.priobike&hl=de';
const appStoreLink = 'https://apps.apple.com/de/app/priobike/id1634224594';
String subject = '';
shortcut.type == "ShortcutLocation" ? subject = 'Ort teilen' : subject = 'Route teilen';
await Share.share('$text \n$shortLink \n$getAppText \n$playStoreLink \n$appStoreLink', subject: subject);
Expand Down
Loading