示例#1
0
        private void checkQueue()
        {
            StomtCreation stomtCreation = StomtOfflineQueue <StomtCreation> .pop();

            if (stomtCreation != null)
            {
                Debug.Log("Send queued Stomt: " + stomtCreation);
                this.SendStomt(stomtCreation);
                return;
            }

            StomtSubscription stomtSubscription = StomtOfflineQueue <StomtSubscription> .pop();

            if (stomtSubscription != null)
            {
                Debug.Log("Send queued Subscription: " + stomtSubscription);
                this.SendSubscription(stomtSubscription);
                return;
            }

            StomtTrack stomtTrack = StomtOfflineQueue <StomtTrack> .pop();

            if (stomtTrack != null)
            {
                Debug.Log("Send queued Track: " + stomtTrack);
                this.SendTrack(stomtTrack);
                return;
            }
        }
示例#2
0
        public void SendTrack(StomtTrack track, Action <LitJsonStomt.JsonData> callbackSuccess = null, Action <HttpWebResponse> callbackError = null)
        {
            var url = string.Format("{0}/tracks", restServerURL);

            GetPOSTResponse(url, track.ToString(), callbackSuccess, callbackError, () => {
                StomtOfflineQueue <StomtTrack> .add(track);
            });
        }
示例#3
0
        // Track Handling
        public StomtTrack initStomtTrack()
        {
            StomtTrack stomtTrack = new StomtTrack();

            stomtTrack.device_platform = Application.platform.ToString();
            stomtTrack.device_id       = SystemInfo.deviceUniqueIdentifier;
            stomtTrack.sdk_type        = "Unity" + Application.unityVersion;
            stomtTrack.sdk_version     = this.Version;
            stomtTrack.sdk_integration = Application.productName;
            stomtTrack.target_id       = StomtConfig.TargetID;

            return(stomtTrack);
        }