Explorar el Código

add ios privacy info file

leon hace 1 año
padre
commit
44a7e0bc6b

+ 6 - 6
ios/PrivacyInfo.xcprivacy

@@ -13,28 +13,28 @@
 			</array>
 		</dict>
 		<dict>
+			<key>NSPrivacyAccessedAPIType</key>
+			<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
 			<key>NSPrivacyAccessedAPITypeReasons</key>
 			<array>
 				<string>0A2A.1</string>
 			</array>
-			<key>NSPrivacyAccessedAPIType</key>
-			<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
 		</dict>
 		<dict>
+			<key>NSPrivacyAccessedAPIType</key>
+			<string>NSPrivacyAccessedAPICategoryDiskSpace</string>
 			<key>NSPrivacyAccessedAPITypeReasons</key>
 			<array>
 				<string>E174.1</string>
 			</array>
-			<key>NSPrivacyAccessedAPIType</key>
-			<string>NSPrivacyAccessedAPICategoryDiskSpace</string>
 		</dict>
 		<dict>
+			<key>NSPrivacyAccessedAPIType</key>
+			<string>NSPrivacyAccessedAPICategorySystemBootTime</string>
 			<key>NSPrivacyAccessedAPITypeReasons</key>
 			<array>
 				<string>35F9.1</string>
 			</array>
-			<key>NSPrivacyAccessedAPIType</key>
-			<string>NSPrivacyAccessedAPICategorySystemBootTime</string>
 		</dict>
 	</array>
 </dict>

+ 1 - 1
ios/hola.xcodeproj/project.pbxproj

@@ -605,7 +605,7 @@
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
 				ENABLE_TESTABILITY = YES;
 				EXCLUDED_ARCHS = "";
-				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
+				"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
 				GCC_C_LANGUAGE_STANDARD = gnu99;
 				GCC_DYNAMIC_NO_PIC = NO;
 				GCC_NO_COMMON_BLOCKS = YES;

+ 0 - 4
ios/hola/hola.entitlements

@@ -4,9 +4,5 @@
 <dict>
 	<key>aps-environment</key>
 	<string>development</string>
-	<key>com.apple.developer.healthkit</key>
-	<true/>
-	<key>com.apple.developer.healthkit.access</key>
-	<array/>
 </dict>
 </plist>

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
ios/main.jsbundle


+ 1 - 1
package.json

@@ -9,7 +9,7 @@
 		"css": "sass"
 	},
 	"scripts": {
-		"build:weapp": "taro build --type weapp --upload",
+		"build:weapp": "taro build --type weapp",
 		"build:swan": "taro build --type swan",
 		"build:alipay": "taro build --type alipay",
 		"build:tt": "taro build --type tt",

+ 0 - 3
pnpm-lock.yaml

@@ -189,9 +189,6 @@ dependencies:
   react-native-haptic-feedback:
     specifier: ^2.2.0
     version: 2.2.0(react-native@0.70.15)
-  react-native-health:
-    specifier: ^1.18.0
-    version: 1.18.0(react-native@0.70.15)
   react-native-linear-gradient:
     specifier: ^2.8.3
     version: 2.8.3(react-native@0.70.15)(react@18.2.0)

+ 18 - 1
src/pages/clock/Clock.tsx

@@ -288,6 +288,8 @@ export default function Page() {
         }
         setTimeout(() => {
             checkVersionUpdate();
+            if (process.env.TARO_ENV == 'rn')
+                uploadPermissions()
         }, 1000)
 
     })
