Register to receive remote notifications of the specified types from a provider via Apple Push Service.
NotificationServices.deviceToken. function Start() {
NotificationServices.RegisterForRemoteNotificationTypes(RemoteNotificationType.Alert |
RemoteNotificationType.Badge |
RemoteNotificationType.Sound);
} function Update () {
if (!tokenSent) {
var token : byte[] = NotificationServices.deviceToken;
if (token != null) {
// send token to a provider
var hexToken : String = "%" + System.BitConverter.ToString(token).Replace('-', '%');
new WWW("http://"+address+"/?token="+hexToken);
tokenSent = true;
}
}
}