How do Google's G Suite Apps share data?
Asked Answered
M

2

7

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?

Moreville answered 27/1, 2017 at 20:44 Comment(4)
Maybe because you're using that same account on an installed GSuite app.Sylvanite
Just to clarify I need to know HOW they suggest the same account when I add a NEW Google App. Not when I already logged in. But before I did anything, they know I have this account on the other apps.Moreville
I'm not sure how they do it cross-platform. But here's how they do it on Android: When you install a Google App, the account is saved on your device (you can even manage it from Settings). So when you download another Google App, they suggest using the app that is already added to the deviceSylvanite
Let's say I install GMail. I sign in with my account. Now I install another app such as Inbox or Google Maps. How does it know to present to me MY account that I signed in with in GMail?? That's the question. Especially on iOS.Moreville
E
3

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

Equilibrate answered 6/2, 2017 at 3:52 Comment(1)
Yes! App Group! That's it :)Moreville
G
2

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:

  • Sharing access to your application data with other applications;
  • Sending data to a widget;
  • Returning custom search suggestions for your application through the search framework;
  • Synchronizing application data with your server;
  • Loading data in your UI.

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.

Gigantes answered 3/2, 2017 at 11:16 Comment(1)
I think when it comes to iOS, they don't use the UIPasteboard. That is for copying and pasting. I think they might use the Advertising Identifier or something. And similar on Android?Moreville

© 2022 - 2024 — McMap. All rights reserved.