Where should I put FCM configuration in flutter app exactly? - flutter

I'm using firebase_messaging plugin in my flutter app to handle app notifications (given from a Laravel server). So far, I've successfuly installed the plugin in my project. Tested it on a page, it works.
But in the doc's example page, it's only demonstrate the usage of a single page. In reality, most of the apps has or may have many pages and each page has it's own notification channels, so does my app.
So.. Where is the exact location to put it's configuration? Should I configure it one each page, or can I just put it on main.dart and subscribe every channel from that page?
I don't think the first option is a best practice. Since I'm trying to follow DRY principle and avoid code-duplication to make it easier to maintain the app in the future. Any clue?

Related

Will every change in Ionic force the customers to update the Ionic app again and again?

If I make changes to the HTML/CSS/JS code of my ionic code, will the customer have to update the app or will it be updated dynamically?
As far as I know, we just push a website into an app and deploy it. When we change the code of your website and deploy it, the website changes show up automatically.
I wonder if Ionic runs the same way? Some people suggest that it is just running the app in a web view. So the app is intact, I change the website, what will it do?
I really want to know about this because we are trying to modernise our application. Our application depends on the server too much for view rendering and for all the logic. I want to make the client a little independent but at the same time keep the changes dynamic like they are right now.
Thank you so much.

show ads in flutter website(flutter web app)

How to implement AdSense or any other to show ads on the flutter website (flutter web app).
Which are the ad provider options like Adsense for a flutter web app.
Currently if you try, your application will be submitted for review, and then you will inaccurately obtain a "Valuable Inventory: No content" flag/violation. The problem is noticed though, but unfortunately it will be a good amount of time before it gets prioritized over the mobile ad framework.
https://github.com/flutter/flutter/issues/40376
I don't think flutter is in a mood to encourage adds on flutter web. Google uses crawlers to search the content on websites which will not work in case of flutter that well event though you try to inject adds through js code using plugin and this made me scrape my whole UI project and start it over again on angular or react.
Take a look at this new package I just saw has been released. Still in the infancy stages as it says but it's a start at least.
https://pub.dev/packages/admanager_web
Example of implementation:
AdBlock(
size: AdBlockSize.largeRectangle,
adUnitId: "/6355419/Travel/Europe",
)

How do I check my app's version-number on Google Playstore when coding in Flutter?

I want to know if there is a method or library to use in checking my app's version-number on Google PlayStore? Want to advise users to update to the latest version if their apk's version number is behind
There is no official API at the moment. And using the solutions you find on the web are bad. Most of them involve scraping the Play Store website and will break whenever the Play store re-designs their web page.
Right now I would recommend using Firebase Remote Config. That way you can store in the Firebase server whatever you want the minimum version for your app to be, and them when you want users to update you can increase the value. This lets you control when you need to force an update and is much more flexible, and very easy to update.

How to receive a push notification when you are near a specific place using a map?

I'm new to Ionic, and I'd like to know if you can give me some guidance. I am using Ionic 1. I have seen tutorials, and they use Google or one signal. But they are always basic tutorials and I have many doubts. I hope to do this for both iOS and Android.
My application has some coordinates in the database, I get them with a web service. I would like that when I'm near a place I get a push notification. I am currently using the Google Maps plugin cordova-plugin-googlemaps and the geolocation plugin cordova-plugin-geolocation.
I would like you to give me advice or if you have had the experience of doing something like this.
I also want to know if doing this has any cost.
I am using Ionic 1 and the database is built in MySQL using PHP. I think the push notification is generated from the back-end?
When I tap on the notification, can it contain an iconor redirect to a specific place in my app?
In conclusion:
What is the best alternative? I was thinking of some plugin that detects in the background when my location changes and when this happens (does the cordova-plugin-geolocation do it?) verify if I'm close to a certain place and send a local notification. For example, and when I tap on this notification I can get the id of that place and redirect to a place in my app.
I think you should try geofence
repo link
example links:
https://github.com/cowbell/ionic-geofence built with Ionic framework
https://github.com/tsubik/ionic2-geofence built with Ionic 2 framework

Running an ionic app inside ionic app

Is there any way to develop the main app with logins using ionic and develop subparts of that app as individual apps and use the main app to access the sub-apps and pass the login info to sub apps.
Draw.io Flow Diagram For Better idea 1
One ionic app can launch another through the InAppBrowser, for instance. Or socialsharing plugin, etc. And then you need to pass on variables through the launch code. And then going back again.
But the UI experience will be awefull this way if functionally the apps actually are quite similar/related/dependent. So from a UI perspective not a very nice thing to do.
So basically, if you manage the code for all these apps, you may be better off integrating as modules/components in one code base. If you don't own the other apps, make sure the UI is smooth.
Regards
Tom