Compare commits
3 commits
52e7314005
...
8331029e91
Author | SHA1 | Date | |
---|---|---|---|
8331029e91 | |||
b4b7441bac | |||
774f7dc163 |
5 changed files with 72 additions and 33 deletions
|
@ -185,7 +185,8 @@
|
||||||
496EE3C8D7E445ABA85A39A6 /* Fix Xcode 15 Bug */,
|
496EE3C8D7E445ABA85A39A6 /* Fix Xcode 15 Bug */,
|
||||||
F7ADCC68A8E44BA69FCA849E /* Fix Xcode 15 Bug */,
|
F7ADCC68A8E44BA69FCA849E /* Fix Xcode 15 Bug */,
|
||||||
B1AB92A327A24FB294681EDD /* Fix Xcode 15 Bug */,
|
B1AB92A327A24FB294681EDD /* Fix Xcode 15 Bug */,
|
||||||
F65632CE7D4A409F817EEC81 /* Remove signature files (Xcode workaround) */,
|
0E26E4D25E2E49C3AB2723FA /* Fix Xcode 15 Bug */,
|
||||||
|
8589214E888941E1817F4C9F /* Remove signature files (Xcode workaround) */,
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
);
|
);
|
||||||
|
@ -1064,6 +1065,40 @@ fi";
|
||||||
shellScript = "
|
shellScript = "
|
||||||
echo \"Remove signature files (Xcode workaround)\";
|
echo \"Remove signature files (Xcode workaround)\";
|
||||||
rm -rf \"$CONFIGURATION_BUILD_DIR/MapLibre.xcframework-ios.signature\";
|
rm -rf \"$CONFIGURATION_BUILD_DIR/MapLibre.xcframework-ios.signature\";
|
||||||
|
";
|
||||||
|
};
|
||||||
|
0E26E4D25E2E49C3AB2723FA /* Fix Xcode 15 Bug */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
name = "Fix Xcode 15 Bug";
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "if [ \"$XCODE_VERSION_MAJOR\" = \"1500\" ]; then
|
||||||
|
echo \"Remove signature files (Xcode 15 workaround)\"
|
||||||
|
find \"$BUILD_DIR/${CONFIGURATION}-iphoneos\" -name \"*.signature\" -type f | xargs -r rm
|
||||||
|
fi";
|
||||||
|
};
|
||||||
|
8589214E888941E1817F4C9F /* Remove signature files (Xcode workaround) */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
name = "Remove signature files (Xcode workaround)";
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "
|
||||||
|
echo \"Remove signature files (Xcode workaround)\";
|
||||||
|
rm -rf \"$CONFIGURATION_BUILD_DIR/MapLibre.xcframework-ios.signature\";
|
||||||
";
|
";
|
||||||
};
|
};
|
||||||
/* End PBXShellScriptBuildPhase section */
|
/* End PBXShellScriptBuildPhase section */
|
||||||
|
|
|
@ -81,17 +81,17 @@
|
||||||
"@maplibre/maplibre-react-native": "10.0.0-alpha.23",
|
"@maplibre/maplibre-react-native": "10.0.0-alpha.23",
|
||||||
"@notifee/react-native": "^9.1.8",
|
"@notifee/react-native": "^9.1.8",
|
||||||
"@react-native-async-storage/async-storage": "1.23.1",
|
"@react-native-async-storage/async-storage": "1.23.1",
|
||||||
"@react-native-community/netinfo": "^11.3.3",
|
"@react-native-community/netinfo": "^11.4.1",
|
||||||
"@react-native-community/slider": "4.5.5",
|
"@react-native-community/slider": "4.5.5",
|
||||||
"@react-native-firebase/app": "^20.5.0",
|
"@react-native-firebase/app": "^20.5.0",
|
||||||
"@react-native-firebase/messaging": "^20.5.0",
|
"@react-native-firebase/messaging": "^20.5.0",
|
||||||
"@react-native-masked-view/masked-view": "^0.3.0",
|
"@react-native-masked-view/masked-view": "0.3.1",
|
||||||
"@react-navigation/bottom-tabs": "^6.6.1",
|
"@react-navigation/bottom-tabs": "^6.6.1",
|
||||||
"@react-navigation/drawer": "^6.7.2",
|
"@react-navigation/drawer": "^6.7.2",
|
||||||
"@react-navigation/elements": "^1.3.31",
|
"@react-navigation/elements": "^1.3.31",
|
||||||
"@react-navigation/material-top-tabs": "^6.6.14",
|
"@react-navigation/material-top-tabs": "^6.6.14",
|
||||||
"@react-navigation/native": "^6.0.8",
|
"@react-navigation/native": "^6.1.18",
|
||||||
"@react-navigation/stack": "^6.3.21",
|
"@react-navigation/stack": "^6.4.1",
|
||||||
"@sentry/react-native": "~6.10.0",
|
"@sentry/react-native": "~6.10.0",
|
||||||
"@sentry/tracing": "^7.120.3",
|
"@sentry/tracing": "^7.120.3",
|
||||||
"@turf/along": "^7.1.0",
|
"@turf/along": "^7.1.0",
|
||||||
|
|
|
@ -9,10 +9,6 @@ import {
|
||||||
} from "react-native";
|
} from "react-native";
|
||||||
import { Title } from "react-native-paper";
|
import { Title } from "react-native-paper";
|
||||||
import { Ionicons, Entypo } from "@expo/vector-icons";
|
import { Ionicons, Entypo } from "@expo/vector-icons";
|
||||||
import {
|
|
||||||
RequestDisableOptimization,
|
|
||||||
BatteryOptEnabled,
|
|
||||||
} from "react-native-battery-optimization-check";
|
|
||||||
import {
|
import {
|
||||||
permissionsActions,
|
permissionsActions,
|
||||||
usePermissionsState,
|
usePermissionsState,
|
||||||
|
@ -20,6 +16,10 @@ import {
|
||||||
} from "~/stores";
|
} from "~/stores";
|
||||||
import { createStyles, useTheme } from "~/theme";
|
import { createStyles, useTheme } from "~/theme";
|
||||||
import openSettings from "~/lib/native/openSettings";
|
import openSettings from "~/lib/native/openSettings";
|
||||||
|
import {
|
||||||
|
RequestDisableOptimization,
|
||||||
|
BatteryOptEnabled,
|
||||||
|
} from "react-native-battery-optimization-check";
|
||||||
|
|
||||||
import requestPermissionLocationBackground from "~/permissions/requestPermissionLocationBackground";
|
import requestPermissionLocationBackground from "~/permissions/requestPermissionLocationBackground";
|
||||||
import requestPermissionMotion from "~/permissions/requestPermissionMotion";
|
import requestPermissionMotion from "~/permissions/requestPermissionMotion";
|
||||||
|
@ -73,6 +73,8 @@ const HeroMode = () => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
setBatteryOptInProgress(true);
|
setBatteryOptInProgress(true);
|
||||||
|
|
||||||
|
// Check if battery optimization is enabled
|
||||||
const isEnabled = await BatteryOptEnabled();
|
const isEnabled = await BatteryOptEnabled();
|
||||||
setBatteryOptimizationEnabled(isEnabled);
|
setBatteryOptimizationEnabled(isEnabled);
|
||||||
|
|
||||||
|
@ -80,11 +82,12 @@ const HeroMode = () => {
|
||||||
console.log(
|
console.log(
|
||||||
"Battery optimization is enabled, requesting to disable...",
|
"Battery optimization is enabled, requesting to disable...",
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Request to disable battery optimization (opens Android Settings)
|
||||||
RequestDisableOptimization();
|
RequestDisableOptimization();
|
||||||
setBatteryOptAttempted(true);
|
setBatteryOptAttempted(true);
|
||||||
|
|
||||||
// Give some time for the user to interact with the system dialog
|
// Return false to indicate user needs to complete action in Settings
|
||||||
// We'll check the status again in the retry flow
|
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
console.log("Battery optimization already disabled");
|
console.log("Battery optimization already disabled");
|
||||||
|
@ -106,20 +109,21 @@ const HeroMode = () => {
|
||||||
// Don't change step immediately to avoid race conditions
|
// Don't change step immediately to avoid race conditions
|
||||||
console.log("Starting permission requests...");
|
console.log("Starting permission requests...");
|
||||||
|
|
||||||
// Request motion permission first
|
// Request battery optimization FIRST (opens Android Settings)
|
||||||
|
// This prevents the bubbling issue by handling Settings-based permissions before in-app dialogs
|
||||||
|
const batteryOptDisabled = await handleBatteryOptimization();
|
||||||
|
console.log("Battery optimization disabled:", batteryOptDisabled);
|
||||||
|
|
||||||
|
// Request motion permission second
|
||||||
const motionGranted = await requestPermissionMotion.requestPermission();
|
const motionGranted = await requestPermissionMotion.requestPermission();
|
||||||
permissionsActions.setMotion(motionGranted);
|
permissionsActions.setMotion(motionGranted);
|
||||||
console.log("Motion permission:", motionGranted);
|
console.log("Motion permission:", motionGranted);
|
||||||
|
|
||||||
// Then request background location
|
// Request background location last (after user returns from Settings if needed)
|
||||||
const locationGranted = await requestPermissionLocationBackground();
|
const locationGranted = await requestPermissionLocationBackground();
|
||||||
permissionsActions.setLocationBackground(locationGranted);
|
permissionsActions.setLocationBackground(locationGranted);
|
||||||
console.log("Location background permission:", locationGranted);
|
console.log("Location background permission:", locationGranted);
|
||||||
|
|
||||||
// Handle battery optimization separately to avoid dialog conflicts
|
|
||||||
const batteryOptDisabled = await handleBatteryOptimization();
|
|
||||||
console.log("Battery optimization disabled:", batteryOptDisabled);
|
|
||||||
|
|
||||||
// Only set step to tracking after all permission requests are complete
|
// Only set step to tracking after all permission requests are complete
|
||||||
permissionWizardActions.setCurrentStep("tracking");
|
permissionWizardActions.setCurrentStep("tracking");
|
||||||
|
|
||||||
|
|
|
@ -73,10 +73,10 @@ Sentry.init({
|
||||||
replaysSessionSampleRate: 0.1,
|
replaysSessionSampleRate: 0.1,
|
||||||
replaysOnErrorSampleRate: 1.0,
|
replaysOnErrorSampleRate: 1.0,
|
||||||
integrations: [
|
integrations: [
|
||||||
Sentry.mobileReplayIntegration({
|
// Sentry.mobileReplayIntegration({
|
||||||
maskAllText: false,
|
// maskAllText: false,
|
||||||
maskAllImages: false,
|
// maskAllImages: false,
|
||||||
maskAllVectors: false,
|
// maskAllVectors: false,
|
||||||
}),
|
// }),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
22
yarn.lock
22
yarn.lock
|
@ -5188,7 +5188,7 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@react-native-community/netinfo@npm:^11.3.3":
|
"@react-native-community/netinfo@npm:^11.4.1":
|
||||||
version: 11.4.1
|
version: 11.4.1
|
||||||
resolution: "@react-native-community/netinfo@npm:11.4.1"
|
resolution: "@react-native-community/netinfo@npm:11.4.1"
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
|
@ -5234,13 +5234,13 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@react-native-masked-view/masked-view@npm:^0.3.0":
|
"@react-native-masked-view/masked-view@npm:0.3.1":
|
||||||
version: 0.3.2
|
version: 0.3.1
|
||||||
resolution: "@react-native-masked-view/masked-view@npm:0.3.2"
|
resolution: "@react-native-masked-view/masked-view@npm:0.3.1"
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
react: ">=16"
|
react: ">=16"
|
||||||
react-native: ">=0.57"
|
react-native: ">=0.57"
|
||||||
checksum: 10/04ffbc01083aa563ca1e2d7ef6759e7b326b8129f5bb1aa5f3142348adab06d5e321a400cf70a5434324dfa906add383f8214640697c48c9e5311b30bfea03d9
|
checksum: 10/71d7a6277a869beaed34497d5b92cba7405586fe19ad05c2e892e5e5843b664386080573f4cfaea1fb68ed77de94bf46c20958f4e58d1a5a716c3652d65815b9
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
@ -5645,7 +5645,7 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@react-navigation/native@npm:^6.0.8":
|
"@react-navigation/native@npm:^6.1.18":
|
||||||
version: 6.1.18
|
version: 6.1.18
|
||||||
resolution: "@react-navigation/native@npm:6.1.18"
|
resolution: "@react-navigation/native@npm:6.1.18"
|
||||||
dependencies:
|
dependencies:
|
||||||
|
@ -5669,7 +5669,7 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@react-navigation/stack@npm:^6.3.21":
|
"@react-navigation/stack@npm:^6.4.1":
|
||||||
version: 6.4.1
|
version: 6.4.1
|
||||||
resolution: "@react-navigation/stack@npm:6.4.1"
|
resolution: "@react-navigation/stack@npm:6.4.1"
|
||||||
dependencies:
|
dependencies:
|
||||||
|
@ -6916,18 +6916,18 @@ __metadata:
|
||||||
"@notifee/react-native": "npm:^9.1.8"
|
"@notifee/react-native": "npm:^9.1.8"
|
||||||
"@react-native-async-storage/async-storage": "npm:1.23.1"
|
"@react-native-async-storage/async-storage": "npm:1.23.1"
|
||||||
"@react-native-community/cli": "npm:^18.0.0"
|
"@react-native-community/cli": "npm:^18.0.0"
|
||||||
"@react-native-community/netinfo": "npm:^11.3.3"
|
"@react-native-community/netinfo": "npm:^11.4.1"
|
||||||
"@react-native-community/slider": "npm:4.5.5"
|
"@react-native-community/slider": "npm:4.5.5"
|
||||||
"@react-native-firebase/app": "npm:^20.5.0"
|
"@react-native-firebase/app": "npm:^20.5.0"
|
||||||
"@react-native-firebase/messaging": "npm:^20.5.0"
|
"@react-native-firebase/messaging": "npm:^20.5.0"
|
||||||
"@react-native-masked-view/masked-view": "npm:^0.3.0"
|
"@react-native-masked-view/masked-view": "npm:0.3.1"
|
||||||
"@react-native/metro-config": "npm:^0.75.0"
|
"@react-native/metro-config": "npm:^0.75.0"
|
||||||
"@react-navigation/bottom-tabs": "npm:^6.6.1"
|
"@react-navigation/bottom-tabs": "npm:^6.6.1"
|
||||||
"@react-navigation/drawer": "npm:^6.7.2"
|
"@react-navigation/drawer": "npm:^6.7.2"
|
||||||
"@react-navigation/elements": "npm:^1.3.31"
|
"@react-navigation/elements": "npm:^1.3.31"
|
||||||
"@react-navigation/material-top-tabs": "npm:^6.6.14"
|
"@react-navigation/material-top-tabs": "npm:^6.6.14"
|
||||||
"@react-navigation/native": "npm:^6.0.8"
|
"@react-navigation/native": "npm:^6.1.18"
|
||||||
"@react-navigation/stack": "npm:^6.3.21"
|
"@react-navigation/stack": "npm:^6.4.1"
|
||||||
"@sentry/react-native": "npm:~6.10.0"
|
"@sentry/react-native": "npm:~6.10.0"
|
||||||
"@sentry/tracing": "npm:^7.120.3"
|
"@sentry/tracing": "npm:^7.120.3"
|
||||||
"@turf/along": "npm:^7.1.0"
|
"@turf/along": "npm:^7.1.0"
|
||||||
|
|
Loading…
Add table
Reference in a new issue