This repository was archived by the owner on Oct 9, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +20
-104
lines changed
java/com/example/instabug Expand file tree Collapse file tree 6 files changed +20
-104
lines changed Original file line number Diff line number Diff line change 11apply plugin : ' com.android.application'
2+ // Un-comment after adding google-services.json file
3+ // apply plugin: 'com.google.gms.google-services'
24// apply instbaug APM plugin for capturing network requests
35apply plugin : ' instabug-apm'
46
57android {
6- compileSdkVersion 32
8+ compileSdkVersion 33
79
810 defaultConfig {
911 applicationId " com.example.instabug"
10- minSdkVersion 15
11- targetSdkVersion 32
12+ minSdkVersion 19
13+ targetSdkVersion 33
1214 versionCode 1
1315 versionName " 1.0"
1416 multiDexEnabled true
@@ -51,8 +53,8 @@ dependencies {
5153 implementation " com.google.android.material:material:$rootProject . ext . material "
5254 implementation " androidx.appcompat:appcompat:$rootProject . ext . androidXAppCompat "
5355
54- implementation ' com.google.firebase:firebase-core:16.0.0 '
55- implementation ' com.google.firebase:firebase-messaging:17.0.0 '
56+ implementation ' com.google.firebase:firebase-core:21.1.1 '
57+ implementation ' com.google.firebase:firebase-messaging:23.1.1 '
5658
5759 // TODO add the following 2 lines if you exclude io.reactivex from Instabug
5860 // implementation 'io.reactivex:rxjava:1.0.13'
Original file line number Diff line number Diff line change 6060 android : name =" com.example.instabug.fcm.InstabugInstanceIDListenerService"
6161 android : exported =" false" >
6262 <intent-filter >
63- <action android : name =" com.google.android.gms.iid.InstanceID " />
63+ <action android : name =" com.google.firebase.MESSAGING_EVENT " />
6464 </intent-filter >
6565 </service >
66- <service android : name =" com.example.instabug.fcm.RegistrationIntentService" />
6766 </application >
6867</manifest >
Original file line number Diff line number Diff line change 11package com .example .instabug .fcm ;
22
3- import android . content . Intent ;
3+ import androidx . annotation . NonNull ;
44
5- import com .google .firebase .iid .FirebaseInstanceIdService ;
5+ import com .google .firebase .messaging .FirebaseMessagingService ;
6+ import com .instabug .chat .Replies ;
67
78/**
89 * Created by vezikon on 6/27/16.
910 */
10- public class InstabugInstanceIDListenerService extends FirebaseInstanceIdService {
11-
12- private static final String TAG = "InstabugInstanceIDLS" ;
11+ public class InstabugInstanceIDListenerService extends FirebaseMessagingService {
1312
1413 /**
15- * Called if InstanceID token is updated. This may occur if the security of
16- * the previous token had been compromised. This call is initiated by the
17- * InstanceID provider.
14+ * Called when a new token for the default Firebase project is generated.
15+ * This is invoked after app install when a token is first generated, and again if the token changes.
16+ *
17+ * @param token – The token used for sending messages to this application instance. This token is the same as the one retrieved by FirebaseMessaging.getToken().
1818 */
19- // [START refresh_token]
2019 @ Override
21- public void onTokenRefresh () {
22- // Fetch updated Instance ID token and notify our app's server of any changes (if applicable).
23- Intent intent = new Intent (this , RegistrationIntentService .class );
24- startService (intent );
20+ public void onNewToken (@ NonNull String token ) {
21+ super .onNewToken (token );
22+ Replies .setPushNotificationRegistrationToken (token );
2523 }
26- // [END refresh_token]
2724}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1212
1313import com .example .instabug .BaseActivity ;
1414import com .example .instabug .R ;
15- import com .example .instabug .fcm .RegistrationIntentService ;
1615import com .instabug .bug .BugReporting ;
1716import com .instabug .featuresrequest .FeatureRequests ;
1817import com .instabug .library .Instabug ;
@@ -42,20 +41,12 @@ protected void onCreate(Bundle savedInstanceState) {
4241 //Instabug logs
4342 InstabugLog .d ("MainActivity - Created" );
4443
45- registerFCM ();
46-
4744 Toolbar toolbar = findViewById (R .id .toolbar );
4845 setSupportActionBar (toolbar );
4946
5047 doNetworkRequest ();
5148 }
5249
53- private void registerFCM () {
54- // Start IntentService to register this application with FCM.
55- Intent intent = new Intent (this , RegistrationIntentService .class );
56- startService (intent );
57- }
58-
5950 public void onShowLiveOnboardingMessageClicked (View view ) {
6051 Instabug .showWelcomeMessage (WelcomeMessage .State .LIVE );
6152 }
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ buildscript {
2424 }
2525 dependencies {
2626 classpath ' com.android.tools.build:gradle:4.0.1'
27-
27+ classpath ' com.google.gms:google-services:4.3.2 '
2828 classpath " com.instabug.library:instabug-plugin:$rootProject . ext . instabugSDK "
2929
3030 }
You can’t perform that action at this time.
0 commit comments