Example #1
0
	public void NotiReceived()
	{
		Debug.Log("AlertBody : "+UnityEngine.iOS.NotificationServices.remoteNotifications[0].alertBody);
		ICollection col = UnityEngine.iOS.NotificationServices.remoteNotifications[0].userInfo.Keys;
		IEnumerator enu = col.GetEnumerator();
		while(enu.MoveNext()){
			Debug.Log ("key : "+enu.Current);
		}
		//		for(int i = 0; i < col.Count; i++){
		//			Debug.Log("key("+i+") : "+col.);
		//			Debug.Log("value("+i+") : "+UnityEngine.iOS.NotificationServices.remoteNotifications[0].userInfo.Values[i]);
		//		}
		string type = UnityEngine.iOS.NotificationServices.remoteNotifications[0].userInfo["type"].ToString();
		string info = UnityEngine.iOS.NotificationServices.remoteNotifications[0].userInfo["info"].ToString();
		
		//		Dictionary<string, object> dic = new Dictionary<string, object>();
		NotiMsgInfo notiInfo = new NotiMsgInfo();
		notiInfo.type = type;
		notiInfo.info = Newtonsoft.Json.JsonConvert.DeserializeObject<NotiQuizInfo>(info);
		//		dic.Add("type", type);
		//		dic.Add("info", quizInfo);
		
//		Debug.Log("NotiReceived : "+UtilMgr.OnPause);
//		if(!UtilMgr.OnPause)
//			QuizMgr.NotiReceived (notiInfo);
		
		UnityEngine.iOS.NotificationServices.ClearRemoteNotifications();
	}
Example #2
0
    public void NotiReceived()
    {
        Debug.Log("AlertBody : " + UnityEngine.iOS.NotificationServices.remoteNotifications[0].alertBody);
        ICollection col = UnityEngine.iOS.NotificationServices.remoteNotifications[0].userInfo.Keys;
        IEnumerator enu = col.GetEnumerator();

        while (enu.MoveNext())
        {
            Debug.Log("key : " + enu.Current);
        }
        //		for(int i = 0; i < col.Count; i++){
        //			Debug.Log("key("+i+") : "+col.);
        //			Debug.Log("value("+i+") : "+UnityEngine.iOS.NotificationServices.remoteNotifications[0].userInfo.Values[i]);
        //		}
        string type = UnityEngine.iOS.NotificationServices.remoteNotifications[0].userInfo["type"].ToString();
        string info = UnityEngine.iOS.NotificationServices.remoteNotifications[0].userInfo["info"].ToString();

        //		Dictionary<string, object> dic = new Dictionary<string, object>();
        NotiMsgInfo notiInfo = new NotiMsgInfo();

        notiInfo.type = type;
        notiInfo.info = Newtonsoft.Json.JsonConvert.DeserializeObject <NotiQuizInfo>(info);
        //		dic.Add("type", type);
        //		dic.Add("info", quizInfo);

//		Debug.Log("NotiReceived : "+UtilMgr.OnPause);
//		if(!UtilMgr.OnPause)
//			QuizMgr.NotiReceived (notiInfo);

        UnityEngine.iOS.NotificationServices.ClearRemoteNotifications();
    }
Example #3
0
    public static void NotiReceived(string msg)
    {
        Debug.Log("ReceivedMsg : " + msg);
        NotiMsgInfo msgInfo = null;

//		msgInfo = JsonFx.Json.JsonReader.DeserializeObject<NotiMsgInfo> (msg);
        msgInfo = Newtonsoft.Json.JsonConvert.DeserializeObject <NotiMsgInfo>(msg);
        NotiReceived(msgInfo);
    }
