Hi I searched how to change package name in flutter.But I'm using Firebase admob in my app. My app package name is
"package_name": "com.example.flutter_apptry"
I tryed to upload the app to the store but google says
Since "com.example" is restricted, you need to use a different package name.
So What should I do
Thank you.
I'm using firebase ads. in "google-services.json " my app package name is
"package_name": "com.example.flutter_apptry"
As my tought I replaced all the package name but now ad service is not working.How can I fix it
You need to change your package ID. "example" is not allowed over the Play Store.
If you want to get more info about it, check the docs: https://developer.android.com/studio/build/application-id
Renaming a Flutter app is relative simple in just a few steps: https://stackoverflow.com/a/51550358/3743245
Related
When I used huawei AppLinking Serviceļ¼ the app package name is queried to locate the app details page. However, the app package name varies depending on the channel. For example, for a Huawei channel, the package name ends with .huawei, which is different from that in a Google channel.Does this mean it's impossible for an App Linking link to be opened in all local app stores due to package name inconsistency?
Does this mean it's impossible for an App Linking link to be opened in
all local app stores due to package name inconsistency?
The answer is no because there is a solution to this problem.
Perform the following to resolve the issue:
We know that App Linking can redirect users to a custom website if the app has not been installed, so you can use Android intents to create custom links, in which you can configure the package name and fallback URL to be opened. The basic syntax is as follows:
intent:
HOST/URI-path // Optional host
#Intent;
package=[string];
action=[string];
category=[string];
component=[string];
scheme=[string];
S.browser_fallback_url=[encoded_full_url]
end;
Taking advantage of the preceding functions, you can:
Create a link of App Linking and use the setOpenType(CustomUrl) method to set the open type to redirect users to a custom website for the Android platform. The involved APIs are as follows:
.setAndroidLinkInfo(new AppLinking.AndroidLinkInfo.Builder()
.setAndroidDeepLink(Android_LINK)
.setOpenType(CustomUrl)
.setFallbackUrl(BACK_LINK)
.build())
Use an Android intent to configure the preceding custom website. Here, I use Taobao as an example:
"intent://details?id=com.taobao.taobao#Intent;scheme=appmarket;package=com.huawei.appmarket;S.browser_fallback_url=https://play.google.com/store/apps/details?id=com.taobao.taobao;end"
The process is as follows:
1.Use the appmarket scheme to start the app whose package name is com.huawei.appmarket, that is, to open HUAWEI AppGallery.
2.Pass the package name com.taobao.taobao to HUAWEI AppGallery. Then, HUAWEI AppGallery will start this package.
3.If com.huawei.appmarket is not found, set S.browser_fallback_url to a fallback URL.
4.The fallback URL is a Google Play link. Simply set id in this URL to the name of the package to be opened. In this example, the ID is com.taobao.taobao.
Ensure that an App Linking project of the Android platform has been completed. For details, visit:
https://forums.developer.huawei.com/forumPortal/en/topic/0204442462434640048?fid=0101188387844930001
Open the original App Linking project and add the following information in bold:
String BACK_LINK = "intent://details?id=com.taobao.taobao#Intent;" +
"scheme=appmarket;package=com.huawei.appmarket;" +
"S.browser_fallback_url=https://play.google.com/store/apps/details?" +
"id=com.taobao.taobao;end";
AppLinking.Builder builder = new AppLinking.Builder()
.setUriPrefix(DOMAIN_URI_PREFIX)
.setDeepLink(Uri.parse(DEEP_LINK))
.setAndroidLinkInfo(new AppLinking.AndroidLinkInfo.Builder()
.setAndroidDeepLink(Android_DEEP_LINK)
.setOpenType(CustomUrl)
.setFallbackUrl(BACK_LINK)
.build());
Test:
Install the demo on a device, create a link of App Linking, and add it to the note.
Uninstall the app to simulate the scenario where the app is not installed.
For a Huawei phone, tap Open/Download. On AppGallery that is displayed, open the Taobao details page. The following figure shows the Taobao details page in HUAWEI Browser.
For a non-Huawei phone, tap Open/Download. On Google Play that is displayed, open the Taobao details page. The following figure shows the Taobao details page in Google Chrome.
The problem is now resolved. If you encounter a similar problem, simply follow my example step by step and change the package name to resolve the issue.
For more details, please go to:
https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/agc-applinking-introduction?ha_source=hms1
I was trying to load a test banner ad in my app. I used test ad id from this link - https://developers.google.com/admob/android/test-ads#sample_ad_units and I used this package - https://pub.dev/packages/google_mobile_ads . But when I tried to run my app the following exception occurred.Here is a snap of my android studio console
Check that you haven't forgot to add:
MobileAds.instance.initialize();
Reference:
https://developers.google.com/admob/flutter/quick-start
Using hot reload or hot restart while working with ads creates this problem. It can be solved by using flutter clean or running it after closing. When someone hot reloads or restarts app while checking ad functionality, the system takes the previously running app and the one that will come after reload or restart as two different entity. And these entities are trying to use the same ad id and that pulls the trigger of this problem.
I also had a similar problem. I found out after research and testing that one unit ad needs a unique ad unit id.
The unique identifier for an ad unit. When you implement a new ad unit in your app,
you'll reference the ad unit ID to tell ad networks where to send ads when they're
requested. You can find the ad unit ID of an app in the app's ad units table.
Check
Go to your adMob dashboard and for your dsired app create new ad unit.
In my case there were two ads in my application's dashboard. So I created two ad units.
And don't froget to release your ad object.
#override
void dispose() {
// TODO: Dispose a BannerAd object
_ad?.dispose();
super.dispose();
}
Unfortunately the google_mobile_ads lacks documentation and it seems that no proper way to check if the ad loaded already from the previous app state. It is possible by saving the status to persistent storage then reading it just before the load is called.
Update google_mobile_ads to 0.11.0+4 version. In that version the problem was solved as you can see in changelog https://pub.dev/packages/google_mobile_ads/changelog
I want to publish my library and same as before, I have included author name in the pubspec file.
Running flutter pub pub publish --dry-run gives me the following warning:
Warning: Your pubspec.yaml includes an "author" section which is no longer used and may be removed
I will authorize my publishing using the email in my author value. If I remove it, how will I authorize.
I'll be thankful to know more about this.
Instead of using author or authors to verify yourself, the new way is that you make yourself a verified publisher.
According to documents:
To create a verified publisher, follow these steps:
Go to pub.dev.
Log in to pub.dev using a Google Account.
In the user menu in the top-right corner, select Create Publisher.
Enter the domain name that you want to associate with your publisher
(for example, dart.dev), and click Create Publisher.
In the confirmation dialog, select OK.
If prompted, complete the verification flow, which opens the Google Search Console.
When adding DNS records, it may take a few hours before the Search
Console reflects the changes. When the verification flow is complete,
return to step 4.
You should now use authors instead of author:
name: my_package
authors:
- me#mail.com
- another_author#mail.com
...
so today we received a ticket that our application does't open de Google Maps but open another app JabJobs in our application we check if there is GoogleMaps installed as follow:
(UIApplication.shared.canOpenURL(NSURL(string:"comgooglemaps://")! as URL))
so if there is an GoogleMaps installed there is no problem but if we uninstall the GoogleMaps app, and install JabJobs the UIApplication.shared.canOpenURL still return true value and when we go further with
UIApplication.shared.openURL(NSURL(string:
"comgooglemaps://?saddr=&daddr=\(place.lat),\(place.lng)&directionsmode=driving")! as URL)
a system popUp is displayed with "MyApp" wants to open "JabJobs"
Q1. Is that possible that another app to respond to same URL as googleApp ?
Q2. How can i check if there is a GoogleMaps installed if the code above doesn't work?
Of course it's possible, you can respond to any URL scheme if you register app for it.
From https://developers.google.com/maps/documentation/urls/ios-urlscheme, I can see that Google Maps have more url schemes, for example comgooglemapsurl://. You can check if these 2 schemes are available if not then it's probably other App, unless they support all these schemes... then you can't do nothing, but as I can see JabJobs does not support comgooglemapsurl:// scheme.
I'm trying to send SMS from my flutter app when a button is pressed. I'd like to do this without user interaction. I know i can launch the SMS app using url_launcher.
I tried using the sms package from pub but flutter says the api is outdated.
I'd like to do this purely in dart if possible.
I'm using the package sms_maintained. refer to package for latest version.
Code sample from package.
import 'package:sms/sms.dart';
void main() {
SmsSender sender = new SmsSender();
String address = someAddress();
...
sender.sendSms(new SmsMessage(address, 'Hello flutter!'));
}
I't provides other methods as well.
Querying, filtering, contact info, receiving and deleting as well.
For sending the a sms you'd need the necessary permissions.
SEND_SMS
And for other functionalities.
RECEIVE_SMS
READ_SMS
READ_CONTACTS
An extensive list of them are located here.
flutter AndroidManifest.xml is location => android/app/src/main/AndroidManifest.xml
EDIT #:
The package is no longer maintained. you may manually link to files from this repo
pubspec.yaml
dependencies:
...
sms_maintained:
path: plugin_folder_path