It seems when you download a new Google Suite app for iOS - whether GMail, Inbox, Calendar or whatever - they offer you to log in with your account and already present to you the account you have logged in elsewhere.
The question is both for iOS and for Android.
I know that apps can use Safari or the new Safari WebView (Chrome Tabs in Android) and a permanent cookie to share data between apps. It's a bit clunky, and can be broken by the user deleting cookies. But other than that, it works.
Google seems to be using something else. AdvertisingID? How exactly do they achieve this feat of sharing data on both operating systems?
AppGroup allows data sharing between two different apps or even app and widgets by creating one common shared path (like document directory). Data saved over there can be accessed by any app which is associated with that particular AppGroup. It is an offline data sharing between apps. Communicating and persisting data between apps with App Groups
On Android:
They probably use Content Providers. As described in this link,
A content provider manages access to a central repository of data. A provider is part of an Android application, which often provides its own UI for working with the data. However, content providers are primarily intended to be used by other applications, which access the provider using a provider client object. Together, providers and provider clients offer a consistent, standard interface to data that also handles inter-process communication and secure data access.
A content provider coordinates access to the data storage layer in your application for a number of different APIs and components, these include:
TL;DR In short, Content Provider is a layer that allows you to share your database with other apps/widgets. So Google Probably has a Content Provider in every app which shares the accounts that have been used on this app.
On iOS:
Now I'm just an Android Developer, but after a quick Google Search, I found this post which talks about UIPasteBoard:
Use the UIPasteboard class to let a user to share data from one place to another within your app, and from your app to other apps. For sharing data with any other app, use the systemwide general pasteboard; for sharing data with another app from your team—that has the same team ID as the app to share from—use named pasteboards.
I can't assure you that this is exactly the way Google does it. But If I were to implement such thing across my apps, I would use this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With