From da6aa77df081d8b49ca3deb5e6388d1bf61ab928 Mon Sep 17 00:00:00 2001 From: russellwheatley Date: Thu, 28 Jul 2022 16:07:17 +0100 Subject: [PATCH 1/5] fix(dynamic-links): update example app proving deeplink works from app terminated state --- .../example/ios/Podfile | 4 +- .../example/ios/Runner/Info.plist | 2 + .../example/lib/firebase_options.dart | 55 ++++++++++--------- 3 files changed, 35 insertions(+), 26 deletions(-) diff --git a/packages/firebase_dynamic_links/firebase_dynamic_links/example/ios/Podfile b/packages/firebase_dynamic_links/firebase_dynamic_links/example/ios/Podfile index f7d6a5e68c3a..707b581a5329 100644 --- a/packages/firebase_dynamic_links/firebase_dynamic_links/example/ios/Podfile +++ b/packages/firebase_dynamic_links/firebase_dynamic_links/example/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -# platform :ios, '9.0' +platform :ios, '10.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' @@ -28,6 +28,8 @@ require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelpe flutter_ios_podfile_setup target 'Runner' do + use_frameworks! + use_modular_headers! flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) end diff --git a/packages/firebase_dynamic_links/firebase_dynamic_links/example/ios/Runner/Info.plist b/packages/firebase_dynamic_links/firebase_dynamic_links/example/ios/Runner/Info.plist index 674f580c9c59..49e33bbc66dd 100644 --- a/packages/firebase_dynamic_links/firebase_dynamic_links/example/ios/Runner/Info.plist +++ b/packages/firebase_dynamic_links/firebase_dynamic_links/example/ios/Runner/Info.plist @@ -62,5 +62,7 @@ https://reactnativefirebase.page.link/** + CADisableMinimumFrameDurationOnPhone + diff --git a/packages/firebase_dynamic_links/firebase_dynamic_links/example/lib/firebase_options.dart b/packages/firebase_dynamic_links/firebase_dynamic_links/example/lib/firebase_options.dart index cea1537e1d1f..a242f19703b0 100644 --- a/packages/firebase_dynamic_links/firebase_dynamic_links/example/lib/firebase_options.dart +++ b/packages/firebase_dynamic_links/firebase_dynamic_links/example/lib/firebase_options.dart @@ -1,5 +1,5 @@ // File generated by FlutterFire CLI. -// ignore_for_file: lines_longer_than_80_chars +// ignore_for_file: lines_longer_than_80_chars, avoid_classes_with_only_static_members import 'package:firebase_core/firebase_core.dart' show FirebaseOptions; import 'package:flutter/foundation.dart' show defaultTargetPlatform, kIsWeb, TargetPlatform; @@ -22,7 +22,6 @@ class DefaultFirebaseOptions { 'you can reconfigure this by running the FlutterFire CLI again.', ); } - // ignore: missing_enum_constant_in_switch switch (defaultTargetPlatform) { case TargetPlatform.android: return android; @@ -33,35 +32,41 @@ class DefaultFirebaseOptions { 'DefaultFirebaseOptions have not been configured for macos - ' 'you can reconfigure this by running the FlutterFire CLI again.', ); + case TargetPlatform.windows: + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for windows - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + case TargetPlatform.linux: + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for linux - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + default: + throw UnsupportedError( + 'DefaultFirebaseOptions are not supported for this platform.', + ); } - - throw UnsupportedError( - 'DefaultFirebaseOptions are not supported for this platform.', - ); } static const FirebaseOptions android = FirebaseOptions( - apiKey: 'AIzaSyCdRjCVZlhrq72RuEklEyyxYlBRCYhI2Sw', - appId: '1:406099696497:android:40da41183cb3d3ff3574d0', - messagingSenderId: '406099696497', - projectId: 'flutterfire-e2e-tests', - databaseURL: - 'https://flutterfire-e2e-tests-default-rtdb.europe-west1.firebasedatabase.app', - storageBucket: 'flutterfire-e2e-tests.appspot.com', + apiKey: 'AIzaSyCuu4tbv9CwwTudNOweMNstzZHIDBhgJxA', + appId: '1:448618578101:android:1be54ee660fd87d2ac3efc', + messagingSenderId: '448618578101', + projectId: 'react-native-firebase-testing', + databaseURL: 'https://react-native-firebase-testing.firebaseio.com', + storageBucket: 'react-native-firebase-testing.appspot.com', ); static const FirebaseOptions ios = FirebaseOptions( - apiKey: 'AIzaSyDooSUGSf63Ghq02_iIhtnmwMDs4HlWS6c', - appId: '1:406099696497:ios:e666f0a995aa455a3574d0', - messagingSenderId: '406099696497', - projectId: 'flutterfire-e2e-tests', - databaseURL: - 'https://flutterfire-e2e-tests-default-rtdb.europe-west1.firebasedatabase.app', - storageBucket: 'flutterfire-e2e-tests.appspot.com', - androidClientId: - '406099696497-tvtvuiqogct1gs1s6lh114jeps7hpjm5.apps.googleusercontent.com', - iosClientId: - '406099696497-nqjkqmm0fm17cdksju0o817aj226ooqb.apps.googleusercontent.com', - iosBundleId: 'io.flutter.plugins.firebase.dynamiclinksexample', + apiKey: 'AIzaSyAHAsf51D0A407EklG1bs-5wA7EbyfNFg0', + appId: '1:448618578101:ios:3e76955ab6d49ecaac3efc', + messagingSenderId: '448618578101', + projectId: 'react-native-firebase-testing', + databaseURL: 'https://react-native-firebase-testing.firebaseio.com', + storageBucket: 'react-native-firebase-testing.appspot.com', + androidClientId: '448618578101-a9p7bj5jlakabp22fo3cbkj7nsmag24e.apps.googleusercontent.com', + iosClientId: '448618578101-4km55qmv55tguvnivgjdiegb3r0jquv5.apps.googleusercontent.com', + iosBundleId: 'io.invertase.testing', ); } From 9e2bdc10104c47abd04265be95ab42620a5b4ba6 Mon Sep 17 00:00:00 2001 From: russellwheatley Date: Thu, 28 Jul 2022 16:10:27 +0100 Subject: [PATCH 2/5] format --- .../example/lib/firebase_options.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/firebase_dynamic_links/firebase_dynamic_links/example/lib/firebase_options.dart b/packages/firebase_dynamic_links/firebase_dynamic_links/example/lib/firebase_options.dart index a242f19703b0..b5967a0867db 100644 --- a/packages/firebase_dynamic_links/firebase_dynamic_links/example/lib/firebase_options.dart +++ b/packages/firebase_dynamic_links/firebase_dynamic_links/example/lib/firebase_options.dart @@ -65,8 +65,10 @@ class DefaultFirebaseOptions { projectId: 'react-native-firebase-testing', databaseURL: 'https://react-native-firebase-testing.firebaseio.com', storageBucket: 'react-native-firebase-testing.appspot.com', - androidClientId: '448618578101-a9p7bj5jlakabp22fo3cbkj7nsmag24e.apps.googleusercontent.com', - iosClientId: '448618578101-4km55qmv55tguvnivgjdiegb3r0jquv5.apps.googleusercontent.com', + androidClientId: + '448618578101-a9p7bj5jlakabp22fo3cbkj7nsmag24e.apps.googleusercontent.com', + iosClientId: + '448618578101-4km55qmv55tguvnivgjdiegb3r0jquv5.apps.googleusercontent.com', iosBundleId: 'io.invertase.testing', ); } From 59eb8d33abd9d8e1f51ad789ef082646d6751ce6 Mon Sep 17 00:00:00 2001 From: russellwheatley Date: Tue, 2 Aug 2022 15:59:19 +0100 Subject: [PATCH 3/5] chore(dynamic-links): rm unneeded custom domain --- .../firebase_dynamic_links/example/ios/Runner/Info.plist | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/firebase_dynamic_links/firebase_dynamic_links/example/ios/Runner/Info.plist b/packages/firebase_dynamic_links/firebase_dynamic_links/example/ios/Runner/Info.plist index 49e33bbc66dd..e06f59c07238 100644 --- a/packages/firebase_dynamic_links/firebase_dynamic_links/example/ios/Runner/Info.plist +++ b/packages/firebase_dynamic_links/firebase_dynamic_links/example/ios/Runner/Info.plist @@ -58,10 +58,6 @@ UIViewControllerBasedStatusBarAppearance - FirebaseDynamicLinksCustomDomains - - https://reactnativefirebase.page.link/** - CADisableMinimumFrameDurationOnPhone From a3118ff16e10f6d0c6a3a0355e9460f356d735ef Mon Sep 17 00:00:00 2001 From: russellwheatley Date: Tue, 2 Aug 2022 16:11:02 +0100 Subject: [PATCH 4/5] docs(dynamic-links): update iOS testing docs --- docs/dynamic-links/receive.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/dynamic-links/receive.md b/docs/dynamic-links/receive.md index fd4c55b5a6ff..290b3497a4a0 100644 --- a/docs/dynamic-links/receive.md +++ b/docs/dynamic-links/receive.md @@ -73,7 +73,7 @@ start the activity with this intent filter to handle the link. 1. On the Signing & Capabilities page, enable **Associated Domains** and add the following to the Associated Domains list: - + ``` applinks:example.page.link ``` @@ -149,6 +149,8 @@ Future main() async { } ``` + + Within your application logic, you can then check whether a link was handled and perform an action, for example: ```dart @@ -180,3 +182,8 @@ FirebaseDynamicLinks.instance.onLink.listen((dynamicLinkData) { // Handle errors }); ``` + +### Testing A Dynamic Link On iOS Platform + +To test a dynamic link on iOS, it is required that you use an actual device. You will also need to run the app in release mode (i.e. `flutter run --release`.), +if testing a dynamic link from a terminated (i.e. app has been swiped closed.) app state. From 6b12208bf0cf28988b38130783d73af98fcfe2d6 Mon Sep 17 00:00:00 2001 From: russellwheatley Date: Tue, 2 Aug 2022 16:14:29 +0100 Subject: [PATCH 5/5] docs(dynamic-links): remove spacing --- docs/dynamic-links/receive.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/dynamic-links/receive.md b/docs/dynamic-links/receive.md index 290b3497a4a0..362a95bd4942 100644 --- a/docs/dynamic-links/receive.md +++ b/docs/dynamic-links/receive.md @@ -149,8 +149,6 @@ Future main() async { } ``` - - Within your application logic, you can then check whether a link was handled and perform an action, for example: ```dart