Removed firebase dependencies.

M committed Aug 16, 2021 at 17:44 UTC 89569a10c7def0af6424610b91494f2d4bb6789d
10 files changed +4 -212
android/app/build.gradle
-6
@@ -24,10 +24,6 @@ if (flutterVersionName == null) {
24 apply plugin: 'com.android.application'
25 apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
26
27 -if (file("./google-services.json").exists()) {
28 - apply plugin: 'com.google.gms.google-services'
29 -}
30 -
27 def keystoreProperties = new Properties()
28 def keystorePropertiesFile = rootProject.file('key.properties')
29 if (keystorePropertiesFile.exists()) {
@@ -89,6 +85,4 @@ dependencies {
85 androidTestImplementation 'androidx.test:runner:1.3.0'
86 androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
87 implementation 'com.unstoppabledomains:resolution:3.0.0'
92 - implementation 'com.google.firebase:firebase-core:19.0.0'
93 - implementation 'com.google.firebase:firebase-messaging:19.0.0'
88 }
android/app/src/main/java/com/cakewallet/cake_wallet/Application.java
+1 -11
@@ -4,18 +4,8 @@ import io.flutter.app.FlutterApplication;
4 import io.flutter.plugin.common.PluginRegistry;
5 import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback;
6 import io.flutter.plugins.GeneratedPluginRegistrant;
7 -import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService;
8 -import io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin;
7
8 public class Application extends FlutterApplication implements PluginRegistrantCallback {
9 @Override
12 - public void onCreate() {
13 - super.onCreate();
14 - FlutterFirebaseMessagingService.setPluginRegistrant(this);
15 - }
16 -
17 - @Override
18 - public void registerWith(PluginRegistry registry) {
19 - FirebaseMessagingPlugin.registerWith(registry.registrarFor("io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin"));
20 - }
10 + public void registerWith(PluginRegistry registry) {}
11 }
\ No newline at end of file
ios/Podfile
-1
@@ -37,7 +37,6 @@ target 'Runner' do
37 # Cake Wallet (Legacy)
38 pod 'CryptoSwift'
39 pod 'UnstoppableDomainsResolution', '~> 2.0.1'
40 - pod 'Firebase/Messaging', '6.33.0'
40 end
41
42 post_install do |installer|
ios/Podfile.lock
+1 -98
@@ -63,84 +63,18 @@ PODS:
63 - file_picker (0.0.1):
64 - DKImagePickerController/PhotoGallery
65 - Flutter
66 - - Firebase/CoreOnly (6.33.0):
67 - - FirebaseCore (= 6.10.3)
68 - - Firebase/Messaging (6.33.0):
69 - - Firebase/CoreOnly
70 - - FirebaseMessaging (~> 4.7.0)
71 - - firebase_core (0.5.3):
72 - - Firebase/CoreOnly (~> 6.33.0)
73 - - Flutter
74 - - firebase_messaging (7.0.3):
75 - - Firebase/CoreOnly (~> 6.33.0)
76 - - Firebase/Messaging (~> 6.33.0)
77 - - firebase_core
78 - - Flutter
79 - - FirebaseCore (6.10.3):
80 - - FirebaseCoreDiagnostics (~> 1.6)
81 - - GoogleUtilities/Environment (~> 6.7)
82 - - GoogleUtilities/Logger (~> 6.7)
83 - - FirebaseCoreDiagnostics (1.7.0):
84 - - GoogleDataTransport (~> 7.4)
85 - - GoogleUtilities/Environment (~> 6.7)
86 - - GoogleUtilities/Logger (~> 6.7)
87 - - nanopb (~> 1.30906.0)
88 - - FirebaseInstallations (1.7.0):
89 - - FirebaseCore (~> 6.10)
90 - - GoogleUtilities/Environment (~> 6.7)
91 - - GoogleUtilities/UserDefaults (~> 6.7)
92 - - PromisesObjC (~> 1.2)
93 - - FirebaseInstanceID (4.8.0):
94 - - FirebaseCore (~> 6.10)
95 - - FirebaseInstallations (~> 1.6)
96 - - GoogleUtilities/Environment (~> 6.7)
97 - - GoogleUtilities/UserDefaults (~> 6.7)
98 - - FirebaseMessaging (4.7.1):
99 - - FirebaseCore (~> 6.10)
100 - - FirebaseInstanceID (~> 4.7)
101 - - GoogleUtilities/AppDelegateSwizzler (~> 6.7)
102 - - GoogleUtilities/Environment (~> 6.7)
103 - - GoogleUtilities/Reachability (~> 6.7)
104 - - GoogleUtilities/UserDefaults (~> 6.7)
105 - - Protobuf (>= 3.9.2, ~> 3.9)
66 - Flutter (1.0.0)
67 - flutter_secure_storage (3.3.1):
68 - Flutter
109 - - GoogleDataTransport (7.5.1):
110 - - nanopb (~> 1.30906.0)
111 - - GoogleUtilities/AppDelegateSwizzler (6.7.2):
112 - - GoogleUtilities/Environment
113 - - GoogleUtilities/Logger
114 - - GoogleUtilities/Network
115 - - GoogleUtilities/Environment (6.7.2):
116 - - PromisesObjC (~> 1.2)
117 - - GoogleUtilities/Logger (6.7.2):
118 - - GoogleUtilities/Environment
119 - - GoogleUtilities/Network (6.7.2):
120 - - GoogleUtilities/Logger
121 - - "GoogleUtilities/NSData+zlib"
122 - - GoogleUtilities/Reachability
123 - - "GoogleUtilities/NSData+zlib (6.7.2)"
124 - - GoogleUtilities/Reachability (6.7.2):
125 - - GoogleUtilities/Logger
126 - - GoogleUtilities/UserDefaults (6.7.2):
127 - - GoogleUtilities/Logger
69 - local_auth (0.0.1):
70 - Flutter
71 - MTBBarcodeScanner (5.0.11)
131 - - nanopb (1.30906.0):
132 - - nanopb/decode (= 1.30906.0)
133 - - nanopb/encode (= 1.30906.0)
134 - - nanopb/decode (1.30906.0)
135 - - nanopb/encode (1.30906.0)
72 - package_info (0.0.1):
73 - Flutter
74 - path_provider (0.0.1):
75 - Flutter
76 - "permission_handler (5.1.0+2)":
77 - Flutter
142 - - PromisesObjC (1.2.12)
143 - - Protobuf (3.17.0)
78 - Reachability (3.2)
79 - SDWebImage (5.9.1):
80 - SDWebImage/Core (= 5.9.1)
@@ -167,9 +101,6 @@ DEPENDENCIES:
101 - devicelocale (from `.symlinks/plugins/devicelocale/ios`)
102 - esys_flutter_share (from `.symlinks/plugins/esys_flutter_share/ios`)
103 - file_picker (from `.symlinks/plugins/file_picker/ios`)
170 - - Firebase/Messaging (= 6.33.0)
171 - - firebase_core (from `.symlinks/plugins/firebase_core/ios`)
172 - - firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`)
104 - Flutter (from `Flutter`)
105 - flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
106 - local_auth (from `.symlinks/plugins/local_auth/ios`)
@@ -188,18 +119,7 @@ SPEC REPOS:
119 - CryptoSwift
120 - DKImagePickerController
121 - DKPhotoGallery
191 - - Firebase
192 - - FirebaseCore
193 - - FirebaseCoreDiagnostics
194 - - FirebaseInstallations
195 - - FirebaseInstanceID
196 - - FirebaseMessaging
197 - - GoogleDataTransport
198 - - GoogleUtilities
122 - MTBBarcodeScanner
200 - - nanopb
201 - - PromisesObjC
202 - - Protobuf
123 - Reachability
124 - SDWebImage
125 - SwiftProtobuf
@@ -219,10 +139,6 @@ EXTERNAL SOURCES:
139 :path: ".symlinks/plugins/esys_flutter_share/ios"
140 file_picker:
141 :path: ".symlinks/plugins/file_picker/ios"
222 - firebase_core:
223 - :path: ".symlinks/plugins/firebase_core/ios"
224 - firebase_messaging:
225 - :path: ".symlinks/plugins/firebase_messaging/ios"
142 Flutter:
143 :path: Flutter
144 flutter_secure_storage:
@@ -255,26 +171,13 @@ SPEC CHECKSUMS:
171 DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
172 esys_flutter_share: 403498dab005b36ce1f8d7aff377e81f0621b0b4
173 file_picker: 3e6c3790de664ccf9b882732d9db5eaf6b8d4eb1
258 - Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5
259 - firebase_core: 5d6a02f3d85acd5f8321c2d6d62877626a670659
260 - firebase_messaging: 0aea2cd5885b65e19ede58ee3507f485c992cc75
261 - FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd
262 - FirebaseCoreDiagnostics: 770ac5958e1372ce67959ae4b4f31d8e127c3ac1
263 - FirebaseInstallations: 466c7b4d1f58fe16707693091da253726a731ed2
264 - FirebaseInstanceID: bd3ffc24367f901a43c063b36c640b345a4a5dd1
265 - FirebaseMessaging: 5eca4ef173de76253352511aafef774caa1cba2a
174 Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
175 flutter_secure_storage: 7953c38a04c3fdbb00571bcd87d8e3b5ceb9daec
268 - GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833
269 - GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3
176 local_auth: 25938960984c3a7f6e3253e3f8d962fdd16852bd
177 MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
272 - nanopb: 59317e09cf1f1a0af72f12af412d54edf52603fc
178 package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
179 path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
180 permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0
276 - PromisesObjC: 3113f7f76903778cf4a0586bd1ab89329a0b7b97
277 - Protobuf: 7327d4444215b5f18e560a97f879ff5503c4581c
181 Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
182 SDWebImage: a990c053fff71e388a10f3357edb0be17929c9c5
183 share: 0b2c3e82132f5888bccca3351c504d0003b3b410
@@ -285,6 +188,6 @@ SPEC CHECKSUMS:
188 url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
189 webview_flutter: 9f491a9b5a66f2573946a389b2677987b0ff8c0b
190
288 -PODFILE CHECKSUM: 2e3a44b4309d141b9a3b43acf609feb2beb43d9b
191 +PODFILE CHECKSUM: bc2591d23316907c9c90ca1cd2fce063fd866508
192
193 COCOAPODS: 1.10.2
ios/Runner.xcodeproj/project.pbxproj
-4
@@ -7,7 +7,6 @@
7 objects = {
8
9 /* Begin PBXBuildFile section */
10 - 0C37B8B926678E9100C6E5A9 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 0C37B8B826678E9100C6E5A9 /* GoogleService-Info.plist */; };
10 0C44A71A2518EF8000B570ED /* decrypt.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C44A7192518EF8000B570ED /* decrypt.swift */; };
11 0C9D68C9264854B60011B691 /* secRandom.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C9D68C8264854B60011B691 /* secRandom.swift */; };
12 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
@@ -20,7 +19,6 @@
19 /* End PBXBuildFile section */
20
21 /* Begin PBXFileReference section */
23 - 0C37B8B826678E9100C6E5A9 /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "Runner/GoogleService-Info.plist"; sourceTree = "<group>"; };
22 0C400E0F25B21ABB0025E469 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; };
23 0C44A7192518EF8000B570ED /* decrypt.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = decrypt.swift; sourceTree = "<group>"; };
24 0C9986A3251A932F00D566FD /* CryptoSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = CryptoSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -98,7 +96,6 @@
96 97C146E51CF9000F007C117D = {
97 isa = PBXGroup;
98 children = (
101 - 0C37B8B826678E9100C6E5A9 /* GoogleService-Info.plist */,
99 0C44A7182518EF4A00B570ED /* CakeWallet */,
100 9740EEB11CF90186004384FC /* Flutter */,
101 97C146F01CF9000F007C117D /* Runner */,
@@ -194,7 +191,6 @@
191 isa = PBXResourcesBuildPhase;
192 buildActionMask = 2147483647;
193 files = (
197 - 0C37B8B926678E9100C6E5A9 /* GoogleService-Info.plist in Resources */,
194 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
195 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
196 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
lib/di.dart
+1 -6
@@ -119,7 +119,6 @@ import 'package:cake_wallet/store/templates/exchange_template_store.dart';
119 import 'package:cake_wallet/entities/template.dart';
120 import 'package:cake_wallet/exchange/exchange_template.dart';
121 import 'package:cake_wallet/.secrets.g.dart' as secrets;
122 -import 'package:cake_wallet/entities/push_notifications_service.dart';
122
123 final getIt = GetIt.instance;
124
@@ -243,9 +242,6 @@ Future setup(
242 settingsStore: getIt.get<SettingsStore>(),
243 fiatConvertationStore: getIt.get<FiatConversionStore>()));
244
246 -
247 - getIt.registerFactory(() => PushNotificationsService());
248 -
245 getIt.registerFactory(() => DashboardViewModel(
246 balanceViewModel: getIt.get<BalanceViewModel>(),
247 appStore: getIt.get<AppStore>(),
@@ -253,8 +249,7 @@ Future setup(
249 tradeFilterStore: getIt.get<TradeFilterStore>(),
250 transactionFilterStore: getIt.get<TransactionFilterStore>(),
251 settingsStore: settingsStore,
256 - ordersStore: getIt.get<OrdersStore>(),
257 - pushNotificationsService: getIt.get<PushNotificationsService>()));
252 + ordersStore: getIt.get<OrdersStore>()));
253
254 getIt.registerFactory<AuthService>(() => AuthService(
255 secureStorage: getIt.get<FlutterSecureStorage>(),
lib/entities/push_notifications_service.dart deleted
-49
@@ -1,49 +0,0 @@
1 -import 'dart:io';
2 -import 'package:cake_wallet/main.dart';
3 -import 'package:cake_wallet/utils/show_bar.dart';
4 -import 'package:firebase_messaging/firebase_messaging.dart';
5 -
6 -class PushNotificationsService {
7 - PushNotificationsService._();
8 -
9 - factory PushNotificationsService() => _instance;
10 -
11 - static final PushNotificationsService _instance = PushNotificationsService._();
12 - static Future<dynamic> _onBackgroundMessage(Map<String, dynamic> message) async {}
13 - static Future<void> _showNotification(Map<String, dynamic> message) async {
14 - Map<dynamic, dynamic> alert = <dynamic, dynamic>{};
15 - String msg = '';
16 - String title = '';
17 -
18 - if (Platform.isIOS) {
19 - alert = message['aps']['alert'] as Map<dynamic, dynamic> ?? <dynamic, dynamic>{};
20 - msg = alert['body'] as String ?? '';
21 - title = alert['title'] as String ?? '';
22 - }
23 -
24 - if (Platform.isAndroid) {
25 - msg = message['notification']['body'] as String ?? '';
26 - title = message['notification']['title'] as String ?? '';
27 - }
28 -
29 - await showBar<void>(navigatorKey.currentContext, msg, titleText: title, duration: null);
30 - }
31 -
32 - final _firebaseMessaging = FirebaseMessaging();
33 - bool _initialized = false;
34 -
35 - Future<void> init() async {
36 - if (_initialized) {
37 - return;
38 - }
39 -
40 - _firebaseMessaging.requestNotificationPermissions();
41 - _firebaseMessaging.configure(
42 - onMessage: (message) async => _showNotification(message),
43 - onLaunch: (message) async => _showNotification(message),
44 - onResume: (message) async => _showNotification(message),
45 - onBackgroundMessage: _onBackgroundMessage);
46 -
47 - _initialized = true;
48 - }
49 -}
\ No newline at end of file
lib/view_model/dashboard/dashboard_view_model.dart
+1 -8
@@ -1,6 +1,5 @@
1 import 'package:cake_wallet/core/transaction_history.dart';
2 import 'package:cake_wallet/entities/balance.dart';
3 -import 'package:cake_wallet/entities/push_notifications_service.dart';
3 import 'package:cake_wallet/buy/order.dart';
4 import 'package:cake_wallet/entities/transaction_history.dart';
5 import 'package:cake_wallet/exchange/trade_state.dart';
@@ -47,9 +46,7 @@ abstract class DashboardViewModelBase with Store {
46 this.tradeFilterStore,
47 this.transactionFilterStore,
48 this.settingsStore,
50 - this.ordersStore,
51 - PushNotificationsService pushNotificationsService}) {
52 - _pushNotificationsService = pushNotificationsService;
49 + this.ordersStore}) {
50 filterItems = {
51 S.current.transactions: [
52 FilterItem(
@@ -136,8 +133,6 @@ abstract class DashboardViewModelBase with Store {
133
134 return true;
135 });
139 -
140 - Future.delayed(Duration(seconds: 2), () => _pushNotificationsService.init());
136 }
137
138 @observable
@@ -225,8 +220,6 @@ abstract class DashboardViewModelBase with Store {
220
221 bool get isBuyEnabled => settingsStore.isBitcoinBuyEnabled;
222
228 - PushNotificationsService _pushNotificationsService;
229 -
223 ReactionDisposer _onMoneroAccountChangeReaction;
224
225 ReactionDisposer _onMoneroBalanceChangeReaction;
pubspec.lock
-28
@@ -362,34 +362,6 @@ packages:
362 url: "https://pub.dartlang.org"
363 source: hosted
364 version: "3.0.0-nullsafety.2"
365 - firebase_core:
366 - dependency: transitive
367 - description:
368 - name: firebase_core
369 - url: "https://pub.dartlang.org"
370 - source: hosted
371 - version: "0.5.3"
372 - firebase_core_platform_interface:
373 - dependency: transitive
374 - description:
375 - name: firebase_core_platform_interface
376 - url: "https://pub.dartlang.org"
377 - source: hosted
378 - version: "2.1.0"
379 - firebase_core_web:
380 - dependency: transitive
381 - description:
382 - name: firebase_core_web
383 - url: "https://pub.dartlang.org"
384 - source: hosted
385 - version: "0.2.1+1"
386 - firebase_messaging:
387 - dependency: "direct main"
388 - description:
389 - name: firebase_messaging
390 - url: "https://pub.dartlang.org"
391 - source: hosted
392 - version: "7.0.3"
365 fixnum:
366 dependency: transitive
367 description:
pubspec.yaml
-1
@@ -78,7 +78,6 @@ dependencies:
78 file_picker: ^3.0.0-nullsafety.2
79 unorm_dart: ^0.2.0
80 permission_handler: ^5.0.1+1
81 - firebase_messaging: ^7.0.3
81
82 dev_dependencies:
83 flutter_test: