File tree 6 files changed +20
-104
lines changed
java/com/example/instabug
6 files changed +20
-104
lines changed Original file line number Diff line number Diff line change 1
1
apply plugin : ' com.android.application'
2
+ // Un-comment after adding google-services.json file
3
+ // apply plugin: 'com.google.gms.google-services'
2
4
// apply instbaug APM plugin for capturing network requests
3
5
apply plugin : ' instabug-apm'
4
6
5
7
android {
6
- compileSdkVersion 32
8
+ compileSdkVersion 33
7
9
8
10
defaultConfig {
9
11
applicationId " com.example.instabug"
10
- minSdkVersion 15
11
- targetSdkVersion 32
12
+ minSdkVersion 19
13
+ targetSdkVersion 33
12
14
versionCode 1
13
15
versionName " 1.0"
14
16
multiDexEnabled true
@@ -51,8 +53,8 @@ dependencies {
51
53
implementation " com.google.android.material:material:$rootProject . ext . material "
52
54
implementation " androidx.appcompat:appcompat:$rootProject . ext . androidXAppCompat "
53
55
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 '
56
58
57
59
// TODO add the following 2 lines if you exclude io.reactivex from Instabug
58
60
// implementation 'io.reactivex:rxjava:1.0.13'
Original file line number Diff line number Diff line change 60
60
android : name =" com.example.instabug.fcm.InstabugInstanceIDListenerService"
61
61
android : exported =" false" >
62
62
<intent-filter >
63
- <action android : name =" com.google.android.gms.iid.InstanceID " />
63
+ <action android : name =" com.google.firebase.MESSAGING_EVENT " />
64
64
</intent-filter >
65
65
</service >
66
- <service android : name =" com.example.instabug.fcm.RegistrationIntentService" />
67
66
</application >
68
67
</manifest >
Original file line number Diff line number Diff line change 1
1
package com .example .instabug .fcm ;
2
2
3
- import android . content . Intent ;
3
+ import androidx . annotation . NonNull ;
4
4
5
- import com .google .firebase .iid .FirebaseInstanceIdService ;
5
+ import com .google .firebase .messaging .FirebaseMessagingService ;
6
+ import com .instabug .chat .Replies ;
6
7
7
8
/**
8
9
* Created by vezikon on 6/27/16.
9
10
*/
10
- public class InstabugInstanceIDListenerService extends FirebaseInstanceIdService {
11
-
12
- private static final String TAG = "InstabugInstanceIDLS" ;
11
+ public class InstabugInstanceIDListenerService extends FirebaseMessagingService {
13
12
14
13
/**
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().
18
18
*/
19
- // [START refresh_token]
20
19
@ 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 );
25
23
}
26
- // [END refresh_token]
27
24
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 12
12
13
13
import com .example .instabug .BaseActivity ;
14
14
import com .example .instabug .R ;
15
- import com .example .instabug .fcm .RegistrationIntentService ;
16
15
import com .instabug .bug .BugReporting ;
17
16
import com .instabug .featuresrequest .FeatureRequests ;
18
17
import com .instabug .library .Instabug ;
@@ -42,20 +41,12 @@ protected void onCreate(Bundle savedInstanceState) {
42
41
//Instabug logs
43
42
InstabugLog .d ("MainActivity - Created" );
44
43
45
- registerFCM ();
46
-
47
44
Toolbar toolbar = findViewById (R .id .toolbar );
48
45
setSupportActionBar (toolbar );
49
46
50
47
doNetworkRequest ();
51
48
}
52
49
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
-
59
50
public void onShowLiveOnboardingMessageClicked (View view ) {
60
51
Instabug .showWelcomeMessage (WelcomeMessage .State .LIVE );
61
52
}
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ buildscript {
24
24
}
25
25
dependencies {
26
26
classpath ' com.android.tools.build:gradle:4.0.1'
27
-
27
+ classpath ' com.google.gms:google-services:4.3.2 '
28
28
classpath " com.instabug.library:instabug-plugin:$rootProject . ext . instabugSDK "
29
29
30
30
}
You can’t perform that action at this time.
0 commit comments