Add messages to stacktrace

This commit is contained in:
Victor Shcherb 2018-04-02 14:19:06 +02:00
parent f0374526a0
commit 9f12c9deb4
6 changed files with 13 additions and 10 deletions

View file

@ -9,7 +9,7 @@
<meta-data <meta-data
android:name="com.facebook.sdk.ApplicationId" android:name="com.facebook.sdk.ApplicationId"
android:resource="@string/facebook_app_id"/> android:value="fb2057524931189530"/>
<activity <activity
android:name="net.osmand.plus.activities.MapActivity" android:name="net.osmand.plus.activities.MapActivity"
android:theme="@style/FirstSplashScreenFree" android:theme="@style/FirstSplashScreenFree"

View file

@ -8,7 +8,7 @@
tools:replace="android:icon"> tools:replace="android:icon">
<meta-data <meta-data
android:name="com.facebook.sdk.ApplicationId" android:name="com.facebook.sdk.ApplicationId"
android:resource="@string/facebook_custom_app_id"/> android:value="fb131313131043971"/>
<activity <activity
android:name="net.osmand.plus.activities.MapActivity" android:name="net.osmand.plus.activities.MapActivity"
android:theme="@style/FirstSplashScreenCustom" android:theme="@style/FirstSplashScreenCustom"

View file

@ -7,7 +7,7 @@
tools:replace="android:icon"> tools:replace="android:icon">
<meta-data <meta-data
android:name="com.facebook.sdk.ApplicationId" android:name="com.facebook.sdk.ApplicationId"
android:resource="@string/facebook_dev_app_id"/> android:value="fb792288460976727"/>
<activity <activity
android:name="net.osmand.plus.activities.MapActivity" android:name="net.osmand.plus.activities.MapActivity"
android:theme="@style/FirstSplashScreenFreeDev" android:theme="@style/FirstSplashScreenFreeDev"

View file

@ -396,7 +396,7 @@ dependencies {
compile 'com.google.firebase:firebase-messaging:12.0.1' compile 'com.google.firebase:firebase-messaging:12.0.1'
compile 'com.google.firebase:firebase-iid:12.0.1' compile 'com.google.firebase:firebase-iid:12.0.1'
compile 'com.google.firebase:firebase-config:12.0.1' compile 'com.google.firebase:firebase-config:12.0.1'
compile 'com.facebook.android:facebook-android-sdk:[4,5)' compile 'com.facebook.android:facebook-android-sdk:4.31.0'
} }
compile 'com.android.support:multidex:1.0.1' compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:gridlayout-v7:27.1.0' compile 'com.android.support:gridlayout-v7:27.1.0'

View file

@ -5,9 +5,6 @@
<!-- string name="app_version_suffix"></string --> <!-- string name="app_version_suffix"></string -->
<!-- Not translatable --> <!-- Not translatable -->
<string name="facebook_app_id">2057524931189530</string>
<string name="facebook_dev_app_id">792288460976727</string>
<string name="facebook_custom_app_id">131313131043971</string>
<string name="full_version_price">€7,99</string> <string name="full_version_price">€7,99</string>
<string name="osm_live">OsmAnd Live</string> <string name="osm_live">OsmAnd Live</string>
<string name="ga_api_key">UA-28342846-2</string> <string name="ga_api_key">UA-28342846-2</string>

View file

@ -888,12 +888,18 @@ public class OsmandApplication extends MultiDexApplication {
public void initFBEvents() { public void initFBEvents() {
try { try {
if (Version.isGooglePlayEnabled(this) && Version.isFreeVersion(this)) { if (Version.isGooglePlayEnabled(this) && Version.isFreeVersion(this)) {
Class<?> cls = Class.forName("com.facebook.FacebookSdk");
Method ms = cls.getMethod("sdkInitialize", Context.class);
ms.invoke(null, getApplicationContext());
Class<?> cl = Class.forName("com.facebook.appevents.AppEventsLogger"); Class<?> cl = Class.forName("com.facebook.appevents.AppEventsLogger");
Method mm = cl.getMethod("activateApp", Application.class); Method mm = cl.getMethod("activateApp", Application.class);
mm.invoke(null, this); mm.invoke(null, this);
Method mu = cl.getMethod("getUserID");
String uid = (String) mu.invoke(null);
LOG.info("FB token: " + uid);
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); LOG.error(e.getMessage(), e);
} }
} }
@ -909,7 +915,7 @@ public class OsmandApplication extends MultiDexApplication {
log.invoke(inst, defaults); log.invoke(inst, defaults);
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); LOG.error(e.getMessage(), e);
} }
} }
@ -925,7 +931,7 @@ public class OsmandApplication extends MultiDexApplication {
LOG.info("Fbase token: " + firebaseToken); LOG.info("Fbase token: " + firebaseToken);
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); LOG.error(e.getMessage(), e);
} }
} }