cordova-plugin-device icon indicating copy to clipboard operation
cordova-plugin-device copied to clipboard

Ability to get the device name

Open sagrawal31 opened this issue 3 years ago • 4 comments

Feature Request

I think this is a very important piece of information this plugin can offer. For example, writing device.name can give me- Shashank's iPhone or My Samsung J6.

Motivation Behind Feature

Only one motivation- Avoid installing one more plugin.

There is one plugin already available https://github.com/becvert/cordova-plugin-device-name which does the job but since this official Cordova plugin is already giving device information so why not include name.

I have seen many developers finding the name in this official Cordova plugin.

Feature Description

Get the device's name from the APIs as implemented here-

  • Android- https://github.com/becvert/cordova-plugin-device-name/blob/1.3.5/src/android/net/becvert/cordova/DeviceName.java#L32-L50
  • iOS- https://github.com/becvert/cordova-plugin-device-name/blob/1.3.5/src/ios/CDVDeviceName.m#L11-L15

Alternatives or Workarounds

https://github.com/becvert/cordova-plugin-device-name

sagrawal31 avatar Sep 17 '20 11:09 sagrawal31

PR's welcome!

timbru31 avatar Sep 18 '20 09:09 timbru31

Yes @timbru31 already working on it

sagrawal31 avatar Sep 18 '20 11:09 sagrawal31

Dear @sagrawal31 any update on this request ? the device.name will be introduced in next release ? thank you

nfmobile avatar Aug 26 '21 11:08 nfmobile

Hi, @nfmobile I can do it for Android but I have limited knowledge of iOS. I'll create a PR.

sagrawal31 avatar Aug 27 '21 04:08 sagrawal31

Closing as won’t do, since iOS 16 it’s a sensitive piece of information and the native API no longer returns the value unless you request a special entitlement and Apple approves it if they consider it’s appropriate for your app.

https://developer.apple.com/documentation/uikit/uidevice/1620015-name

jcesarmobile avatar Feb 06 '24 22:02 jcesarmobile