 angular.module("proBebe.services", ["proBebe.constants"]).factory "Friends", ->
   # Some fake testing data
   friends = [
-    {
-      id: 0
-      name: "Scruff McGruff"
-    }
-    {
-      id: 1
-      name: "G.I. Joe"
-    }
-    {
-      id: 2
-      name: "Miss Frizzle"
-    }
-    {
-      id: 3
-      name: "Ash Ketchum"
-    }
+    { id: 0, name: "Scruff McGruff" }
+    { id: 1, name: "G.I. Joe" }
+    { id: 2, name: "Miss Frizzle" }
+    { id: 3, name: "Ash Ketchum" }
   ]
   all: ->
     friends

          push.unregister ->
            console.info('unregister success')


# ALL GCM notifications come through here.
onNotificationGCM = (e) ->
  console.log("EVENT RECEIVED: #{e.event} ")

      # you might want to play a sound to get the user's attention, throw up a dialog, etc.
      if (e.foreground)
        # we're using the app when a message is received.
        console.log('--INLINE NOTIFICATION--')
        # if the notification contains a soundname, play it.
        # my_media = new Media("/android_asset/www/#{e.soundname}")
        # my_media.play()
        alert(e.payload.message)
      else
        window.open(e.payload.article_url, "_system")
        # otherwise we were launched because the user touched a notification in the notification tray.
        if (e.coldstart)
          console.log('--COLDSTART NOTIFICATION--')
        else
          console.log('--BACKGROUND NOTIFICATION--')
      console.log('MESSAGE -&gt MSG: ' + e.payload.message + '')
      console.log('MESSAGE: '+ JSON.stringify(e.payload))
    when 'error'
      console.log('ERROR -&gt MSG:' + e.msg + '')
    else
      console.log("Unknown event sent: #{e.event}")
