Avoid deep link calls onGenerateRoute in Flutter app? - flutter

I'm trying to handle deeplinking in my Flutter app with uni_links package.
Is there a way to avoid onGenerateRoute is called by the launch deep linking? I have my own routing logic and I just need to get the deeplink string (I already do) and nothing else, I don't need to be routed anywhere.

For android,
in AndroidManifest.xml inside <activity> tag, please add
<meta-data android:name="flutter_deeplinking_enabled" android:value="false" />
More info: https://docs.flutter.dev/development/ui/navigation/deep-linking#enable-deep-linking-on-android
For iOS
Inside Info.plist, add
<key>FlutterDeepLinkingEnabled</key> <true/>
More info: https://docs.flutter.dev/development/ui/navigation/deep-linking#enable-deep-linking-on-ios

Related

Flutter - How can I follow the uninstall of the application?

I am developing a flutter app. I want to update its status in my database when the user deletes the app from own phone. How can I follow these changes? Is it possible on flutter?
There is no way to do it in iOS, but for android, you can use device_apps package to get the current list of installed apps and then compare it to the previously fetched data.
First, add this to your androids manifest file:
<manifest...>
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
</manifest>
and then use it:
List<Application> apps = await DeviceApps.getInstalledApplications();

Flutter FIrebase Admob crashing on app start even though i have added all required setups

I am trying to implement Google Admob in Flutter. I have added the required dependencies:
Android Manifest;
Added Initialization in the app
I have a google-services.json file added to my project which is the same one I have been using for Firestore etc. successfully.
But the app just does not seem to want to start. If I remove the Admob dependency from my pubspec file, the app works so this is definitely to so with the Admob.
I know that the testAppId pulls through the same appid specified in AndroidManifest as this is the google test ad id.
I have not yet implemented any banners, interstitials as yet. i am just trying to initialize first and at least get the app running.
What am I doing wrong?
So it seems the firebase_admob documentation needs to be updated as it is inaccurate.
The issue is related to the placement of the meta-data tag inside the Android Manifest.
The document indicates to place it within <application>, however it does not indicate what to do if you also have a tag for <activity> :
<manifest>
<application>
<!-- TODO: Replace with your real AdMob app ID -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-################~##########"/>
</application>
</manifest>
However, this does not work. I stumbled across the following video(https://www.youtube.com/watch?v=d2aCCIIUebc --> check the 17:20 mark) by chance and the user indicated the same problem and it is solved by moving the tag as following:
<manifest>
<application>
<activity
</activity>
<meta-data
<!-- TODO: Replace with your real AdMob app ID -->
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-################~##########"/>
</application>
</manifest>
Note: the change is to move the Meta-data tag to outside the application tag. This solves the problem and the app does not crash and loads ads as expected.

Launching custom URL scheme in Flutter

I'm trying to implement this functionality in Flutter. The android side is easy to mimic using the android_intent package, however I've yet to find a way of launching custom URL schemes in Flutter. There are packages that allow custom URL schemes to be accepted in the app, however I don't think they can be used in my case (uni_links).
I'm aware that I could use platform channels however I would prefer to keep my code all in Dart. Thanks
I use firebase_dynamic_links to handle custom URL schemes. You may want to consider also looking into that. You won't be needing to touch platform-specific code, but you'll need to update the AndroidManifest.xml and Info.plist file.

How to get permission with a description?

I found on an application that asks permission to use bluetooth with a description of why this is needed. I need to implement this in my application.
How to name this function? How can this be done on ionic?
This BT request would have to be triggered via a cordova plugin, eg this one for iOS:
https://github.com/swetha-thoomoju/cordova-plugin-ios-bluetooth-permissions
..or by editing cordova's config.xml to include:
<config-file parent="NSBluetoothAlwaysUsageDescription" target="*-Info.plist">
<string>Improve location accuracy when finding nearby services</string>
</config-file>
The above is only for iOS, but I'm pretty sure something exists for Android as well.

Android Widgets separate apps?

I hate to sound like terrible newb, but are Widgets separate apps? For instance, I am creating a news reader app for Android and I want a homescreen widget. Do I create the widget as a separate project/app that hooks into the other app, or do I add the code for the widget to the original news reader app so that they are installed in tandem?
If it is a separate project/app, then how do I make sure it is installed when the "parent app" is installed, or is that sort of thing totally off base?
Thanks for any help you can offer!
P.S. Also, I have mostly been an iOS user and I'm just now getting into Android and I don't have a phone, just a tablet. So I haven't absorbed common forms and examples yet.
Just wanted to answer my own question in case anyone else comes along looking for answers. The home screen widget for an app is indeed not a separate app. All it takes to initialize a widget is to declare a BroadcastReceiver in the AndroidManifest.xml file.
Mine looks like this:
<receiver android:name=".receivers.PWReceiver" android:label="#string/widget_name">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
</intent-filter>
<meta-data android:name="android.appwidget.provider" android:resource="#xml/widget_config" />
</receiver>