         }
 
         private static function onStatus( event:StatusEvent ):void {
-
+            var responseJSON:Object = null;
+            switch( event.code ) {
+                case TOKEN_RECEIVED:
+                    responseJSON = JSON.parse( event.level );
+                    var length:int = mTokenListeners.length;
+                    for( var i:int = 0; i < length; ++i ) {
+                        mTokenListeners[i]( responseJSON.userId, responseJSON.pushToken );
+                    }
+                    return;
+            }
         }
 
         private static function log( message:String ):void {


package com.marpies.ane.onesignal {

    import flash.desktop.NativeApplication;
    import flash.events.InvokeEvent;
    import flash.events.StatusEvent;
    import flash.external.ExtensionContext;
    import flash.system.Capabilities;
    import flash.utils.Dictionary;

    public class OneSignal {


        private static var mContext:ExtensionContext;

        /* Event codes */
        private static const TOKEN_RECEIVED:String = "tokenReceived";

        /* Callbacks */
        private static var mTokenListeners:Vector.<Function> = new <Function>[];

        /* Misc */
        private static var mInitialized:Boolean;
