diff --git a/android/app/build.gradle b/android/app/build.gradle index 4a6b233e..fb2e3387 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -120,7 +120,7 @@ android { applicationId "com.betterrail" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 72 + versionCode 73 versionName "2.2.0" missingDimensionStrategy "store", "play" } diff --git a/app/app.tsx b/app/app.tsx index 77d5f9f5..9b8cbb51 100644 --- a/app/app.tsx +++ b/app/app.tsx @@ -132,7 +132,7 @@ function App() { if (languageCode) { setUserLanguage(languageCode) setLocaleReady(true) - analytics().setUserProperties({ userLocale: languageCode }) + analytics().setUserProperty("user_locale", languageCode) } else { setInitialLanguage() } diff --git a/app/i18n/i18n.ts b/app/i18n/i18n.ts index 029ab85b..b2bdcaf5 100644 --- a/app/i18n/i18n.ts +++ b/app/i18n/i18n.ts @@ -31,7 +31,7 @@ export let dateDelimiter = " " export let dateLocale = "en-US" export const deviceLocale = Localization.locale -analytics().setUserProperties({ deviceLocale }) +analytics().setUserProperty("device_locale", deviceLocale) export function getInitialLanguage(): LanguageCode { if (Localization.locale.startsWith("he")) { diff --git a/app/models/favorites/favorites.ts b/app/models/favorites/favorites.ts index 86c9ccd7..8cb1f0df 100644 --- a/app/models/favorites/favorites.ts +++ b/app/models/favorites/favorites.ts @@ -1,10 +1,22 @@ import { Instance, SnapshotOut, types } from "mobx-state-tree" import { Platform } from "react-native" -import { getIsWatchAppInstalled, updateApplicationContext, WatchPayload } from "react-native-watch-connectivity" +import analytics from "@react-native-firebase/analytics" +import { getIsWatchAppInstalled, updateApplicationContext, getIsPaired, WatchPayload } from "react-native-watch-connectivity" import Shortcuts from "react-native-quick-actions-shortcuts" import { stationLocale, stationsObject } from "../../data/stations" import { translate } from "../../i18n" +if (Platform.OS === "ios") { + // set analytics user property for apple watch + getIsPaired().then((isPaired) => { + analytics().setUserProperty("apple_watch_paired", isPaired ? "true" : "false") + }) + + getIsWatchAppInstalled().then((isInstalled) => { + analytics().setUserProperty("apple_watch_app_installed", isInstalled ? "true" : "false") + }) +} + export const favoriteRouteSchema = { id: types.string, originId: types.string, diff --git a/app/theme/index.ts b/app/theme/index.ts index 353e9919..7d05d7c0 100644 --- a/app/theme/index.ts +++ b/app/theme/index.ts @@ -10,4 +10,4 @@ export const fontScale = PixelRatio.getFontScale() const colorScheme = Appearance.getColorScheme() export const isDarkMode = colorScheme === "dark" -analytics().setUserProperties({ colorScheme, fontScale: `${fontScale}` }) +analytics().setUserProperties({ color_scheme: colorScheme, font_scale: `${fontScale}` }) diff --git a/ios/BetterRail.xcodeproj/project.pbxproj b/ios/BetterRail.xcodeproj/project.pbxproj index f412d9d3..d87d3abb 100644 --- a/ios/BetterRail.xcodeproj/project.pbxproj +++ b/ios/BetterRail.xcodeproj/project.pbxproj @@ -1156,7 +1156,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = BetterRail/BetterRailDebug.entitlements; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 9; + CURRENT_PROJECT_VERSION = 10; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = UE6BVYPPFX; ENABLE_BITCODE = NO; @@ -1196,7 +1196,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 9; + CURRENT_PROJECT_VERSION = 10; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = UE6BVYPPFX; INFOPLIST_FILE = BetterRail/Info.plist; @@ -1359,7 +1359,7 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; "CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 9; + CURRENT_PROJECT_VERSION = 10; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=watchos*]" = UE6BVYPPFX; @@ -1401,7 +1401,7 @@ "CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 9; + CURRENT_PROJECT_VERSION = 10; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=watchos*]" = UE6BVYPPFX; @@ -1437,7 +1437,7 @@ CODE_SIGN_ENTITLEMENTS = "WatchBetterRail Extension/WatchBetterRail Extension.entitlements"; "CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 9; + CURRENT_PROJECT_VERSION = 10; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=watchos*]" = UE6BVYPPFX; @@ -1478,7 +1478,7 @@ "CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 9; + CURRENT_PROJECT_VERSION = 10; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=watchos*]" = UE6BVYPPFX; @@ -1516,7 +1516,7 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_ENTITLEMENTS = BetterRailWidgetExtensionDebug.entitlements; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 9; + CURRENT_PROJECT_VERSION = 10; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = UE6BVYPPFX; @@ -1557,7 +1557,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 9; + CURRENT_PROJECT_VERSION = 10; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = UE6BVYPPFX; @@ -1590,7 +1590,7 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_ENTITLEMENTS = StationIntent/StationIntentDebug.entitlements; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 9; + CURRENT_PROJECT_VERSION = 10; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = UE6BVYPPFX; @@ -1629,7 +1629,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 9; + CURRENT_PROJECT_VERSION = 10; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = UE6BVYPPFX; diff --git a/ios/BetterRail/Info.plist b/ios/BetterRail/Info.plist index 8b06d5ce..392e5594 100644 --- a/ios/BetterRail/Info.plist +++ b/ios/BetterRail/Info.plist @@ -23,7 +23,7 @@ CFBundleSignature ???? CFBundleVersion - 9 + 10 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/BetterRailWidget/Info.plist b/ios/BetterRailWidget/Info.plist index 2ae4f4d2..ed8aa94e 100644 --- a/ios/BetterRailWidget/Info.plist +++ b/ios/BetterRailWidget/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString $(MARKETING_VERSION) CFBundleVersion - 9 + 10 NSExtension NSExtensionPointIdentifier diff --git a/ios/StationIntent/Info.plist b/ios/StationIntent/Info.plist index 0ff2faa5..f6966602 100644 --- a/ios/StationIntent/Info.plist +++ b/ios/StationIntent/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString $(MARKETING_VERSION) CFBundleVersion - 9 + 10 NSExtension NSExtensionAttributes diff --git a/ios/WatchBetterRail Extension/Info.plist b/ios/WatchBetterRail Extension/Info.plist index 839ec39d..98e07170 100644 --- a/ios/WatchBetterRail Extension/Info.plist +++ b/ios/WatchBetterRail Extension/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString $(MARKETING_VERSION) CFBundleVersion - 9 + 10 CLKComplicationPrincipalClass $(PRODUCT_MODULE_NAME).ComplicationController NSExtension diff --git a/ios/WatchBetterRail/Info.plist b/ios/WatchBetterRail/Info.plist index 73f14fa2..eef7ee52 100644 --- a/ios/WatchBetterRail/Info.plist +++ b/ios/WatchBetterRail/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString $(MARKETING_VERSION) CFBundleVersion - 9 + 10 UISupportedInterfaceOrientations UIInterfaceOrientationPortrait