Invalid DeviceToken Length when sending passkit push by PushSharp
<p>I try to use PushSharp in an Apple passkit related project.</p>

<p>My current problem is about passkit pushes.  </p>

<p>When I try to create my notification, it says</p>

<blockquote>
  <p>device tokent length is invalid (exact exception message: Invalid DeviceToken Length.</p>
</blockquote>

<pre><code>var notif = new ApnsNotification(token, payload);
</code></pre>

<p>When I register a new passkit coupon, its token length is 32. It seems ok for me.</p>

<p>What should be the problem? Does PushSharp support passkit at all? As I see, some people used it, but I could not find any <em>Official</em> info about it.</p>

<p>Please note, I know PushSharp as I use it to send <em>Normal</em> push messages, it has been working for years without any problem for me. My question is about passkit-related pushes.</p>

<p>Thanks very much!</p>

<p><strong>EDIT</strong></p>

<p>After changing the code by Baris Akar's suggestions, the problem is fixed, but another comes:</p>

<p><code>Apple Notification Failed: ID=1, Code=ConnectionError</code></p>

<blockquote>
  <p>2016-11-18 11:07:22.de. [INFO] Stopping: Waiting on Tasks 2016-11-18
  11:07:22.de. [INFO] Waiting on all tasks 1 2016-11-18 11:07:22.de.
  [INFO] APNS-Client[1]: Sending Batch ID=1, Count=1
  <strong>2016-11-18 11:07:22.de. [INFO] APNS-Client[1]: Sent Batch, waiting for possible response... Apple Notification Failed: ID=1,
  Code=ConnectionError</strong> 2016-11-18 11:07:22.de. [INFO] All Tasks
  Finished 2016-11-18 11:07:22.de. [INFO] Passed WhenAll 2016-11-18
  11:07:22.de. [INFO] Broker IsCompleted 2016-11-18 11:07:22.de. [DEBUG]
  Broker Task Ended 2016-11-18 11:07:22.de. [INFO] Stopping: Done
  Waiting on Tasks 2016-11-18 11:07:22.de. [INFO] APNS-Client[1]: Done
  Reading for Batch ID=1, reseting batch timer...</p>
</blockquote>