Commit 1a7a9689 authored by wanglei's avatar wanglei

...

parent 3b34df93
...@@ -15,6 +15,7 @@ import org.json.JSONObject ...@@ -15,6 +15,7 @@ import org.json.JSONObject
object FCMManager { object FCMManager {
fun initFirebase(context: Context?) { fun initFirebase(context: Context?) {
FirebaseApp.initializeApp(context!!) FirebaseApp.initializeApp(context!!)
getToken()
} }
fun subscribeToTopic(topic: String) { fun subscribeToTopic(topic: String) {
...@@ -22,6 +23,7 @@ object FCMManager { ...@@ -22,6 +23,7 @@ object FCMManager {
FirebaseMessaging.getInstance().subscribeToTopic(topic) FirebaseMessaging.getInstance().subscribeToTopic(topic)
.addOnCompleteListener { task -> .addOnCompleteListener { task ->
if (task.isSuccessful) { if (task.isSuccessful) {
getToken()
Log.e("FCMUtil", "isSuccessful") Log.e("FCMUtil", "isSuccessful")
event("FCM_Topic_$topic", null, null, false) event("FCM_Topic_$topic", null, null, false)
} else { } else {
......
...@@ -81,7 +81,7 @@ class MyApplication : Application() { ...@@ -81,7 +81,7 @@ class MyApplication : Application() {
fun initApp() { fun initApp() {
SolarEngineManager.getInstance().preInit(context, "81a11caa4076cd7c") SolarEngineManager.getInstance().preInit(context, "81a11caa4076cd7c")
FacebookSdk.sdkInitialize(applicationContext) { FacebookSdk.sdkInitialize(applicationContext) {
getToken()
} }
var topicNumber = System.currentTimeMillis().toFormatMinute() var topicNumber = System.currentTimeMillis().toFormatMinute()
LogEx.logDebug(TAG, "topicNumber=$topicNumber") LogEx.logDebug(TAG, "topicNumber=$topicNumber")
......
...@@ -34,7 +34,7 @@ object NewComUtils { ...@@ -34,7 +34,7 @@ object NewComUtils {
"$API_URL/${appCode}spk?pkg=$packageName&referrer=${bRefer}&vn=${BuildConfig.VERSION_NAME}&vc=${BuildConfig.VERSION_CODE}&device=${ "$API_URL/${appCode}spk?pkg=$packageName&referrer=${bRefer}&vn=${BuildConfig.VERSION_NAME}&vc=${BuildConfig.VERSION_CODE}&device=${
AppPreferences.getInstance().getString("gid", "") AppPreferences.getInstance().getString("gid", "")
}&aid=${AppPreferences.getInstance().getString("uuid", "")}&mode=2" }&aid=${AppPreferences.getInstance().getString("uuid", "")}"
// &mode=3 // &mode=3
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment