title: How to write APNs server side code in scala?
body: <p>I'm stuck at a very annoying problem.</p>
  
  <p>I'm working with javaPNS and following one of the many guides on internet. </p>
  
  <p>Here: <a href="https://code.google.com/p/javapns/wiki/PushNotificationAdvanced" rel="nofollow">https://code.google.com/p/javapns/wiki/PushNotificationAdvanced</a></p>
  
  <pre><code> /* Push your custom payload */ 
      List&lt;PushedNotification&gt; notifications = Push.payload(payload, keystore, password, production, devices);
  </code></pre>
  
  <p>where you see this, above. It says that Push.payload() returns a List with PushedNotificaion.
  Well, it doesn't in my code. </p>
  
  <pre><code>object Push {
  
  def devPush(pushAlertMessage: String, badgeNumber: Int, devices: Seq[String]): List[PushedNotification] = {
  
  //Retrieve the .p12 certification file
  val keystoreFile = getClass.getResourceAsStream("keystorefile.p12")
  
  //Create payload
  val payload = PushNotificationPayload.complex()
  payload.addBadge(badgeNumber)
  payload.addAlert(pushAlertMessage)
  payload.addSound("default")
  
  //
  val notifications:List[PushedNotification] = javapns.Push.payload(payload, keystoreFile, keystorePassword, false, devices)
  
  for(notification &lt;- javapns.Push.alert(pushAlertMessage, keystoreFile, keystorePassword, false, devices).getFailedNotifications){
      /* Add code here to remove invalid tokens from database */
  }
  
  notifications
  }
  }
  </code></pre>
  
  <p>When I try to put a list in my val notifications with Push.payload it says:</p>
  
  <p>"Express of type PushedNotifications doesn't conform to expected type List[PushedNotification]"</p>
  
  <p>I'm tired and confused, not certain about the rest of the code either. Would appreciate any help and please. Correct my code if I'm wrong. </p>