예제 #1
0
        //register this app/user with the push messaging system.
        //This should only happen once per install
        public static void RegisterForMessages()
        {
            chosenUsername = Xdk.device.uuid; //set a default unique username for the purposes of push

            if (chosenUsername.IndexOf("emulated") != -1)
            {
                Xdk.cache.RemoveCookie("pushmobi_username");
                chosenUsername = Rnd(99999).As <JsString>();
            }

            //If this device is already registered, just check for new notifications
            if (Xdk.cache.GetCookie("pushmobi_username") == undefined)
            {
                try
                {
                    Xdk.notification.AddPushUser(chosenUsername, chosenPassword, chosenEmail);
                }
                catch (JsError e) { Alert("error adding push user: " + e.message); }
            }
        }
예제 #2
0
        //register this app/user with the push messaging system.
        //This should only happen once per install
        public static void RegisterForMessages()
        {
            chosenUsername = Xdk.device.uuid; //set a default unique username for the purposes of push

            if (chosenUsername.IndexOf("emulated") != -1)
            {
                Xdk.cache.RemoveCookie("pushmobi_username");
                chosenUsername = Rnd(99999).As<JsString>();
            }

            //If this device is already registered, just check for new notifications
            if (Xdk.cache.GetCookie("pushmobi_username") == undefined)
            {
                try
                {
                    Xdk.notification.AddPushUser(chosenUsername, chosenPassword, chosenEmail);
                }
                catch (JsError e) { Alert("error adding push user: " + e.message); }
            }
        }