Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

library cloud_firestore;


// TODO(Lyokone): remove once we bump Flutter SDK min version to 3.3
// ignore: unnecessary_import
import 'dart:typed_data';

import 'package:cloud_firestore_platform_interface/cloud_firestore_platform_interface.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_core_platform_interface/firebase_core_platform_interface.dart'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.


// TODO(Lyokone): remove once we bump Flutter SDK min version to 3.3
// ignore: unnecessary_import
import 'dart:typed_data';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ android {
// TODO: Since App Check is a beta SDK it's not available in the Firebase Android BoM so we need to specify an exact version here.
implementation 'com.google.firebase:firebase-appcheck-safetynet:16.0.0-beta04'
implementation 'com.google.firebase:firebase-appcheck-debug:16.0.0-beta04'
implementation 'com.google.firebase:firebase-appcheck-playintegrity:16.0.0-beta04'
implementation 'androidx.annotation:annotation:1.1.0'
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.google.firebase.FirebaseApp;
import com.google.firebase.appcheck.AppCheckTokenResult;
import com.google.firebase.appcheck.FirebaseAppCheck;
import com.google.firebase.appcheck.playintegrity.PlayIntegrityAppCheckProviderFactory;
import com.google.firebase.appcheck.safetynet.SafetyNetAppCheckProviderFactory;
import io.flutter.embedding.engine.plugins.FlutterPlugin;
import io.flutter.plugin.common.BinaryMessenger;
Expand Down Expand Up @@ -80,6 +81,8 @@ private Task<Void> activate(Map<String, Object> arguments) {
FirebaseAppCheck firebaseAppCheck = getAppCheck(arguments);
firebaseAppCheck.installAppCheckProviderFactory(
SafetyNetAppCheckProviderFactory.getInstance());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like SafetyNet should be behind a flag. SafetyNet is eventually being deprecated and the Play Console is warning folks about SafetyNet being present in their APKs and AABs. I think PlayIntegrityAPI should be the default choice and then optionally have a flag that can switch over to safetyNet, but not have both appcheck providers active at the same time since both provide attestation.

firebaseAppCheck.installAppCheckProviderFactory(
PlayIntegrityAppCheckProviderFactory.getInstance());
taskCompletionSource.setResult(null);
} catch (Exception e) {
taskCompletionSource.setException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ - (void)messaging:(nonnull FIRMessaging *)messaging
if ([[GULAppDelegateSwizzler sharedApplication].delegate
respondsToSelector:messaging_didReceiveRegistrationTokenSelector]) {
void (*usersDidReceiveRegistrationTokenIMP)(id, SEL, FIRMessaging *, NSString *) =
(typeof(usersDidReceiveRegistrationTokenIMP)) & objc_msgSend;
(typeof(usersDidReceiveRegistrationTokenIMP))&objc_msgSend;
usersDidReceiveRegistrationTokenIMP([GULAppDelegateSwizzler sharedApplication].delegate,
messaging_didReceiveRegistrationTokenSelector, messaging,
fcmToken);
Expand Down