I am trying to use mailto link in my app but when clicking that link, I am getting a screen saying
"Webpage not available and some error", although email application
opens properly but I want to bypass that background error page.
Please note that I am using following code inside the button click:
window.open('mailto:alok1141#gmail.com?subject=Feedback: Competitive Aptitude');
Please suggest any way to avoid this background page.
Image with background error screen
My best guess is that you need to use a link <a href="mailto:..."> instead of a button or maybe use window.location=... in the onClick so that the browser can present the popup directly.
Now you tell the browser to open a window with the mailto url so only after the window has been opened it will check the url and present the popup.
There's two kind of format "mailto:" or "message/rfc822" MIME type. You have to add it on Intent with setType() If no app supports both, then it will shows the default chooser.
Have you tried setting the target to _system? It could be that your app is attempting to handle the link itself and failing. By setting the target to _system, you are asking the OS to open it for you.
window.open('mailto:alok1141#gmail.com?subject=Feedback: Competitive Aptitude', '_system');
You will also need the inappbrowser plugin. This plugin ensures that adding _system actually works. I believe on Android you may not need this, but you definitely will for iOS.
cordova plugin add cordova-plugin-inappbrowser
Thanks,
I found the solution. Actually when you run the application in phonegap app it will not open href="mailto: xyz#email.com" thats why I had to use window.open,
but once you will build the app even href="mailto: xyz#email.com" will work and best thing is it will directly open the app and no background error page will appear.
Related
I am looking for a way to open the native android alarm clock app when a user clicks on the link or button on a web browser of the android. So basically need to open the native android app from web application. I tried using intent://#Intent;package=com.android.deskclock;end' and it is not working. I am wondering if I am using the wrong package name or it is not even possible in android.
Thank you much for help!
According to this documentation, this is not possible. In particular, this footnote is the limiting factor:
Only activities that have the category filter, android.intent.category.BROWSABLE are able to be invoked using this method as it indicates that the application is safe to open from the Browser.
If you look at the AndroidManifest.xml for the DeskClock app, none of the activities contain the android.intent.category.BROWSABLE category filter, meaning none of them can be opened from the browser.
I have a suspicion that the problem is that you are not providing a URI path in your URL. It might need to be a path declared in the app's manifest. See: https://developer.chrome.com/multidevice/android/intents
This could change it to ie intent://path/#Intent;package=com.android.deskclock;end'
It might be helpful if you were to look at the javascript console when you try to click on that link in Chrome, there might be details of what went wrong.
Keep in mind that the alarm clock app is not necessarily consistent. Manufacturers can remove the default alarm clock app to replace it with a different one, or just modify the source code so that it has the same package name but different source code. You could try opening multiple package names from javascript depending on what happens when the intent can't be opened.
Welcome to code party
You can get a android device IFrame from appetize site.
This is the easiest way for show android apps in web applications.
Update me in comments ;)
I'm trying to receive a link shared from another application like browser or youtube into my phonegap app. I'm using phonegap build (build.phonegap.com) to make my app.
I'd like to know how to make my app appear in the 'share' list for links.
All solutions I found online are making me edit Android Manifest or Java files, but is there a way (a plugin of sorts) I can use to make data transfer between apps possible?
There is a plugin available for PhoneGap which will handle receiving content from other application. You can use it. Following is the link to this plugin. https://www.npmjs.com/package/cordova-plugin-intent
If you find any issue or something else other than that functionality, you can make the custom plugin so that you will have direct access of java file from javascript.
If I understand your question correctly, you're talking about deep linking in android. The details about it can be found here
Correct me if I explain your ideas wrong: What you want to do is that you have an URL that showed up in another application (Ex: Facebook Messenger, Slack, ...) and you want after clicking it, a list of application that can be used to open that link appear and you want your app to be listed there.
But here is the problem, how can the OS knows what apps it can suggest to the end-user and what kind of link your is acceptable to your app? the answer lies in your application manifest and to be more precise, the intent-filter tag. It tells the OS what you kind of url you want and also use it to determine if the OS should suggest your app to be open by using that link for the user.
So the answer for your question about doing without editing Manifest is impossible. As for the reason why you don't want to edit your apps is unknown to me but I still suggest you to take a look at this tutorial. It still involves editing your manifest but the guide it self is clear and easy to implement.
Hope this help ^^
I'm having this little issue with PhoneGap when playing around with it:
Whenever I open an external link on my iPhone, it goes fullscreen and there is no way back but terminate the app and start again. I've read some articles and think this could be easily fixed by just calling window.open (or navigator.app.loadUrl on Android).
However, the problem continues with 3rd party library. In particular, I'm using Google Maps and the widget has little links to "Terms of Use" and something else. Tapping this link will load the Google URL full screen again.
My question is, is there any global configuration/code to either modify the in-app web browser (add header, back button and so on) or open every external links on device's default browser?
Thanks for reading and helping :)
First you study about InAppBrowser.
InAppBrowser open with close(done) button . This is not working means you also use ChildBrowser.
Reference 1
Reference 2
I am using PhoneGap 2.6.0 with Sencha Touch 2.2 on Android 4.0.3. I am calling the InAppBrowser to open a share url to facebook like so:
window.open(encodeURI('https://www.facebook.com/sharer/sharer.php?u=http://www.mycoolapp.com/&t=Everyone check this out'), '_blank', 'location=no');
However, instead of opening the InAppBrowser with the UI, it opens on top of my app screen without any 'OK' button like on iOS or any way to close and go back.
I am able to go back with the standard Android OS back button.
Is there any way to get the url bar and the OK button to show on the Android InAppBrowser for PhoneGap?
As per window.open section in docs, you have to give `location=yes' to show location bar. Regarding type of window, do you see any difference when you pass '_self' and '_blank'?
Maybe a problem with your Access-origin in res/xml/config.xml (PhoneGap 2.6.0 Domain Whitelist Guide)...?
As others stated, for android you have to specify location=yes and no you can't get riddle of the location bar and mantain back button.
But if you are on Android why do you have to keep it?
Being able to coming back with physical back button is the preferred behaviour by design in Android.
Hallo Developers,
is it possible to start a activity with a link from a Email like in Iphone SDK and start this aktivity with params.
Iphone example:
Appname:///?param1=value1¶m2=value2
It appears to be possible - check these other answers on stackoverflow:
How to implement my very own URI scheme on Android
Android Respond To URL in Intent
Not to my knowledge in stock Android. However they've made a link scheme that will open up the Market application to a specific page, so this is possible. I would think however that in order to set something like that up the app you are wanting to start from link would have to be listening for clicks on that specific type of link and tell the system that it can handle them. I have no idea how you'd go about implementing that though, and it would only be able to start specific apps that were designed that way.
Try content://com.user.package.ActivityClass/. I haven't tried it so I am not sure if it will work though.
See here for more information: http://developer.android.com/reference/android/content/Intent.html