소스 검색

test crashlytics

wudebin 3 달 전
부모
커밋
93670e4162
4개의 변경된 파일22개의 추가작업 그리고 6개의 파일을 삭제
  1. 2 2
      Strides-SPAPP/android/app/version.properties
  2. 1 1
      Strides-SPAPP/android/build.gradle
  3. 2 2
      Strides-SPAPP/app.json
  4. 17 1
      Strides-SPAPP/app/pages/home/Notify.js

+ 2 - 2
Strides-SPAPP/android/app/version.properties

@@ -1,2 +1,2 @@
-#Thu Mar 05 14:15:00 CST 2026
-VERSION_CODE=837
+#Fri Mar 13 15:29:28 CST 2026
+VERSION_CODE=839

+ 1 - 1
Strides-SPAPP/android/build.gradle

@@ -1,7 +1,7 @@
 // Top-level build file where you can add configuration options common to all sub-projects/modules.
 buildscript {
     ext {
-        versionName = "4.1.1" //★★★★★版本号★★★★★
+        versionName = "4.1.2" //★★★★★版本号★★★★★
         buildToolsVersion = "35.0.1"
         minSdkVersion = 24
         compileSdkVersion = 35

+ 2 - 2
Strides-SPAPP/app.json

@@ -1,8 +1,8 @@
 {
   "name": "Strides",
   "displayName": "ChargEco",
-  "versionCode": 830,
-  "versionName": "V4.1.1",
+  "versionCode": 840,
+  "versionName": "V4.1.2",
   "product": false,
   "debug": true,
   "isWhitelabel": true,

+ 17 - 1
Strides-SPAPP/app/pages/home/Notify.js

@@ -1,5 +1,6 @@
 import React, { Component } from 'react';
-import { View, Text, StyleSheet, Clipboard, Platform } from 'react-native';
+import { View, Text, StyleSheet, Platform } from 'react-native';
+import Clipboard from '@react-native-clipboard/clipboard';
 import Button from '../../components/Button';
 import PushNotification from "react-native-push-notification";
 import Dialog from '../../components/Dialog';
@@ -7,6 +8,7 @@ import apiUpload from '../../api/apiUpload';
 import app from '../../../app.json'
 import utils from '../../utils/utils';
 import Skeleton from '../../components/VbeSkeleton';
+import crashlytics from '@react-native-firebase/crashlytics';
 
 export default class Notify extends Component {
   constructor(props) {
@@ -116,6 +118,13 @@ export default class Notify extends Component {
     }
   }
 
+  async testCrashlytics() {
+    console.log("测试触发崩溃");
+    await crashlytics().setCrashlyticsCollectionEnabled(true);
+    crashlytics().log("Test Crashlytics...");
+    crashlytics().crash();
+  }
+
   render() {
     return (
       <View style={styles.container}>
@@ -153,6 +162,13 @@ export default class Notify extends Component {
             />
           </View>
         }
+        <View style={styles.text}>
+          <Button
+            text='Test Crashlytics'
+            elevation={2}
+            onClick={() => this.testCrashlytics()}
+          />
+        </View>
         <View style={[ui.flex1, ui.flexcc]}>
           <Text style={styles.os}>{Platform.OS}</Text>
         </View>