Example #4
0
    public static void NotiReceived(NotiMsgInfo msgInfo)
    {
        Debug.Log("push type : " + msgInfo.type);
//		Debug.Log ("msgInfo.info.gameSeq : " + msgInfo.info.gameSeq);
//		Debug.Log ("msgInfo.info.scheduleSeq : " + msgInfo.info.scheduleSeq);
//		Debug.Log ("msgInfo.info.quizListSeq : " + msgInfo.info.quizListSeq);
//		Debug.Log ("msgInfo.info.quiz : " + msgInfo.info.quiz);
//		Debug.Log ("msgInfo.info.inning : " + msgInfo.info.inning);
//		Debug.Log ("msgInfo.info.score : " + msgInfo.info.score);

        if (msgInfo.type.Equals(Constants.POST_MSG))
        {
        }
        else if (msgInfo.type.Equals(Constants.POST_GAME_START))
        {
            Debug.Log("UserMgr.Schedule.gameSeq is " + UserMgr.Schedule.gameSeq);
            if (UserMgr.Schedule != null)
            {
                Debug.Log("msgInfo.info.gameSeq is " + msgInfo.info.gameSeq);
                if (UserMgr.Schedule.gameSeq == int.Parse(msgInfo.info.gameSeq))
                {
                    //	AutoFade.LoadLevel("SceneMain");
                }
            }
        }
        else if (msgInfo.type.Equals(Constants.POST_GAME_STATUS))
        {
            if (Instance.mMainTop != null)
            {
                bool hasQuiz = false;
                if (msgInfo.info.quiz != null &&
                    msgInfo.info.quiz.Equals("1"))
                {
                    if (QuizMgr.IsBettingOpended)
                    {
                        MoreQuiz = true;
//						Debug.Log ("MoreQuiz");
                    }
                    else
                    {
                        HasQuiz = true;
//						Debug.Log ("HasQuiz");
                    }
                }

                if (msgInfo.info.inning != null &&
                    msgInfo.info.inning.Equals("1"))
                {
                    NeedsDetailInfo = true;
                }
                else if (msgInfo.info.score != null &&
                         msgInfo.info.score.Equals("1"))
                {
                    NeedsDetailInfo = true;
                }
                else
                {
                    NeedsDetailInfo = false;
                }

//				Debug.Log ("RequestBoardInfo");
                Instance.mMainTop.RequestBoardInfo();
            }
        }
        else if (msgInfo.type.Equals(Constants.POST_QUIZ_RESULT) ||
                 msgInfo.type.Equals(Constants.POST_QUIZ_CANCEL))
        {
            if (Instance.mMainTop != null)
            {
                Instance.mMainTop.GetComponent <ScriptMainTop>().GetSimpleResult(int.Parse(msgInfo.info.quizListSeq));
            }
        }
    }
Example #5
0
    public static void NotiReceived(string msg)
    {
        Debug.Log("ReceivedMsg : " + msg);
        NotiMsgInfo msgInfo = JsonFx.Json.JsonReader.Deserialize <NotiMsgInfo> (msg);

        Debug.Log("push type : " + msgInfo.type);
//		Debug.Log ("msgInfo.info.gameSeq : " + msgInfo.info.gameSeq);
//		Debug.Log ("msgInfo.info.scheduleSeq : " + msgInfo.info.scheduleSeq);
//		Debug.Log ("msgInfo.info.quizListSeq : " + msgInfo.info.quizListSeq);

        if (msgInfo.type.Equals(Constants.POST_MSG))
        {
        }
        else if (msgInfo.type.Equals(Constants.POST_GAME_START))
        {
            //refresh schedule list
        }
        else if (msgInfo.type.Equals(Constants.POST_GAME_STATUS))
        {
            if (Instance.mMainTop != null)
            {
                bool hasQuiz = false;
                if (msgInfo.info.quiz != null &&
                    msgInfo.info.quiz.Equals("1"))
                {
                    if (QuizMgr.IsBettingOpended)
                    {
                        MoreQuiz = true;
                    }
                    else
                    {
                        HasQuiz = true;
                    }
                }

                if (msgInfo.info.inning != null &&
                    msgInfo.info.inning.Equals("1"))
                {
                    NeedsDetailInfo = true;
                }
                else if (msgInfo.info.score != null &&
                         msgInfo.info.score.Equals("1"))
                {
                    NeedsDetailInfo = true;
                }
                else
                {
                    NeedsDetailInfo = false;
                }

                Instance.mMainTop.RequestBoardInfo();
            }
        }
        else if (msgInfo.type.Equals(Constants.POST_QUIZ_RESULT))
        {
            if (Instance.mMainTop != null)
            {
                Instance.mMainTop.GetComponent <ScriptMainTop>().GetSimpleResult(int.Parse(msgInfo.info.quizListSeq));

//				Instance.mMainTop.mBetting.transform.FindChild("SprBetting")
//					.GetComponent<ScriptBetting>().UpdateHitterItem(int.Parse(msgInfo.info.quizListSeq));
            }
        }
    }