I'm using Cordova and the band would be required for display purposes. I could have the user input it, but if I can snag it programmatically that'd be preferred.
-
The device object holds some of the required information such as name,uuid, platform,version, model . you could use it as such . device.name device.cordova device.platform device.uuid device.version device.model – IamKarim1992 Apr 02 '16 at 20:21
-
@IamKarim1992 I need the users full name "Bob Jones" for example. If it's not possible programmatically I'll settle for user input. – edhedges Apr 02 '16 at 20:23
-
So, where in the device could u find that ? – IamKarim1992 Apr 02 '16 at 20:23
-
@IamKarim1992 that's what I'm asking. – edhedges Apr 02 '16 at 23:24
2 Answers
Ok , There are couple of Android implementation to accomplish that , U have to wrap that as a plugin which returns the result after onDeviceReady
. The Android Implementations are
1.You can try to access their information stored in a Google account, requiring the GET_ACCOUNTS permission
2.There is also a READ_PROFILE permission and which can be done by accesing ContactsContract.CommonDataKinds` , but it gives only a possibility of finding user info. U have to check Android Version as well .
So Basically all the Android Native code would be wrapped as Cordova Plugin which returns u a possible dataset of values.
See These Links as well.
http://developer.android.com/reference/android/provider/ContactsContract.CommonDataKinds.html
https://gist.github.com/imminent/4061516
This is Android Implementation but it could me made as a plugin .
How to make a cordova plugin :- http://www.mat-d.com/site/tutorial-creating-a-cordova-phonegap-plugin-for-android-app/
Some StackOverflow links
How can I get the google username on Android?
I have done something similar with my project , it gets user details and user specific role from a private AppStore and renders Different UI and Screens Based on Roles.
Hope this Helps.

- 1
- 1

- 646
- 5
- 20
On iOS you'll have to create a plugin that executes this code
[[UIDevice currentDevice]name]

- 51,328
- 11
- 132
- 176