1

Is there way to identify android/ios app user for sure without requesting him to signup with google/email/facebook?

I'd like to implement this: User downloads app from PlayMarket/AppStore, app identifies him somehow and sends data about this user to server. By "data about this user" i mean only the data gathered based on user's actions in app, like misc preferences and settings. If user will uninstall app and install it again to different device but with the same google account, he should be properly identified as the one who used the app before.

stkvtflw
  • 12,092
  • 26
  • 78
  • 155
  • On iOS you can store their settings in iCloud (if they have logged in to iCloud). This will then synchronise to any other devices with the same iCloud account. – Paulw11 Sep 14 '16 at 21:27

1 Answers1

1

in android you can collect the email address without asking the user if he/she logged in google account in the device:

Account account = getAccount(AccountManager.get(getApplicationContext()));

    if (account == null) {
        String accountName = "user did not provide email";
    } else {
        String accountName = account.name;
    }

public static Account getAccount(AccountManager accountManager) {
    Account[] accounts = accountManager.getAccountsByType("com.google");
    Account account;
    if (accounts.length > 0) {
        account = accounts[0];
    } else {
        account = null;
    }
    return account;
}

Another way, you can take the device id. But it wont fulfill you need if the user change the device and not logged in the google account. To get device id:

import android.provider.Settings.Secure;
String deviceId = Secure.getString(getContext().getContentResolver(),
                                                Secure.ANDROID_ID);
Tushar Monirul
  • 4,944
  • 9
  • 39
  • 49
  • Impressive :) I thought, google protects my data. Any guesses how to do the same for iOS? – stkvtflw Sep 15 '16 at 10:42
  • unfortunately I am not an iOS developer. But I think you can get help from here: http://stackoverflow.com/questions/4893099/getting-users-default-email-address-in-cocoa – Tushar Monirul Sep 15 '16 at 10:49