-
Notifications
You must be signed in to change notification settings - Fork 401
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
Device Settings, Intercom Integration and Improvements #902
Changes from 11 commits
134c194
1c48887
43db752
5f736aa
4331261
0470b90
288ef6f
c57ad3d
725849f
98bcaf8
70e9996
f53c3b8
4d7e0bc
def9628
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 |
---|---|---|
|
@@ -33,6 +33,9 @@ if (keystorePropertiesFile.exists()) { | |
|
||
android { | ||
|
||
namespace "com.friend.ios" | ||
|
||
|
||
// ----- BEGIN flavorDimensions (autogenerated by flutter_flavorizr) ----- | ||
flavorDimensions += "flavor-type" | ||
|
||
|
@@ -105,6 +108,7 @@ android { | |
shrinkResources true | ||
} | ||
debug{ | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
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. You've added ProGuard rules file to the debug build type. While this is not an issue per se, it's unusual to use ProGuard in debug builds as it obfuscates the code, making debugging more difficult. If you have a specific reason for doing this, it's fine. Otherwise, consider removing it from the debug build type. + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
||
minifyEnabled true | ||
} | ||
} | ||
|
@@ -117,7 +121,6 @@ flutter { | |
} | ||
|
||
dependencies { | ||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.10" | ||
androidTestImplementation 'androidx.test:runner:1.2.0' | ||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' | ||
implementation 'androidx.multidex:multidex:2.0.1' | ||
Comment on lines
129
to
132
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. The Kotlin dependency has been removed from the dependencies block. If Kotlin is no longer being used in the project, this is fine. However, if there are still parts of the project written in Kotlin, this will cause compilation errors. Please ensure that all Kotlin code has been properly migrated to Java or another language before removing this dependency. |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Fri Jun 23 08:50:38 CEST 2017 | ||
#Sun Sep 22 21:12:01 IST 2024 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -445,7 +445,7 @@ | |
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerDebug-prod.entitlements"; | ||
DEVELOPMENT_TEAM = 9536L8KLMP; | ||
INFOPLIST_KEY_CFBundleDisplayName = Omi; | ||
IPHONEOS_DEPLOYMENT_TARGET = 14.0; | ||
IPHONEOS_DEPLOYMENT_TARGET = 15.0; | ||
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. The iOS deployment target has been updated from 14.0 to 15.0. This change will require all users to have at least iOS 15.0 installed on their devices to use the app. If there are still a significant number of users on iOS 14, this could potentially exclude them from being able to update or install the app. Please ensure that this change aligns with your user base and support strategy. - IPHONEOS_DEPLOYMENT_TARGET = 14.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 15.0; |
||
PRODUCT_BUNDLE_IDENTIFIER = "com.friend-app-with-wearable.ios12"; | ||
PRODUCT_NAME = Runner; | ||
TARGETED_DEVICE_FAMILY = 1; | ||
|
@@ -461,7 +461,7 @@ | |
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerProfile-prod.entitlements"; | ||
DEVELOPMENT_TEAM = 9536L8KLMP; | ||
INFOPLIST_KEY_CFBundleDisplayName = Omi; | ||
IPHONEOS_DEPLOYMENT_TARGET = 14.0; | ||
IPHONEOS_DEPLOYMENT_TARGET = 15.0; | ||
PRODUCT_BUNDLE_IDENTIFIER = "com.friend-app-with-wearable.ios12"; | ||
PRODUCT_NAME = Runner; | ||
TARGETED_DEVICE_FAMILY = 1; | ||
|
@@ -477,7 +477,7 @@ | |
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-prod.entitlements"; | ||
DEVELOPMENT_TEAM = 9536L8KLMP; | ||
INFOPLIST_KEY_CFBundleDisplayName = Omi; | ||
IPHONEOS_DEPLOYMENT_TARGET = 14.0; | ||
IPHONEOS_DEPLOYMENT_TARGET = 15.0; | ||
PRODUCT_BUNDLE_IDENTIFIER = "com.friend-app-with-wearable.ios12"; | ||
PRODUCT_NAME = Runner; | ||
TARGETED_DEVICE_FAMILY = 1; | ||
|
@@ -493,7 +493,7 @@ | |
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerDebug-dev.entitlements"; | ||
DEVELOPMENT_TEAM = 9536L8KLMP; | ||
INFOPLIST_KEY_CFBundleDisplayName = Omi; | ||
IPHONEOS_DEPLOYMENT_TARGET = 14.0; | ||
IPHONEOS_DEPLOYMENT_TARGET = 15.0; | ||
PRODUCT_BUNDLE_IDENTIFIER = "com.friend-app-with-wearable.ios12.development"; | ||
PRODUCT_NAME = Runner; | ||
TARGETED_DEVICE_FAMILY = 1; | ||
|
@@ -509,7 +509,7 @@ | |
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerProfile-dev.entitlements"; | ||
DEVELOPMENT_TEAM = 9536L8KLMP; | ||
INFOPLIST_KEY_CFBundleDisplayName = Omi; | ||
IPHONEOS_DEPLOYMENT_TARGET = 14.0; | ||
IPHONEOS_DEPLOYMENT_TARGET = 15.0; | ||
PRODUCT_BUNDLE_IDENTIFIER = "com.friend-app-with-wearable.ios12.development"; | ||
PRODUCT_NAME = Runner; | ||
TARGETED_DEVICE_FAMILY = 1; | ||
|
@@ -525,7 +525,7 @@ | |
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-dev.entitlements"; | ||
DEVELOPMENT_TEAM = 9536L8KLMP; | ||
INFOPLIST_KEY_CFBundleDisplayName = Omi; | ||
IPHONEOS_DEPLOYMENT_TARGET = 14.0; | ||
IPHONEOS_DEPLOYMENT_TARGET = 15.0; | ||
PRODUCT_BUNDLE_IDENTIFIER = "com.friend-app-with-wearable.ios12.development"; | ||
PRODUCT_NAME = Runner; | ||
TARGETED_DEVICE_FAMILY = 1; | ||
|
@@ -604,7 +604,7 @@ | |
); | ||
INFOPLIST_FILE = Runner/Info.plist; | ||
INFOPLIST_KEY_CFBundleDisplayName = Omi; | ||
IPHONEOS_DEPLOYMENT_TARGET = 14.0; | ||
IPHONEOS_DEPLOYMENT_TARGET = 15.0; | ||
LD_RUNPATH_SEARCH_PATHS = ( | ||
"$(inherited)", | ||
"@executable_path/Frameworks", | ||
|
@@ -904,7 +904,7 @@ | |
); | ||
INFOPLIST_FILE = Runner/Info.plist; | ||
INFOPLIST_KEY_CFBundleDisplayName = Omi; | ||
IPHONEOS_DEPLOYMENT_TARGET = 14.0; | ||
IPHONEOS_DEPLOYMENT_TARGET = 15.0; | ||
LD_RUNPATH_SEARCH_PATHS = ( | ||
"$(inherited)", | ||
"@executable_path/Frameworks", | ||
|
@@ -949,7 +949,7 @@ | |
); | ||
INFOPLIST_FILE = Runner/Info.plist; | ||
INFOPLIST_KEY_CFBundleDisplayName = Omi; | ||
IPHONEOS_DEPLOYMENT_TARGET = 14.0; | ||
IPHONEOS_DEPLOYMENT_TARGET = 15.0; | ||
LD_RUNPATH_SEARCH_PATHS = ( | ||
"$(inherited)", | ||
"@executable_path/Frameworks", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,6 @@ import 'package:friend_private/providers/message_provider.dart'; | |
import 'package:friend_private/providers/onboarding_provider.dart'; | ||
import 'package:friend_private/providers/plugin_provider.dart'; | ||
import 'package:friend_private/providers/speech_profile_provider.dart'; | ||
import 'package:friend_private/providers/websocket_provider.dart'; | ||
import 'package:friend_private/services/notification_service.dart'; | ||
import 'package:friend_private/services/services.dart'; | ||
import 'package:friend_private/utils/analytics/gleap.dart'; | ||
|
@@ -39,6 +38,7 @@ import 'package:friend_private/utils/features/calendar.dart'; | |
import 'package:friend_private/utils/logger.dart'; | ||
import 'package:gleap_sdk/gleap_sdk.dart'; | ||
import 'package:instabug_flutter/instabug_flutter.dart'; | ||
import 'package:intercom_flutter/intercom_flutter.dart'; | ||
import 'package:opus_dart/opus_dart.dart'; | ||
import 'package:opus_flutter/opus_flutter.dart' as opus_flutter; | ||
import 'package:provider/provider.dart'; | ||
|
@@ -58,6 +58,13 @@ Future<bool> _init() async { | |
await Firebase.initializeApp(options: dev.DefaultFirebaseOptions.currentPlatform, name: 'dev'); | ||
} | ||
|
||
if (Env.intercomAppId != null) { | ||
await Intercom.instance.initialize( | ||
Env.intercomAppId!, | ||
iosApiKey: Env.intercomIOSApiKey, | ||
androidApiKey: Env.intercomAndroidApiKey, | ||
); | ||
} | ||
Comment on lines
+61
to
+67
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. This code initializes Intercom with the provided API keys. However, it's important to handle potential exceptions that might occur during initialization. For instance, if the API keys are incorrect or if there's a network issue, this could throw an error and crash the app. Consider wrapping this block in a try-catch statement to handle any exceptions gracefully. + try {
if (Env.intercomAppId != null) {
await Intercom.instance.initialize(
Env.intercomAppId!,
iosApiKey: Env.intercomIOSApiKey,
androidApiKey: Env.intercomAndroidApiKey,
);
}
+ } catch (e) {
+ // Log the exception or handle it appropriately
+ } |
||
await NotificationService.instance.initialize(); | ||
await SharedPreferencesUtil.init(); | ||
await MixpanelManager.init(); | ||
|
@@ -270,14 +277,20 @@ class DeciderWidget extends StatefulWidget { | |
class _DeciderWidgetState extends State<DeciderWidget> { | ||
@override | ||
void initState() { | ||
WidgetsBinding.instance.addPostFrameCallback((_) { | ||
WidgetsBinding.instance.addPostFrameCallback((_) async { | ||
if (context.read<ConnectivityProvider>().isConnected) { | ||
NotificationService.instance.saveNotificationToken(); | ||
} | ||
|
||
if (context.read<AuthenticationProvider>().user != null) { | ||
context.read<HomeProvider>().setupHasSpeakerProfile(); | ||
await Intercom.instance.loginIdentifiedUser( | ||
userId: FirebaseAuth.instance.currentUser!.uid, | ||
); | ||
context.read<MessageProvider>().setMessagesFromCache(); | ||
context.read<MessageProvider>().refreshMessages(); | ||
} else { | ||
await Intercom.instance.loginUnidentifiedUser(); | ||
Comment on lines
+280
to
+293
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. The WidgetsBinding.instance.addPostFrameCallback((_) async {
if (context.read<ConnectivityProvider>().isConnected) {
NotificationService.instance.saveNotificationToken();
}
if (context.read<AuthenticationProvider>().user != null) {
context.read<HomeProvider>().setupHasSpeakerProfile();
+ try {
await Intercom.instance.loginIdentifiedUser(
userId: FirebaseAuth.instance.currentUser!.uid,
);
+ } catch (e) {
+ // Log the exception or handle it appropriately
+ }
context.read<MessageProvider>().setMessagesFromCache();
context.read<MessageProvider>().refreshMessages();
} else {
+ try {
await Intercom.instance.loginUnidentifiedUser();
+ } catch (e) {
+ // Log the exception or handle it appropriately
+ }
}
}); |
||
} | ||
}); | ||
super.initState(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:friend_private/pages/home/device_settings.dart'; | ||
import 'package:friend_private/pages/settings/device_settings.dart'; | ||
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. The import path for - import 'package:friend_private/pages/home/device_settings.dart';
+ import 'package:friend_private/pages/settings/device_settings.dart'; |
||
import 'package:friend_private/pages/home/page.dart'; | ||
import 'package:friend_private/pages/onboarding/find_device/page.dart'; | ||
import 'package:friend_private/utils/other/temp.dart'; | ||
|
@@ -24,9 +24,7 @@ class _ConnectDevicePageState extends State<ConnectDevicePage> { | |
onPressed: () { | ||
Navigator.of(context).push( | ||
MaterialPageRoute( | ||
builder: (context) => const DeviceSettings( | ||
isDeviceConnected: false, | ||
), | ||
builder: (context) => const DeviceSettings(), | ||
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. The instantiation of - builder: (context) => const DeviceSettings(isDeviceConnected: false),
+ builder: (context) => const DeviceSettings(), |
||
), | ||
); | ||
}, | ||
|
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.
Entelligence.AI
The namespace "com.friend.ios" seems to be added in the Android build.gradle file. This could potentially cause confusion as it's an iOS namespace being used in an Android context. If this is intentional and required for some reason, consider adding a comment explaining why this is necessary.