This commit is contained in:
chenxi 2023-06-15 21:41:59 +08:00
parent daddedf98f
commit 4f7de1fd76
5 changed files with 118 additions and 72 deletions

View File

@ -8,8 +8,8 @@ buildscript {
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:4.0.1' classpath 'com.android.tools.build:gradle:4.0.1'
// classpath 'com.google.gms:google-services:4.3.13' classpath 'com.google.gms:google-services:4.3.13'
// classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.1' classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.1'
} }
} }

View File

@ -44,9 +44,9 @@ dependencies {
implementation "com.android.billingclient:billing:5.0.0" implementation "com.android.billingclient:billing:5.0.0"
// firebase // firebase
// implementation 'com.google.firebase:firebase-analytics:21.1.0' implementation 'com.google.firebase:firebase-analytics:21.1.0'
// implementation 'com.google.firebase:firebase-crashlytics:18.2.12' implementation 'com.google.firebase:firebase-crashlytics:18.2.12'
// implementation 'com.google.firebase:firebase-messaging:23.0.8' implementation 'com.google.firebase:firebase-messaging:23.0.8'
// Android Resolver Dependencies Start // Android Resolver Dependencies Start
implementation 'com.adcolony:sdk:4.8.0' // Assets/IronSource/Editor/ISAdColonyAdapterDependencies.xml:8 implementation 'com.adcolony:sdk:4.8.0' // Assets/IronSource/Editor/ISAdColonyAdapterDependencies.xml:8

View File

@ -0,0 +1,47 @@
{
"project_info": {
"project_number": "1008416471093",
"project_id": "knights-combo",
"storage_bucket": "knights-combo.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:1008416471093:android:121c54160b7045e499d97c",
"android_client_info": {
"package_name": "com.combo.heroes.puzzle.rpg"
}
},
"oauth_client": [
{
"client_id": "1008416471093-e1a8gso0q6mpangmi7lltjilfmqeqp6u.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.combo.heroes.puzzle.rpg",
"certificate_hash": "3d9f0e5ebcb906418204e1a41cd40968a36c71cc"
}
},
{
"client_id": "1008416471093-e47s7u8a7v31ulr2f7e9j1mdm9llepum.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDtkUzjjkNiAZszdepIDIYss0ioNNbjncA"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "1008416471093-e47s7u8a7v31ulr2f7e9j1mdm9llepum.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}

View File

@ -1,50 +1,50 @@
// package com.juzu.dz.third; package com.juzu.dz.third;
// import android.util.Log; import android.util.Log;
// import android.widget.Toast; import android.widget.Toast;
// import androidx.annotation.NonNull; import androidx.annotation.NonNull;
// import androidx.core.app.NotificationCompat; import androidx.core.app.NotificationCompat;
// import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.OnCompleteListener;
// import com.google.android.gms.tasks.Task; import com.google.android.gms.tasks.Task;
// import com.google.firebase.messaging.FirebaseMessaging; import com.google.firebase.messaging.FirebaseMessaging;
// import com.google.firebase.messaging.FirebaseMessagingService; import com.google.firebase.messaging.FirebaseMessagingService;
// import com.google.firebase.messaging.RemoteMessage; import com.google.firebase.messaging.RemoteMessage;
// public class BFFirebaseMessagingService extends FirebaseMessagingService { public class BFFirebaseMessagingService extends FirebaseMessagingService {
// /** /**
// * There are two scenarios when onNewToken is called: * There are two scenarios when onNewToken is called:
// * 1) When a new token is generated on initial app startup * 1) When a new token is generated on initial app startup
// * 2) Whenever an existing token is changed * 2) Whenever an existing token is changed
// * Under #2, there are three scenarios when the existing token is changed: * Under #2, there are three scenarios when the existing token is changed:
// * A) App is restored to a new device * A) App is restored to a new device
// * B) User uninstalls/reinstalls the app * B) User uninstalls/reinstalls the app
// * C) User clears app data * C) User clears app data
// */ */
// @Override @Override
// public void onMessageReceived(RemoteMessage remoteMessage) { public void onMessageReceived(RemoteMessage remoteMessage) {
// Log.d("TAG", "From: " + remoteMessage.getFrom()); Log.d("TAG", "From: " + remoteMessage.getFrom());
// // Check if message contains a data payload. // Check if message contains a data payload.
// if (remoteMessage.getData().size() > 0) { if (remoteMessage.getData().size() > 0) {
// Log.d("TAG", "Message data payload: " + remoteMessage.getData()); Log.d("TAG", "Message data payload: " + remoteMessage.getData());
// } }
// // Check if message contains a notification payload. // Check if message contains a notification payload.
// if (remoteMessage.getNotification() != null) { if (remoteMessage.getNotification() != null) {
// Log.d("TAG", "Message Notification Body: " + remoteMessage.getNotification().getBody()); Log.d("TAG", "Message Notification Body: " + remoteMessage.getNotification().getBody());
// } }
// } }
// @Override @Override
// public void onNewToken(String token) { public void onNewToken(String token) {
// Log.d("", "Refreshed token: " + token); Log.d("", "Refreshed token: " + token);
// sendRegistrationToServer(token); sendRegistrationToServer(token);
// } }
// private void sendRegistrationToServer(String token) { private void sendRegistrationToServer(String token) {
// // TODO: Implement this method to send token to your app server. // TODO: Implement this method to send token to your app server.
// } }
// } }

View File

@ -10,8 +10,8 @@ import androidx.annotation.NonNull;
import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task; import com.google.android.gms.tasks.Task;
// import com.google.firebase.messaging.FirebaseMessaging; // import com.google.firebase.messaging.FirebaseMessaging;
// import com.google.firebase.analytics.FirebaseAnalytics; import com.google.firebase.analytics.FirebaseAnalytics;
//import com.google.firebase.crashlytics.FirebaseCrashlytics; // import com.google.firebase.crashlytics.FirebaseCrashlytics;
import com.juzu.dz.message.BFMessage; import com.juzu.dz.message.BFMessage;
import com.unity3d.player.UnityPlayer; import com.unity3d.player.UnityPlayer;
@ -27,12 +27,12 @@ public class GooglePlugin {
private static GoogleBilling mGoogleBilling = null; private static GoogleBilling mGoogleBilling = null;
// private static GoogleAdmobRewardedVideo mGoogleAdmobRewardedVideo = null; // private static GoogleAdmobRewardedVideo mGoogleAdmobRewardedVideo = null;
private static Activity _activity; private static Activity _activity;
// public static FirebaseAnalytics mFirebaseAnalytics; public static FirebaseAnalytics mFirebaseAnalytics;
// private FirebaseCrashlytics mFirebaseCrashlytics; // private FirebaseCrashlytics mFirebaseCrashlytics;
public static void init(Activity activity){ public static void init(Activity activity){
_activity = activity; _activity = activity;
// mFirebaseAnalytics = FirebaseAnalytics.getInstance(_activity); mFirebaseAnalytics = FirebaseAnalytics.getInstance(_activity);
} }
public static void initLogin() public static void initLogin()
@ -217,34 +217,34 @@ public class GooglePlugin {
// log event // log event
public static void logEvent(String eventName, String data) throws JSONException { public static void logEvent(String eventName, String data) throws JSONException {
Log.w("", "logEvent"); Log.w("", "logEvent");
// if (mFirebaseAnalytics == null) { if (mFirebaseAnalytics == null) {
// return; return;
// } }
// JSONObject properties = new JSONObject(data); JSONObject properties = new JSONObject(data);
// Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
// Iterator iter = properties.keys(); Iterator iter = properties.keys();
// while (iter.hasNext()) { while (iter.hasNext()) {
// String key = (String) iter.next(); String key = (String) iter.next();
// Object value = properties.get(key); Object value = properties.get(key);
// setBundleValue(bundle, key, value); setBundleValue(bundle, key, value);
// } }
// mFirebaseAnalytics.logEvent(eventName, bundle); mFirebaseAnalytics.logEvent(eventName, bundle);
} }
public static void logEventBundle(String eventName, Bundle bundle){ public static void logEventBundle(String eventName, Bundle bundle){
Log.w("", "logEvent"); Log.w("", "logEvent");
// if (mFirebaseAnalytics == null) { if (mFirebaseAnalytics == null) {
// return; return;
// } }
// mFirebaseAnalytics.logEvent(eventName, bundle); mFirebaseAnalytics.logEvent(eventName, bundle);
} }
// log crash // log crash
public static void logCrash(String key, String stack) { public static void logCrash(String key, String stack) {
// this.mFirebaseCrashlytics = FirebaseCrashlytics.getInstance(); // this.mFirebaseCrashlytics = FirebaseCrashlytics.getInstance();
// if (this.mFirebaseCrashlytics == null) // if (this.mFirebaseCrashlytics == null)
// return; // return;
// this.mFirebaseCrashlytics.setCustomKey(key, stack); // this.mFirebaseCrashlytics.setCustomKey(key, stack);
} }
// set bundle to type // set bundle to type
@ -284,5 +284,4 @@ public class GooglePlugin {
// mGoogleAdmobRewardedVideo.setAdPlacement(placement); // mGoogleAdmobRewardedVideo.setAdPlacement(placement);
// } // }
} }
} }