Created
September 11, 2017 11:48
-
-
Save Pulimet/f79d4863a2198f1887c46aee23f2b038 to your computer and use it in GitHub Desktop.
Get advertising id
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String getAdvertisingId() { | |
try { | |
return AdvertisingIdClient.getAdvertisingIdInfo(Contextor.getInstance().getContext()).getId(); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} catch (GooglePlayServicesNotAvailableException e) { | |
e.printStackTrace(); | |
} catch (GooglePlayServicesRepairableException e) { | |
e.printStackTrace(); | |
} | |
return null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment