最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

android - Flutter: url_launcher not working on play store release - Stack Overflow

programmeradmin0浏览0评论

I'm using the url_launcher package in my flutter application. Testing on debug mode works, and so does release mode. However, when I update my app on the play store, it doesn't work. I have also tried different launch modes.

I have the following queries set up in my AndroidManifest.xml

     <queries>
        <intent>
            <action android:name="android.intent.action.PROCESS_TEXT" />
            <data android:mimeType="text/plain" />
        </intent>
        <intent>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="https" />
        </intent>
        <intent>
            <action android:name="android.support.customtabs.action.CustomTabsService" />
        </intent>
    </queries>

I've come across similar issues already and tried almost all of them to no avail. I've also updated my data privacy security form to include that we do collect Installed Apps under App Activity. I've also tried out most of the android package(app) visibily solutions I've come across including adding the QUERY_ALL_PACKAGES app permission in my manifest. What I haven't tried yet is adding the specific packages we want to discover(in this case browsers). I don't want to result to this since android already supports discovery via intents.

I'm now wondering if the problem is with some questionnaire or data privacy form that we filled on the play store.

Edit: I also have firebase crashlytics set up and it doesn't report any Uncaught exceptions or ANRs

I'm using the url_launcher package in my flutter application. Testing on debug mode works, and so does release mode. However, when I update my app on the play store, it doesn't work. I have also tried different launch modes.

I have the following queries set up in my AndroidManifest.xml

     <queries>
        <intent>
            <action android:name="android.intent.action.PROCESS_TEXT" />
            <data android:mimeType="text/plain" />
        </intent>
        <intent>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="https" />
        </intent>
        <intent>
            <action android:name="android.support.customtabs.action.CustomTabsService" />
        </intent>
    </queries>

I've come across similar issues already and tried almost all of them to no avail. I've also updated my data privacy security form to include that we do collect Installed Apps under App Activity. I've also tried out most of the android package(app) visibily solutions I've come across including adding the QUERY_ALL_PACKAGES app permission in my manifest. What I haven't tried yet is adding the specific packages we want to discover(in this case browsers). I don't want to result to this since android already supports discovery via intents.

I'm now wondering if the problem is with some questionnaire or data privacy form that we filled on the play store.

Edit: I also have firebase crashlytics set up and it doesn't report any Uncaught exceptions or ANRs

Share Improve this question edited Mar 12 at 9:20 Newton Nthiga asked Mar 12 at 8:59 Newton NthigaNewton Nthiga 457 bronze badges 3
  • Why do you need to query for the ability to open web links in the first place, rather than just opening the URL and handling failure? Is your app running on devices where not having a browser is common enough that you actually change your UI if no browser is detected? – sman Commented Mar 12 at 10:34
  • @sman I do not particularly need to query for the ability to open web links. I was just mentioning what previous issues/questions have suggested. Perhaps you misunderstood. My application basically just opens the URL and handles failure. This works fine for both debug and release builds. It's only when I release to play store that it doesn't work. launchUrl returns true but nothing happens. Try catch, doesn't catch any errors. – Newton Nthiga Commented Mar 12 at 10:53
  • Most of your question discusses query permissions, which only relate to canLaunchUrl, not launchUrl. If you don't show your code, and focus your question on things that are only relevant to canLaunchUrl, it's going to be difficult for anyone to understand the question if it wasn't intended to be about canLaunchUrl. – sman Commented Mar 13 at 2:50
Add a comment  | 

2 Answers 2

Reset to default 0

Try to explicitly launch the browser in external mode:

await launchUrl(url, mode: LaunchMode.externalApplication);

Figured it out, this was just a silly developer mistake. I had a web link set up in my AndroidManifest similar to the url I was trying to open from inside the app, so basically every time I try to launch the URL nothing would happen. Opening the URL from outside the app would just launch the app but since the app is already open nothing happens if you're not handling web links/deep links.

Reason why it didn't work on app downloaded from play store is because I had verified the weblink domain and allowed share credentials. The app therefore came already set up to open such links by default. When installing a debug/release apk you need to set the app as the default to open such links instead of a browser.

发布评论

评论列表(0)

  1. 暂无评论