'Share Functionality' for Mobile Web Apps - android

If I add a 'mailto:' link to my Mobile web app, smartphones know to open up the native mail app, is there something similar for 'sharing'?
I ask because on my Android 2.2, if I 'select text' using the browser's menu option, and then I select some text, I get presented with a 'share via' option that opens a native dialog with options to share via gmail, facebook, etc... I'd like to trigger this dialog from my Mobile Web App. Is this possible?
Thanks in advance for any help, much appreciated as I couldn't figure it out on my own. :)

Here a tutorial but I don't know if it works for mobile web apps.
http://mobile.tutsplus.com/tutorials/android/android-sdk-implement-a-share-intent/

If your web app is wrapped in a native layer (via Phonegap or by manually creating the native layer yourself), you can communicate your intention to share to the native layer by various means (like providing a url with a custom protocol that only your native layer intercepts, or via javascript callback functions) and delegate the share intent to your native layer.
Any data needed to be shared can be parsed from the custom url or be passed as parameters in the callback function.

Related

Custom Share Function - how could an app use the same login instance used by another app on a user's device

Is there a way that an iOS and/or Android App can take advantage of the fact that a user is already logged in to Messenger on their device.
Take a custom share function. Instead of using the native share functionality of Android and iOS (Not good enough for the requirements of my app) a custom one exists that, after some criteria are interpreted by this app's api, loads the effective web version of the Messenger app overlayed on my app pretty much as a web view or effective iFrame in web vernacular.
However, it will load the login screen of messenger as the local browser of my app displayed through the web viewer is not logged into Messenger. The owner of the device is however logged into messenger on their phone or tablet via the messenger App.
The objective is that they do not have to log in again separately on this app and can proceed straight to the effective share screen of the web version of messenger.
To do this, the app would have to know that the user was already logged in on this device and use the same session instance (I presume). Is that possible?
If it is not possible, how does the native iOS share screen of Apple's own Apps (take Safari as an example) show the relevant share page of messenger without having to open the app? The same is true for other share options. Whilst many of these are Apple's own (Mail etc..), others are not including Messenger and LinkedIN.
PS.. forgive the use of the phrase "My App", this was simply to avoid confusion over whether Messenger or not was being referred to.

Pass Data from Angular6 Micro App to Mobile Application

I have an application in Android (Kotlin) and iOS (Swift 4) that opens a micro app in a WebView which I made using Angular6.
There is a button in my web app that enable users to sync a date to their respective calendar.
What is the best way to pass data from my web application to my native application?
If I understand your problem correctly you can try using Firebase Dynamic Links. From inside the web app the users would select to sync the data then that will open the dynamic link which will bring them back into the native Android or iOS app. These dynamic links can store small amounts of data which you can read in once you've handled the deep link. See this sample code for Android.

Access CloudKit from Android?

Is it possible to use CloudKit Web Service from Android native app? How will that authentication popup window appear in a native app if I want to let user able to modify records?
Can I put a button to the native app, that will open up browser and the redirected content will appear there, and when authentication successfull, specify a callback where token which uniquely identifies users, I guess user record name can be received?
Apple engineer talks about login from web here on this session video: https://developer.apple.com/videos/wwdc/2015/?id=704
CloudKit Web Services is intended "to provide a web interface for users". If you use it to provide a native Android interface, you will probably get your iOS app rejected and lose your CloudKit access entirely.
But if you want to try it, Apple already has documentation for CloudKit Web Services which explains how to authenticate users.
From looking at the session video you mention, and also at the links and comments from Richard, I would say the answer is No to writing full native Android CloudKit apps. The reason is that Apple does not give you the option to enter the userID and password in your own dialog. The user can enter those only in a web window popped up by the apple code. So it seems at least that part of the app (authenticating the user) needs to be done using web code. I am not an Android programmer so perhaps it is possible to put together a hybrid app that addresses this issue.
Having said that, public database access does not require an iCloud account so you may be able to write an app that only uses access to the public part of your container using native Android code.
I am no expert but this is what I read on Apple website.
Use an API Token from a website or an embedded web view in a native app, or when you need to authenticate the user.
Maybe its like Netflix. Because Netflix iOS app looks just like netflix.com. To me it looks like netflix is using embedded web view. Maybe you can do the same with CloudKit.

