About how to launch the Play Store from the in-app browser

Asked 2 years ago, Updated 2 years ago, 85 views

I am developing an Android app with monaca, but
I tried to open the play store from the in-app browser, but it didn't work.
I can't help but stand up in my browser.

vartesturl="http://test.com/test.html"
 window.open(testurl, "_system");

--test.html --

Link

"When I hit this page with Chrome, etc., ""Choose an application"" appears
" There is a play store there, and if I select it, I can start it. What should I do?

android monaca

2022-09-29 22:12

1 Answers

Open on Android using WebIntent.
monaca from the plug-in list.

Here is an example of my implementation.
In my case, I also support other than Android, so please refer to the following unique functions.

_confirm(
    US>"Open the download page?",
    function(results){
        if(1==results){
            // Google Play Store URL
            var store_url="https://play.google.com/store/apps/details?id=jp.com.bundleid";
            // Is it an Android app?
            if(isAndroid()){
                // Is the WebIntent plug-in available?
                if(isSupportedPlugins()){
                    // Configure WebIntent for Android.
                    window.plugins.webintent.startActivity(
                        {
                            action: window.plugins.webintent.ACTION_VIEW,
                            url —store_url
                        },
                        function() {},
                        function(){}
                    );
                } else{
                    window.open(store_url, "_system");
                }
            } else if(isIOS()){//iOS app?
                // App Store URL
                store_url="http://itunes.apple.com/jp/app/appname/id00000000?mt=8";
                // Open in InAppBrowser
                window.open(store_url, "_system");
            } else {// Other
                // Support web pages, etc.
                store_url="https://supported.web.page/";
                // Open in InAppBrowser
                window.open(store_url, "_system");
            }
        }
    },
    "Install",
    "Open, Cancel"
);


2022-09-29 22:12

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.