Exemplo n.º 1
0
    void OnGUI()
    {
        str_unity = GUILayout.TextField(str_unity, GUILayout.Width(500), GUILayout.Height(150));

        if (GUILayout.Button("initJPush", GUILayout.Height(80)))
        {
            JPushTriggerManager.triggerInitJPush(CustomEventObj.EVENT_INIT_JPUSH);
        }
        if (GUILayout.Button("stopJPush", GUILayout.Height(80)))
        {
            JPushTriggerManager.triggerStopJPush(CustomEventObj.EVENT_STOP_JPUSH);
        }
        if (GUILayout.Button("resumeJPush", GUILayout.Height(80)))
        {
            JPushTriggerManager.triggerResumeJPush(CustomEventObj.EVENT_RESUME_JPUSH);
        }
        if (GUILayout.Button("setTags", GUILayout.Height(80)))
        {
            JPushTriggerManager.triggerSetTags(CustomEventObj.EVENT_SET_TAGS, str_unity);
        }
        if (GUILayout.Button("setAlias", GUILayout.Height(80)))
        {
            JPushTriggerManager.triggerSetAlias(CustomEventObj.EVENT_SET_ALIAS, str_unity);
        }

        if (GUILayout.Button("showMessage", GUILayout.Height(80)))
        {
            str_unity = str_message;

            /*if(B_MESSAGE) {
             *      str_unity = str_message ;
             *      B_MESSAGE = false ;
             * } else {
             *      //TODO no message
             *      str_unity = "no message" ;
             * }*/
        }

        if (GUILayout.Button("addTrigger---setPushTime", GUILayout.Height(80)))
        {
            // add a event
            JPushEventManager.instance.addEventListener(CustomEventObj.EVENT_SET_PUSH_TIME, gameObject, "setPushTime");

            string days       = "0,1,2,3,4,5,6";
            string start_time = "10";
            string end_time   = "18";
            JPushTriggerManager.triggerSetPushTime(CustomEventObj.EVENT_SET_PUSH_TIME, days, start_time, end_time);
        }
        if (GUILayout.Button("removeTrigger---setPushTime", GUILayout.Height(80)))
        {
            // remove a single event
            JPushEventManager.instance.removeEventListener(CustomEventObj.EVENT_SET_PUSH_TIME, gameObject);
        }
    }
Exemplo n.º 2
0
    void OnGUI()
    {
        str_unity = GUILayout.TextField(str_unity, GUILayout.Width(Screen.width - 80),
                                        GUILayout.Height(200));

        if (GUILayout.Button("initJPush", GUILayout.Height(80)))
        {
            JPushTriggerManager.triggerInitJPush(CustomEventObj.EVENT_INIT_JPUSH);
        }

        if (GUILayout.Button("stopJPush", GUILayout.Height(80)))
        {
            JPushTriggerManager.triggerStopJPush(CustomEventObj.EVENT_STOP_JPUSH);
        }

        if (GUILayout.Button("resumeJPush", GUILayout.Height(80)))
        {
            JPushTriggerManager.triggerResumeJPush(CustomEventObj.EVENT_RESUME_JPUSH);
        }

        if (GUILayout.Button("setTags", GUILayout.Height(80)))
        {
            JPushTriggerManager.triggerSetTags(CustomEventObj.EVENT_SET_TAGS, str_unity);
        }

        if (GUILayout.Button("setAlias", GUILayout.Height(80)))
        {
            JPushTriggerManager.triggerSetAlias(CustomEventObj.EVENT_SET_ALIAS, str_unity);
        }

        if (GUILayout.Button("addLocalNotification", GUILayout.Height(80)))
        {
            JPushBinding.addLocalNotification(0, "content", "title", 1, 0, null);
        }

        if (GUILayout.Button("getRegistrationId", GUILayout.Height(80)))
        {
            string registrationId = JPushBinding.getRegistrationId();
            Debug.Log("------>registrationId: " + registrationId);
        }

        if (GUILayout.Button("showMessage", GUILayout.Height(80)))
        {
            str_unity = str_message;

            /*if(B_MESSAGE) {
             * str_unity = str_message;
             * B_MESSAGE = false;
             * } else {
             * //TODO no message
             * str_unity = "no message";
             * }*/
        }

        if (GUILayout.Button("addTrigger---setPushTime", GUILayout.Height(80)))
        {
            // add a event
            JPushEventManager.instance.addEventListener(
                CustomEventObj.EVENT_SET_PUSH_TIME, gameObject, "setPushTime");
            string days       = "0,1,2,3,4,5,6";
            int    start_time = 10;
            int    end_time   = 18;
            JPushTriggerManager.triggerSetPushTime(
                CustomEventObj.EVENT_SET_PUSH_TIME, days, start_time, end_time);
        }

        if (GUILayout.Button("removeTrigger---setPushTime", GUILayout.Height(80)))
        {
            // remove a single event
            JPushEventManager.instance.removeEventListener(
                CustomEventObj.EVENT_SET_PUSH_TIME, gameObject);
        }
    }