I have developed an IOS app using PhoneGap and need to integrate Dropbox . I am using Cordova 3.1.0 under IOS 7.1.2 .
From my phonegap app I launch InAppBrowser and point it to my server page that has the js API for the chooser dropin, this launches fine and if the user is not logged into Dropbox they are asked to login as expected. Once logged in the users files are displayed, so I think everything is good with my app key etc.
The problem occurs when the user selects a file and clicks the choose button. I got the message: "Unable to close this window. Please close it manually and return to the previous site."
I was wondering if anyone else has experienced this issue, or has any advice for implementation.
(almost the same issue as :
Dropbox choose button does not return in ios8 - But with IOS7)
It appears to me that PhoneGap's InAppBrowser doesn't support window.close. It might be possible for you to inject some JavaScript via your app that provides an implementation for window.close, or you might need to use the native browser instead of an embedded one.
Related
I am working on a mobile website. We are showing a default screen on mobile website with 2 options.
1. Open in app
2. Continue to mobile site
now I have to check when user chooses Open in App, if App is already installed on mobile, open App.
If not go to play store.
Right now it is going to play store anyway.
How can I verify this, please suggest.
You can register an intent filter for a specific URI in the manifest. Whenever the URI is resolved by the system (for example when you click on it in the browser) you application would be notified and could start up. See also this so entry. But that does not handle the automatic redirect to the play store if the app is not installed. Maybe deep linking could do the job for you. This talk may also be relevant for deep linking.
I have an android app that can be accessed through a web browser too. I need to put a banner to let the user install the android application. How can i tell (if the user enters to the application through the web browser) using javascript or jquery, if the android app is already installed on his mobile phone?
All i want to do is: If the user clics the banner and the app is already installed, open the android app. Otherwise, redirect the user to the playstore to let him install the app.
Let's say your app is uploaded on both Apple AppStore and Google Play stores.
You need to:
Sniff in your webpage which OS is installed from the device accessing your page
good link to find how => here
Enable deep linking to listen for exactly same link from your mobile native app
for Android you need to register your main activity or any other activity to listen for these links
for iOS - no idea honestly, look around or find a 3rd party service
code for Google Play with deep link. And the deep link is same as your website page you want to cache/index in Google Search (or any other search engine)
sample link to index/use => http://my_website.com/results
// below snipplet need to be for Android devices only
// i.e. need to sniff and have if/else validation for Android, iOS, desktop and so on
// will call with 25 mills delay in case deep link fails, i.e. no installed app
setTimeout(function () { window.location = "https://play.google.com/details?id=com.foo.myapp"; }, 25);
// try to load the deep link URL
window.location = "http://my_website.com/results";
repeat above for iOS and desktop/Windows Mobile
Additional advantage of above is the full app indexing without the lame App Indexing excuse from Google (min sdk no more than 17, Chrome for Android availability and so forth limitations).
There is no way to detect if an app is installed using Javascript.
However you can get the behavior you describe and you don't even need any javascript:
Choose an URL for your app on a web server you own and make the banner link to it.
Set this web URL as a deep link handled by your app by specifing it in your app's manifest. It should open the main Activity.
On your web server, configure this URL to redirect to the Play Store URL of your app. Optional: if your app is also on iOS, you could detect the iOS browser and display something else.
If the app is installed it will handle the URL and open, otherwise the browser will follow the link and the redirect and the Play Store app will open to handle the Play Store URL to your app.
I am having a really strange issue with a single user when using Xamarin.Auth for authentication. This user has a Samsung Galaxy S3. When they try to sign in to their account using Xamarin.Auth, the WebView which Xamarin.Auth uses to display the login page has no JavaScript enabled. This means that they are unable to click the sign-in button on the page, preventing them from signing in.
I can provide code examples, however they do not differ much from the Xamarin.Auth examples/docs. Also, This issue is particular to this user in that I have tested my app with another Galaxy S3 and the authentication works as expected.
I am really unsure as to how to debug this issue, any help would be appreciated.
https://components.xamarin.com/view/xamarin.auth
I have developed an app using PhoneGap and need to integrate Dropbox for my users. I am currently using Cordova 2.9.
I have been unsuccessful in using the chooser dropin. Here is a brief explanation of what is going on...
From my phone gap app I launch InAppBrowser and point it to my server page that has the js API for the chooser dropin, this launches fine and if the user is not logged into Dropbox they are asked to login as expected. Once logged in the users files are displayed, so I think everything is good with my app key etc.
The problem occurs when the user selects a file and clicks the choose button. Nothing occurs, it seems like the success callback is never called. I have only noticed this when testing on an actual device running iOS8.
I have tried calling alert in the success callback and nothing happens, the chooser stays open. The cancel button also does not work in this scenario.
I was wondering if anyone else has experienced this issue, or has any advice for implementation.
Assuming that your implementation does work in iOS 7, this is likely this known issue:
https://forums.dropbox.com/topic.php?id=120846
Unfortunately, this is due to a bug in iOS 8, so it's up to Apple to fix.
I build a webapp and I have social links in my webapp.
I am facing an issue regarding this. If I am having facebook installed in my device then on click of the share link it should open the native app instead of opening in browser.
And incase if I doesnt have any native app installed then it should automatically redirect to browser.
Here it is the code what I have tried:
Javascript:
if(isAndroid){
fb://profile//www.facebook.com/sharer/sharer.php // to open in native browser
http://wwww.facebook.com // to open in web browser.
}
How do I handle this urls...
Please help me out.
This is not possible, for privacy reasons.
See This answer
You can make Hybrid Application.
What you just need to do is ADD WEB INTERFACE which will make call to native source code through javascript and also get return value.
So you can write native function which will return if application is installed. Once you set this interface you can use it further for open that app and passing intent and all that.
You can do it easily. Start Here:
https://developer.android.com/guide/webapps/webview.html