From c9ed5593804aaa8891dc9bddace56aa36d2176bf Mon Sep 17 00:00:00 2001 From: mx1700 Date: Sun, 18 Aug 2019 20:55:03 +0800 Subject: [PATCH] =?UTF-8?q?firebase=20=E6=9A=82=E6=97=B6=E5=B1=8F=E8=94=BD?= =?UTF-8?q?=20android?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 6 ++++-- src/page/NotificationPage.js | 10 ++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 68540b0..76d7384 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,7 @@ * @entry */ -import {Alert} from 'react-native'; +import {Alert, Platform} from 'react-native'; import {Navigation} from 'react-native-navigation'; import {Icon, loadIcon} from './src/style/icon'; @@ -91,7 +91,9 @@ function loginByPassword() { Navigation.events().registerAppLaunchedListener(async () => { - firebase.crashlytics().enableCrashlyticsCollection(); + if(Platform.OS === 'ios') { //todo: android会弹出设备不支持 gppgle play 服务,暂时没解决 + firebase.crashlytics().enableCrashlyticsCollection(); + } try { await loadIcon(); diff --git a/src/page/NotificationPage.js b/src/page/NotificationPage.js index c1fec8d..3a87a76 100644 --- a/src/page/NotificationPage.js +++ b/src/page/NotificationPage.js @@ -141,10 +141,12 @@ export default class NotificationPage extends Component { console.log(user, user.email); - firebase.crashlytics().setUserIdentifier(user.id.toString()); - firebase.crashlytics().setUserName(user.name); - //todo:现在用户信息里没有 email - //firebase.crashlytics().setUserEmail(user.email); + if(Platform.OS === 'ios') { //todo: android会弹出设备不支持 gppgle play 服务,暂时没解决 + firebase.crashlytics().setUserIdentifier(user.id.toString()); + firebase.crashlytics().setUserName(user.name); + //todo:现在用户信息里没有 email + //firebase.crashlytics().setUserEmail(user.email); + } }