https://www.bilibili.com/vide...javascript
https://docs.sentry.io/platfo...android
dependencies: sentry: ^3.0.1
// 建立 SentryClient 用於將異常日誌上報給 sentry 平臺 final SentryClient _sentry = new SentryClient( dsn: 'https://xxxxxxxxxx', ); // 是否開發環境 bool get isInDebugMode { return false; // false 開始上傳 sentry } // 上報異常的函數 Future<void> _reportError(dynamic error, dynamic stackTrace) async { print('Caught error: $error'); if (isInDebugMode) { print(stackTrace); } else { final SentryResponse response = await _sentry.captureException( exception: error, stackTrace: stackTrace, ); if (response.isSuccessful) { print('Success! Event ID: ${response.eventId}'); } else { print('Failed to report to Sentry.io: ${response.error}'); } } } Future<Null> main() async { // 捕獲並上報 Flutter 異常 FlutterError.onError = (FlutterErrorDetails details) async { if (isInDebugMode == true) { FlutterError.dumpErrorToConsole(details); } else { Zone.current.handleUncaughtError(details.exception, details.stack); } }; // 捕獲並上報 Dart 異常 runZonedGuarded(() async { await Global.init(); runApp( MultiProvider( providers: [ ChangeNotifierProvider<AppState>.value( value: Global.appState, ), ], child: Consumer<AppState>(builder: (context, appState, _) { if (appState.isGrayFilter) { return ColorFiltered( colorFilter: ColorFilter.mode(Colors.white, BlendMode.color), child: NewsApp(), ); } else { return NewsApp(); } }), ), ); }, (Object error, StackTrace stack) { _reportError(error, stack); }); }
https://docs.sentry.io/platfo...ios
// ADD JCENTER REPOSITORY repositories { jcenter() } // ADD COMPATIBILITY OPTIONS TO BE COMPATIBLE WITH JAVA 1.8 android { compileOptions { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } } // ADD SENTRY ANDROID AS A DEPENDENCY dependencies { // https://github.com/getsentry/sentry-android/releases implementation 'io.sentry:sentry-android:{version}' }
<application android:name="io.flutter.app.FlutterApplication" android:label="貓哥新聞" android:icon="@mipmap/launcher_icon"> ... <!-- sentry --> <meta-data android:name="io.sentry.dsn" android:value="xxxxxxxxxxxxxxxxx" /> </application>
public class CrashHandler implements UncaughtExceptionHandler { @Override public void uncaughtException(Thread t, Throwable e) { Sentry.captureException(e); } }
import io.sentry.core.Sentry class MainActivity: FlutterActivity() { override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { val crashHandler = CrashHandler() Thread.setDefaultUncaughtExceptionHandler(crashHandler) GeneratedPluginRegistrant.registerWith(flutterEngine) } }
https://docs.sentry.io/platfo...git
platform :ios, '8.0' use_frameworks! # This is important target 'YourApp' do pod 'Sentry', :git => 'https://github.com/getsentry/sentry-cocoa.git', :tag => '5.1.2' end
{ SentrySDK.start(options: [ "dsn": "https://xxxxxxxxxxxxxxxxxxx", "debug": true, // Enabled debug when first installing is always helpful "enableAutoSessionTracking": true ]) NSSetUncaughtExceptionHandler { exception in print(exception) SentrySDK.capture(message: exception.description) SentrySDK.capture(exception: exception) } GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) }
https://lanhuapp.com/url/lYuz1
密碼: gSKlgithub
藍湖如今收費了,因此查看標記還請本身上傳 xd 設計稿
商業設計稿文件很差直接分享, 能夠加微信聯繫 ducafecat