public MessagingService()
{
Types.AddClientClassMapping( "com.backendless.management.DeviceRegistrationDto", typeof( Messaging.DeviceRegistration ) );
Types.AddClientClassMapping( "com.backendless.services.messaging.MessageStatus", typeof( Messaging.MessageStatus ) );
Types.AddClientClassMapping( "com.backendless.services.messaging.PublishOptions", typeof( Messaging.PublishOptions ) );
Types.AddClientClassMapping( "com.backendless.services.messaging.DeliveryOptions", typeof( Messaging.DeliveryOptions ) );
Types.AddClientClassMapping( "com.backendless.services.messaging.PublishStatusEnum", typeof( Messaging.PublishStatusEnum ) );
Types.AddClientClassMapping( "com.backendless.services.messaging.Message", typeof( Messaging.Message ) );
#if WINDOWS_PHONE8
object deviceId;
if (!Microsoft.Phone.Info.DeviceExtendedProperties.TryGetValue("DeviceUniqueId", out deviceId))
{
deviceId = HostInformation.PublisherHostId;
if( deviceId == null )
throw new BackendlessException(new BackendlessFault(ExceptionMessage.NO_DEVICEID_CAPABILITY));
}
_deviceRegistrationDto = new DeviceRegistration
{
Os = "WP",
DeviceId = BitConverter.ToString( (byte[]) deviceId ).Replace( "-", "" ),
OsVersion = System.Environment.OSVersion.Version.Major.ToString( CultureInfo.InvariantCulture )
};
#elif UNITY
_deviceRegistrationDto = new DeviceRegistration();
#endif
}