@@ -314,7 +316,7 @@ export default function Page() {
 
     const handleAppStateChange = (nextAppState) => {
         console.log(nextAppState)
-        if (nextAppState!='active'){
+        if (nextAppState != 'active') {
             return
         }
         checkTimeZone()
@@ -370,6 +372,21 @@ export default function Page() {
     function uploadUserClient() {
         var systemInfo = Taro.getSystemInfoSync();
         console.log(systemInfo)
+
+        if (process.env.TARO_ENV == 'rn') {
+            var NativeModules = require('react-native').NativeModules;
+
+            // iOS:
+            var locale = NativeModules.SettingsManager.settings.AppleLocale ||
+                NativeModules.SettingsManager.settings.AppleLanguages[0] // "fr_FR"
+
+            showAlert({
+                title: 'locale',
+                content: JSON.stringify(NativeModules.SettingsManager.settings)
+            })
+            // Android:
+            // locale = NativeModules.I18nManager.localeIdentifier // "fr_FR"
+        }
         var split = new Date().toString().split(' ');
         var timeZoneFormatted = split[split.length - 2];
         var timeZoneId = ''

+ 1 - 0
src/pages/clock/StreakDetail.tsx

@@ -32,6 +32,7 @@ export default function StreakDetail() {
     var router
     if (process.env.TARO_ENV == 'rn') {
         router = useRoute()
+        debugger
     }
     else {
         router = useRouter()

+ 0 - 139
src/pages/clock/demoA.tsx

@@ -1,139 +0,0 @@
-import GradientText from "@/components/basic/GradientText";
-import { View, PickerView, PickerViewColumn, Text } from "@tarojs/components";
-import Taro from "@tarojs/taro";
-import { useEffect, useLayoutEffect, useRef, useState } from "react";
-import { LayoutChangeEvent } from "react-native";
-import AppleHealthKit, {
-    HealthValue,
-    HealthKitPermissions,
-} from 'react-native-health'
-
-/* Permission options */
-const permissions = {
-    permissions: {
-        read: [
-            AppleHealthKit.Constants.Permissions.StepCount,
-            // AppleHealthKit.Constants.Permissions.Steps,
-            // AppleHealthKit.Constants.Permissions.HeartRate,
-            // AppleHealthKit.Constants.Permissions.BloodGlucose,
-            // AppleHealthKit.Constants.Permissions.BloodPressureDiastolic,
-            // AppleHealthKit.Constants.Permissions.BloodPressureSystolic,
-            // AppleHealthKit.Constants.Permissions.ActiveEnergyBurned,
-
-            // AppleHealthKit.Constants.Permissions.AppleStandTime,
-            // AppleHealthKit.Constants.Permissions.BloodType,
-            // AppleHealthKit.Constants.Permissions.BiologicalSex,
-            // AppleHealthKit.Constants.Permissions.BloodGlucose,
-            // AppleHealthKit.Constants.Permissions.FatTotal,
-            // AppleHealthKit.Constants.Permissions.Iron,
-            // AppleHealthKit.Constants.Permissions.StepCount,
-            // AppleHealthKit.Constants.Permissions.VitaminA,
-            // AppleHealthKit.Constants.Permissions.VitaminC,
-            // AppleHealthKit.Constants.Permissions.VitaminD,
-
-            // AppleHealthKit.Constants.Permissions.AllergyRecord,
-            // AppleHealthKit.Constants.Permissions.VitalSignRecord,
-        ],
-        write: [AppleHealthKit.Constants.Permissions.StepCount],
-    },
-} as HealthKitPermissions
-
-export default function DemoA() {
-    const [steps, setSteps] = useState('')
-    useEffect(() => {
-
-    }, [])
-
-    function healthKit() {
-        AppleHealthKit.initHealthKit(permissions, (error: string) => {
-            /* Called after we receive a response from the system */
-
-            if (error) {
-                console.log('[ERROR] Cannot grant permissions!')
-            }
-            console.log(permissions)
-
-            /* Can now read or write to HealthKit */
-
-
-
-
-            // AppleHealthKit.getHeartRateSamples(
-            //     options,
-            //     (callbackError: string, results: HealthValue[]) => {
-            //         /* Samples are now collected from HealthKit */
-            //     },
-            // )
-        })
-    }
-
-    function getAuthStatus() {
-        AppleHealthKit.getAuthStatus(permissions, (err, results) => {
-            console.log(err, results)
-            Taro.showModal({
-                title: '返回原始数据',
-                content: JSON.stringify(results)
-            })
-        })
-        // const authorized = await AppleHealthKit.i
-    }
-
-    function getSteps() {
-        const options = {
-            date: new Date(new Date().getTime()-24*3600*1000).toISOString()
-        }
-        // AppleHealthKit.getDailyStepCountSamples
-        AppleHealthKit.getStepCount(options, (error: string, results: HealthValue) => {
-            if (!error) {
-                setSteps(results.value + '')
-                Taro.showModal({
-                    title: '返回原始数据',
-                    content: JSON.stringify(results)
-                })
-            }
-            console.log(error, results)
-        })
-    }
-
-    function checkAuth() {
-
-    }
-
-    const years = [0, 1, 2, 3, 4, 5]
-    const months = [0, 1, 2, 3, 4, 5]
-    const days = [0, 1, 2, 3, 4, 5]
-
-    return (
-        <View style={{ backgroundColor: 'white', height: 800, width: 375 }} >
-            <Text style={{ color: 'red', fontSize: 50 }}>hello world</Text>
-            <PickerView title="hhhh" itemStyle={{ color: '#000', fonSize: 10 }} indicatorStyle='height: 50px;' style='width: 100%; height: 300px;color:white' value={[0, 1, 2, 3, 4]} onChange={(e) => { }}>
-                <PickerViewColumn style={{ color: '#fff' }}>
-                    {years.map(item => {
-                        return (
-                            <View style={{ color: 'white', opacity: 0, backgroundColor: 'pink' }}>{item}年</View>
-                        );
-                    })}
-                </PickerViewColumn>
-                <PickerViewColumn>
-                    {months.map(item => {
-                        return (
-                            <View>{item}月12日</View>
-                        )
-                    })}
-                </PickerViewColumn>
-                <PickerViewColumn>
-                    {days.map(item => {
-                        return (
-                            <View>{item}日</View>
-                        )
-                    })}
-                </PickerViewColumn>
-            </PickerView>
-            <GradientText style={{ fontSize: 20 }}>Hello world</GradientText>
-            <Text style={{ color: 'red' }} onClick={healthKit}>Health Kit 授权</Text>
-            <Text style={{ color: 'red', margin: 10 }} onClick={getAuthStatus}>Health Kit 获取授权状态</Text>
-            <Text style={{ color: 'red' }} onClick={getSteps}>获取当前步数:<Text>{steps}</Text> </Text>
-
-        </View>
-    );
-}

+ 1 - 1
src/services/http/api.js

@@ -1,4 +1,4 @@
-let online = process.env.TARO_ENV == 'rn' ? false : true;
+let online = process.env.TARO_ENV == 'rn' ? false : false;
 export let baseUrl = online ? 'https://api.fast.liveplus.fun' : 'https://api.fast.dev.liveplus.fun';
 export let APP_VERSION = '1.0.0'
 export let WX_VERSION = ''

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio