 		}
 		
 		dict["aps"] = aps
-		
-		return try dict.jsonEncodedString()
+		do {
+			return try dict.jsonEncodedString()
+		}
+		catch {}
+		return "{}"
 	}
 }
 


	}
	
	/// Push one message to one device.
	/// Provide the previously set configuration name, device token.
	/// Provide the expiration and priority as described here:
	///		https://developer.apple.com/library/mac/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/APNsProviderAPI.html
	/// Provide a list of IOSNotificationItems.
	/// Provide a callback with which to receive any errors which may have occurred.
	/// nil is passed to the callback if the push was successful.
	public func pushIOS(configurationName: String, deviceToken: String, expiration: UInt32, priority: UInt8, notificationItems: [IOSNotificationItem], callback: (errorMessage: String?) -> ()) {
		
		do {
			let jsond = try self.itemsToPayloadString(notificationItems)

	}
}

public struct NotificationResponse {
	public let code: Int
	public let body: [UInt8]
	public var jsonObjectBody: [String:Any] {
		do {
			if let json = try self.stringBody.jsonDecode() as? [String:Any] {
				return json
			}
		}
		catch {}
		return [String:Any]()
	}
	public var stringBody: String {
		return UTF8Encoding.encode(self.body)
	}
}

/// The interface for APNS notifications.
public class NotificationPusher {
	
	/// On-demand configuration for SSL related functions.
	public typealias netConfigurator = (NetTCPSSL) -> ()
	
	/// Toggle development or production on a global basis.
	public static var development = false
	
	var responses = [NotificationResponse]()
	
	static var idCounter = 0
	
