Question: I am trying to implement push notifications for MonoTouch but I couldn´t find samples of this anywhere. My problem is trying to read the deviceID into a .NET string. 

The output below is just a lot of question marks so I am doing something wrong here. 

Any help would be greatly appreciated!

```
    public override void RegisteredForRemoteNotifications (UIApplication application, NSData deviceToken)
    {
        Console.WriteLine("Converting device ID...");
        NSString s = NSString.FromData(deviceToken, NSStringEncoding.UTF8);
        Console.WriteLine("DEVICE ID IS: " + s);
        s = NSString.FromData(deviceToken, NSStringEncoding.ASCIIStringEncoding);
        Console.WriteLine("DEVICE ID IS: " + s);
         s = NSString.FromData(deviceToken, NSStringEncoding.Unicode);
        Console.WriteLine("DEVICE ID IS: " + s);

    }

```

Answer: 
There is an operator for implicit conversion in MonoTouch.

So you just do:

```
NSString s = NSString.FromData(deviceToken, NSStringEncoding.UTF8);
string csstring = s;
// done

```

Alternatively, you can use `NSString`'s `ToString()` method:

```
NSString s = NSString.FromData(deviceToken, NSStringEncoding.UTF8);
string csstring = s.ToString();

```

[Here's](http://www.go-mono.com/docs/monodoc.ashx?link=T%3aMonoTouch.Foundation.NSString) related documentation.
I've managed to implement this, and I used the following code:

```
NSString newDeviceToken = new NSString(MonoTouch.ObjCRuntime.Messaging.IntPtr_objc_msgSend_IntPtr_IntPtr(new MonoTouch.ObjCRuntime.Class("NSString").Handle, new MonoTouch.ObjCRuntime.Selector("stringWithFormat:").Handle, strFormat.Handle, deviceToken.Handle));
string token = newDeviceToken.ToString();

```

This will provide you with a string which reads

```
< 64characterlonghexstring >

```

You can use a Regex to get rid of the spaces and the "<" ">" character as required. 

I found the following project very useful in getting a Monotouch implementation of push notifications working:
[C# Apple Push Notification Service](http://code.google.com/p/apns-sharp/) - it provides client side code as well as server side code.