Facebook Share From Mobile Web to Native App Without Javascript?

I am looking to let a reader of my site share the url from a mobile browser to their native facebook app without using javascript, or having them login through the cumbersome web process.
In the past, this was accomplished using the fb://publish/profile/me?text=blah url scheme for both iOS and Android. When clicked, this link would open the native app and start a new share dialog.
Sometime in late 2013/early 2014 though, this method stopped working. Is there a more current way to use a static URL to open up a native share dialog on iOS and/or an Android Intent? A canonical answer is needed here as searching SO leads to a ton of old, deprecated dead ends.
It's crazy that facebook doesn't have the latest URI schemes documented. Whatsapp, twitter, mail, sms, tel all have them available and are working.
Whatsapp:
whatsapp://send?text=Hello%20World!
Twitter:
twitter://post?message=hello%20world!
Mail:
mailto:<address>[?<header1>=<value1>[&<header2>=<value2>]]
SMS:
sms:+15105550101?body=hello%20there
Tel:
tel:<phonenumber>
I've been researching methods of HTML5 interaction with phone features (intents), maybe there is a way to open the mobile phone share menu from a web url? This would allow the user to share an article, per say, with any native app if installed (fb, twitter, etc...)
I don't know if you've come across this thread, but the guy seems like did some reverse engineering and has a full list of all Facebook custom URL schemes
In short there is NO official or unofficial way to do this anymore (or yet).
The URL schemes above described was never documented as an official way to open the the sharing dialog.
BUT
There is the new AppLinks framework.
The App Links framework is documented here
What it does is basically allows you to have meta tags on certain URLs that let you launch your (or any) app from Facebook. Basically Facebook checks if your page supports an app link and then links directly to your app
So, theoretically it should be simple to launch the Facebook app from your browser if you have it and if not load another link. (which is basically what you need). However even though Facebook created it they haven't put it on their pages yet. (in other words in the future these meta tags might work to open the apps).

JQuery Mobile app generic doubts

I am new to JQuery mobile .
Need some assistance to start with.
My plan is for a mobile application( cross platform android and Iphone ) which will get and update data to a webservice. This will be a set of htmls. I need to access gallery and camera so i think it should be integrated with PhoneGap.
Now the html pages are hosted in same domain as web service. While
integrating to Phonegap would like to know whether i need to move
Html to app or keep the htmls in remote server and put a web view to
load html from there. Basically in samples i have seen the app itself
with htmls , so would like to know best strategy.
In Android app there is a hardware back button. Basically i have
a login page, home page and detail pages. While in Home page if hardware back
button is pressed , i should ask for logout . I searched but dint get
idea to handle the same.
May be i will remove camera functionality and then it will be pure
JQuery Mobile and no Phonegap. SO this will be loaded in browser
directly in device. So if in JQuery mobile only also , can this hardware back
button be handled.
Please guide me in right direction.
-Thanks in advance
mia
In reply to your first point: the practice of hosting the full html pages in a remote server is usually forbidden by the app stores (at least iOS having read the guidelines recently).
You should instead only retrieve data from the server (in the form of json/xml for instance). For this very purpose you can create your mobile app using Backbone, or any other MVC/MVVC platform.
Your base pages will be in the app -displayed by phonegap webview- along with some templates. Every time the user goes to another page, you fetch some json data from the server and then process your data with the templates to generate full html.
This process makes more sense than serving full html pages (which is then more a mobile site than a mobile app) as only the data (what is dynamic) is sent from the server, which makes the payload smaller (better for mobile devices with limited bandwidth capabilities).
For the second point, I guess you mean when the app is closed or put in the background through this back button you want to call a logout function in your app. You'll need to catch a system event, but that's not something you can handle directly in Phonegap and you'll need some native java coding for that.. but first check the phonegap plugins for such feature but I haven't seen any.
For the third point, if you say you don't want to use phonegap your 'mobile app' will become only a 'mobile site'. which is fine, but then you'll have even less control over that "back button". You'll only be able to control web events like window close (beforeunload).
It is possible to have the full HTML on the server and I have had an app approved for the iOS app store with this method. However there are obvious downsides including the fact that you lose off-line capabilities.
You can add an event listener for the back button document.addEventListener('backbutton', onBackButton, false);
As far as I know you cannot handle the back button with a mobile site.

Categories

Resources