title: AppBoy iOS push notifications
body: <p>I'm trying to set up iOS Push Notifications and I've been going round in circles for the past 4 hours and got nowhere.</p>
  <p>The app is written in Swift 2.3.</p>
  <p>I set up the AppBoy application...</p>
  <pre><code>Appboy.startWithApiKey(&quot;blahblahblahblah&quot;, inApplication:application, withLaunchOptions:launchOptions)
  </code></pre>
  <p>And I can see that there are users of the iOS app in the segment I created.</p>
  <p>In code I then register for notifications and use this code to send the device token up to AppBoy...</p>
  <pre><code>extension NSData {
    func hexString() -&gt; String {
      // &quot;Array&quot; of all bytes:
      let bytes = UnsafeBufferPointer&lt;UInt8&gt;(start: UnsafePointer(self.bytes), count:self.length)
      // Array of hex strings, one for each byte:
      let hexBytes = bytes.map { String(format: &quot;%02hhx&quot;, $0) }
      // Concatenate all hex strings:
      return hexBytes.joinWithSeparator(&quot;&quot;)
    }
  }
  </code></pre>
  <p>And this...</p>
  <pre><code>func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {
    let token = deviceToken.hexString()
  
    Appboy.sharedInstance()?.registerPushToken(token)
  }
  </code></pre>
  <p>However, when I update the filter on the Segment in AppBoy to filter by &quot;Push Enabled&quot; I get 0 devices. (I'm not even sure if Push Enabled is the correct filter?)</p>
  <p>As a secondary question. The certificate that I upload to AppBoy is telling me it is a &quot;Universal certificate&quot; and the newest method of delivering notifications. Is this the right certificate to upload to AppBoy?</p>
  <p>I have created a campaign with the segment I created and it shows as having one message delivered.</p>
  <p>But whatever I do nothing is coming through to my device.</p>
  <p>The version of the app installed on my device is the one downloaded and installed through Crashlytics.</p>
  <p>Thanks</p>
  <h1>Update</h1>
  <p>OK, so now I'm getting devices showing up as &quot;Push Enabled&quot; but when I try to send a push notification the error log in the developer console shows &quot;Error sending to a bad push token...&quot;</p>
  <p>The certificate I have shows like this...</p>
  <p><a href="https://i.stack.imgur.com/BXwre.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BXwre.png" alt="enter image description here" /></a></p>
  <p>Can anyone explain what I'm doing wrong? I have followed every troubleshooting guide and triple checked the setup and redone every step several times.</p>