-
Notifications
You must be signed in to change notification settings - Fork 10
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
chore: sample app fixes #136
Changes from all commits
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 |
---|---|---|
|
@@ -7,10 +7,13 @@ plugins { | |
|
||
android { | ||
namespace 'io.customer.amiapp_flutter' | ||
compileSdkVersion 33 | ||
compileSdkVersion 34 | ||
ndkVersion flutter.ndkVersion | ||
|
||
compileOptions { | ||
// Flag to enable support for the new language APIs | ||
coreLibraryDesugaringEnabled true | ||
// Sets Java compatibility to Java 8 | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
|
@@ -40,6 +43,7 @@ android { | |
targetSdkVersion 33 | ||
versionCode 1 | ||
versionName "1.0" | ||
multiDexEnabled true | ||
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. I think that this increases build times when it's enabled so just calling it out to make sure this is required and it wasn't automatically added or you forgot to remove it. If you added it intentionally, no problem. 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. Correct. This too was added only for flutter_local_notifications gradle setup. |
||
} | ||
|
||
signingConfigs { | ||
|
@@ -70,6 +74,9 @@ flutter { | |
|
||
dependencies { | ||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21" | ||
// Required for flutter_local_notifications, see more: | ||
// https://pub.dev/packages/flutter_local_notifications#gradle-setup | ||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2' | ||
// Adding customer.io android sdk dependencies so we can use them in native code | ||
// These are not generally needed and should be avoided | ||
implementation "io.customer.android:tracking" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import Foundation | ||
|
||
class Env { | ||
static var siteId: String = "siteid" | ||
static var apiKey: String = "apikey" | ||
static let siteId: String = "siteid" | ||
static let apiKey: String = "apikey" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:go_router/go_router.dart'; | ||
|
||
extension AmiAppExtensions on BuildContext { | ||
void showSnackBar(String text) { | ||
|
@@ -99,3 +100,16 @@ extension AmiAppDoubleExtensions on double { | |
return toStringAsFixed(0); | ||
} | ||
} | ||
|
||
extension LocationExtensions on GoRouter { | ||
// Get location of current route | ||
// This is a workaround to get the current location as location property | ||
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. Since this is labeled as a workaround, it makes me wonder if this is a short-term solution? To make our sample app an up-to-date reference for customers, should we replace this with recommended best practice code in the future? 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. Agreed. I'm not expert with |
||
// was removed from GoRouter in v9.0.0 | ||
// See migration guide: | ||
// https://flutter.dev/go/go-router-v9-breaking-changes | ||
String currentLocation() { | ||
final RouteMatch lastMatch = routerDelegate.currentConfiguration.last; | ||
final RouteMatchList matchList = lastMatch is ImperativeRouteMatch ? lastMatch.matches : routerDelegate.currentConfiguration; | ||
return matchList.uri.toString(); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting, what new language API are we introducing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is required by flutter_local_notifications gradle setup.