30
30
import com .google .firebase .appcheck .FirebaseAppCheck ;
31
31
import com .google .firebase .appcheck .FirebaseAppCheck .AppCheckListener ;
32
32
import com .google .firebase .appcheck .debug .DebugAppCheckProviderFactory ;
33
+ import com .google .firebase .appcheck .playintegrity .PlayIntegrityAppCheckProviderFactory ;
33
34
import com .google .firebase .appcheck .safetynet .SafetyNetAppCheckProviderFactory ;
34
35
import com .google .firebase .storage .FirebaseStorage ;
35
36
import com .google .firebase .storage .ListResult ;
@@ -42,6 +43,7 @@ public class MainActivity extends AppCompatActivity {
42
43
private FirebaseAppCheck firebaseAppCheck ;
43
44
private FirebaseStorage firebaseStorage ;
44
45
private AppCheckListener appCheckListener ;
46
+ private Button installPlayIntegrityButton ;
45
47
private Button installSafetyNetButton ;
46
48
private Button installDebugButton ;
47
49
private Button getAppCheckTokenButton ;
@@ -80,6 +82,7 @@ public void onAppCheckTokenChanged(@NonNull AppCheckToken token) {
80
82
}
81
83
82
84
private void initViews () {
85
+ installPlayIntegrityButton = findViewById (R .id .install_play_integrity_app_check_button );
83
86
installSafetyNetButton = findViewById (R .id .install_safety_net_app_check_button );
84
87
installDebugButton = findViewById (R .id .install_debug_app_check_button );
85
88
getAppCheckTokenButton = findViewById (R .id .exchange_app_check_button );
@@ -89,6 +92,17 @@ private void initViews() {
89
92
}
90
93
91
94
private void setOnClickListeners () {
95
+ installPlayIntegrityButton .setOnClickListener (
96
+ new OnClickListener () {
97
+ @ Override
98
+ public void onClick (View v ) {
99
+ firebaseAppCheck .installAppCheckProviderFactory (
100
+ PlayIntegrityAppCheckProviderFactory .getInstance ());
101
+ Log .d (TAG , "Installed PlayIntegrityAppCheckProvider" );
102
+ showToast ("Installed PlayIntegrityAppCheckProvider." );
103
+ }
104
+ });
105
+
92
106
installSafetyNetButton .setOnClickListener (
93
107
new OnClickListener () {
94
108
@ Override
0 commit comments