You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2022/07/08 13:42:46 UTC

[GitHub] [cordova-plugin-device] BigBalli commented on a diff in pull request #168: (iOS) Add support for device name on iOS

BigBalli commented on code in PR #168:
URL: https://github.com/apache/cordova-plugin-device/pull/168#discussion_r916829576


##########
src/ios/CDVDevice.m:
##########
@@ -86,10 +86,14 @@ - (void)getDeviceInfo:(CDVInvokedUrlCommand*)command
 - (NSDictionary*)deviceProperties
 {
     UIDevice* device = [UIDevice currentDevice];
+	//strip non-alphanumeric from device name
+    NSCharacterSet *charactersToRemove = [[NSCharacterSet alphanumericCharacterSet] invertedSet];
+    NSString *deviceName = [[[device name] componentsSeparatedByCharactersInSet:charactersToRemove] componentsJoinedByString:@""];

Review Comment:
   True, Apple's documentation states "alphanumeric string" but from experience it is not so.
   You can go change your device's name to anything you want (ie no forbidden characters).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org