示例#1
0
    void Awake()
    {
        if (_instance != null)
        {
            DestroyImmediate(this);
        }

        IOSMessage.ClickMap("GameLaunch");
        AndroidMessage.ClickMap("GameLaunch");
        WebMessage.ClickMap("GameLaunch");

        _instance  = this;
        modleLayer = LayerMask.NameToLayer("Modle");
        UI3D_S     = LayerMask.NameToLayer("3DUI_S");
        UI3D_M     = LayerMask.NameToLayer("3DUI_M");
        UI3D_L     = LayerMask.NameToLayer("3DUI_L");

        canvas_S = GameObject.Find("Cube/MapRoot/TitleCanvas_S");
        canvas_M = GameObject.Find("Cube/MapRoot/TitleCanvas_M");
        canvas_L = GameObject.Find("Cube/MapRoot/TitleCanvas_L");
        canvas_S.gameObject.layer = DataManager.Instance.UI3D_S;
        canvas_M.gameObject.layer = DataManager.Instance.UI3D_M;
        canvas_L.gameObject.layer = DataManager.Instance.UI3D_L;

        StartCoroutine(LoadXml());
        lastDistance = Camera.main.orthographicSize;

        curCullingMask = Camera.main.cullingMask;
    }
示例#2
0
    void Awake()
    {
        DontDestroyOnLoad(gameObject);


        //Remove this line after uncommenting FixedUpdate function.
        IOSMessage.Create("Push registration disabled", "Uncomment 'FixedUpdate' function inside DeviceTokenListner class");
    }
示例#3
0
 void Awake()
 {
     if (_instance != null)
     {
         DestroyImmediate(this);
         return;
     }
     _instance = this;
 }
示例#4
0
 void Text_ClickEvent()
 {
     string[] array = this.target.name.Split('_');
     if (array.Length == 2)
     {
         IOSMessage.ClickMap(array[1]);
         AndroidMessage.ClickMap(array[1]);
     }
 }
 private void OnUrlCheckResultAction(ISN_CheckUrlResult result)
 {
     if (result.IsSucceeded)
     {
         IOSMessage.Create("Success", "The " + result.url + " is registered");
     }
     else
     {
         IOSMessage.Create("ERROR", "The " + result.url + " wasn't registered");
     }
 }
 private void OnImageSaved(SA.Common.Models.Result result)
 {
     IOSCamera.OnImageSaved -= OnImageSaved;
     if (result.IsSucceeded)
     {
         IOSMessage.Create("Success", "Image Successfully saved to Camera Roll");
     }
     else
     {
         IOSMessage.Create("ERROR", "Image Save Failed");
     }
 }
 private void OnScoresListLoaded(SA.Common.Models.Result res)
 {
     if (res.IsSucceeded)
     {
         loadedLeaderboard = GameCenterManager.GetLeaderboard(leaderboardId_1);
         IOSMessage.Create("Success", "Scores loaded");
     }
     else
     {
         IOSMessage.Create("Fail", "Failed to load scores");
     }
 }
 private void OnImageSaved(ISN_Result result)
 {
     IOSCamera.instance.OnImageSaved -= OnImageSaved;
     if (result.IsSucceeded)
     {
         IOSMessage.Create("Success", "Image Successfully saved to Camera Roll");
     }
     else
     {
         IOSMessage.Create("ERROR", "Image Save Failed");
     }
 }
示例#9
0
    private void ShowDevoceInfo()
    {
        ISN_Device device = ISN_Device.CurrentDevice;

        IOSMessage.Create("Device Info", "Name: " + device.Name + "\n"
                          + "System Name: " + device.SystemName + "\n"
                          + "Model: " + device.Model + "\n"
                          + "Localized Model: " + device.LocalizedModel + "\n"
                          + "System Version: " + device.SystemVersion + "\n"
                          + "Major System Version: " + device.MajorSystemVersion + "\n"
                          + "User Interface Idiom: " + device.InterfaceIdiom + "\n"
                          + "GUID in Base64: " + device.GUID.Base64String);
    }
示例#10
0
    //--------------------------------------
    // INITIALIZE
    //--------------------------------------


    void Awake()
    {
        IOSNotificationController.instance.RequestNotificationPermissions();

        IOSNotificationController.OnLocalNotificationReceived += HandleOnLocalNotificationReceived;

        if (IOSNotificationController.Instance.LaunchNotification != null)
        {
            ISN_LocalNotification notification = IOSNotificationController.Instance.LaunchNotification;

            IOSMessage.Create("Launch Notification", "Messgae: " + notification.Message + "\nNotification Data: " + notification.Data);
        }
    }
示例#11
0
    private void OnImageSaved(ISN_Result result)
    {
        IOSCamera.OnImageSaved -= OnImageSaved;
        NextButton.isEnabled    = true;

        if (result.IsSucceeded)
        {
            IOSMessage.Create("Success", "Image Successfully saved to Camera Roll");
        }
        else
        {
            IOSMessage.Create("Success", "Image Save Failed");
        }
    }
示例#12
0
    private void OnPostImageInstagram(IOSImagePickResult result)
    {
        if (result.IsSucceeded)
        {
            Destroy(drawTexture);

            drawTexture = result.Image;
        }
        else
        {
            IOSMessage.Create("ERROR", "Image Load Failed");
        }
        IOSSocialManager.Instance.InstagramPost(drawTexture, "Some text to share");
        IOSCamera.OnImagePicked -= OnPostImageInstagram;
    }
    void ActionTrunEnded(GK_TBM_EndTrunResult result)
    {
        GameCenter_TBM.ActionTrunEnded -= ActionTrunEnded;
        ISN_Logger.Log("ActionTrunEnded IsSucceeded: " + result.IsSucceeded);

        if (result.IsFailed)
        {
            IOSMessage.Create("ActionTrunEnded", result.Error.Message);
            ISN_Logger.Log(result.Error.Message);
        }
        else
        {
            GameCenter_TBM.PrintMatchInfo(result.Match);
        }
    }
示例#14
0
    private void OnImage(IOSImagePickResult result)
    {
        if (result.IsSucceeded)
        {
            mImg = result.image;
            byte[] bArr = result.image.EncodeToJPG();
            CreateReport(mImg, bArr);
        }
        else
        {
            IOSMessage.Create("ERROR", "Image Load Failed");
        }

        //		IOSCamera.instance.OnImagePicked -= OnImage;
        IOSCamera.OnImagePicked -= OnImage;
    }
示例#15
0
    private void TryDetectURL()
    {
        var url = SA.IOSNative.Core.AppController.LaunchUrl;

        if (!url.IsEmpty)
        {
            IOSMessage.Create("Open URL Detecetd", url.AbsoluteUrl);
        }


        var link = SA.IOSNative.Core.AppController.LaunchUniversalLink;

        if (!link.IsEmpty)
        {
            IOSMessage.Create("Launch Universal Link Detecetd", link.AbsoluteUrl);
        }
    }
示例#16
0
    private void OnImage(IOSImagePickResult result)
    {
        if (result.IsSucceeded)
        {
            //destroying old texture
            Destroy(drawTexture);

            //applaying new texture
            drawTexture = result.Image;
            IOSMessage.Create("Success", "Image Successfully Loaded, Image size: " + result.Image.width + "x" + result.Image.height);
        }
        else
        {
            IOSMessage.Create("ERROR", "Image Load Failed");
        }

        IOSCamera.OnImagePicked -= OnImage;
    }
示例#17
0
 public void OnClick()
 {
     meshRender = this.gameObject.GetComponent <MeshRenderer>();
     if (meshRender != null)
     {
         DataManager.Instance.str += "OnClick: " + this.name;
         meshRender.material.color = selectedColor;
     }
     try
     {
         IOSMessage.ClickMap(this.gameObject.name);
         AndroidMessage.ClickMap(this.gameObject.name);
         WebMessage.ClickMap(this.gameObject.name);
     }
     catch (Exception ex)
     {
         Debug.LogError("errr:" + ex.ToString());
     }
 }
    void OnAuthFinished(SA.Common.Models.Result res)
    {
        _IsUILocked = true;

        IOSMessage msg = null;

        if (res.IsSucceeded)
        {
            msg = IOSMessage.Create("Player Authed ", "ID: " + GameCenterManager.Player.Id + "\n" + "Alias: " + GameCenterManager.Player.Alias);
            GameCenterManager.LoadLeaderboardInfo(TEST_LEADERBOARD_1);
        }
        else
        {
            msg = IOSMessage.Create("Game Center ", "Player authentication failed");
        }

        msg.OnComplete += delegate {
            _IsUILocked = false;
        };
    }
示例#19
0
    private void OnImage(IOSImagePickResult result)
    {
        if (result.IsSucceeded)
        {
            if (target.mainTexture != initialTexture)
            {
                DestroyImmediate(target.mainTexture, true);
            }
            target.mainTexture = result.Image;
            next.isEnabled     = true;

            //   IOSMessage.Create("Success", "Image Successfully Loaded, Image size: " + result.image.width + "x" + result.image.height);
        }
        else
        {
            IOSMessage.Create("Success", "Image Load Failed");
        }
        isTaking = false;
        IOSCamera.OnImagePicked -= OnImage;
    }
    private void OnNotificationScheduleResult(SA.Common.Models.Result res)
    {
        ISN_LocalNotificationsController.OnNotificationScheduleResult -= OnNotificationScheduleResult;



        string msg = string.Empty;

        if (res.IsSucceeded)
        {
            msg += "Notification was successfully scheduled\n allowed notifications types: \n";
        }
        else
        {
            msg += "Notification scheduling failed";
        }


        IOSMessage.Create("On Notification Schedule Result", msg);
    }
示例#21
0
        public Task StartAsync(CancellationToken cancellationToken)
        {
            //var msg = new Cloud.Xinge.AndriodMessage()
            //{
            //    message_type = Cloud.Xinge.message_type.notify,
            //    audience_type = Cloud.Xinge.audience_type.token_list,
            //    Title = "hi,andriod",
            //    Content = "hello,master"
            //};

            //msg.SetShowType(false);
            //msg.SetActionType(3);
            //msg.SetVibrate(false);
            //msg.SetTokenList(new List<string>() { "0301aa2b23b23e5c7f7184cc35fd711fc600" });
            //msg.SetIntent("http://m.sxkid.com");
            //var custom = new Dictionary<string, object>();
            //custom.Add("key", "value");
            //msg.SetCustomContent(custom);
            //pushService.Send(msg);



            var iosmsg = new IOSMessage()
            {
                message_type  = Cloud.Xinge.message_type.notify,
                audience_type = Cloud.Xinge.audience_type.token_list,
                Title         = "hi,ios",
                Content       = "hello,master",
            };

            iosmsg.SetBadge(-2);
            iosmsg.SetButtonTitles(new[] { "确定", "取消" });
            iosmsg.SetUrls(new[] { "http://m.sxkid.com" });
            iosmsg.SetTokenList(new List <string>()
            {
                "7a580b2676601294e025ea247e153f71594a2b9e66511b35817efd639be31ec6"
            });
            var result = pushService.Send(iosmsg).GetAwaiter().GetResult();

            return(Task.CompletedTask);
        }
示例#22
0
    private void ShowDevoceInfo()
    {
        ISN_Device device = ISN_Device.CurrentDevice;

        IOSMessage.Create("Device Info", "Name: " + device.Name + "\n"
                          + "System Name: " + device.SystemName + "\n"
                          + "Model: " + device.Model + "\n"
                          + "Localized Model: " + device.LocalizedModel + "\n"
                          + "System Version: " + device.SystemVersion + "\n"
                          + "Major System Version: " + device.MajorSystemVersion + "\n"
                          + "Preferred Language Code: " + device.PreferredLanguageCode + "\n"
                          + "Preferred Language_ISO639_1: " + device.PreferredLanguage_ISO639_1 + "\n"
                          + "User Interface Idiom: " + device.InterfaceIdiom + "\n"
                          + "GUID in Base64: " + device.GUID.Base64String);

        Debug.Log("ISN_TimeZone.LocalTimeZone.Name: " + ISN_TimeZone.LocalTimeZone.Name);
        Debug.Log("ISN_TimeZone.LocalTimeZone.SecondsFromGMT: " + ISN_TimeZone.LocalTimeZone.SecondsFromGMT);

        Debug.Log("ISN_TimeZone.LocalTimeZone.Name: " + ISN_Build.Current.Version);
        Debug.Log("ISN_TimeZone.LocalTimeZone.Name: " + ISN_Build.Current.Number);
    }
    //--------------------------------------
    // INITIALIZE
    //--------------------------------------


    void Awake()
    {
        ISN_LocalNotificationsController.OnLocalNotificationReceived += HandleOnLocalNotificationReceived;



        //Checking for a local launch notification
        if (ISN_LocalNotificationsController.Instance.LaunchNotification != null)
        {
            ISN_LocalNotification notification = ISN_LocalNotificationsController.Instance.LaunchNotification;

            IOSMessage.Create("Launch Notification", "Messgae: " + notification.Message + "\nNotification Data: " + notification.Data);
        }


        //Checking for a remote launch notification
        if (ISN_RemoteNotificationsController.Instance.LaunchNotification != null)
        {
            ISN_RemoteNotification notification = ISN_RemoteNotificationsController.Instance.LaunchNotification;

            IOSMessage.Create("Launch Remote Notification", "Body: " + notification.Body);
        }
    }
示例#24
0
    private void OnNotificationScheduleResult(ISN_Result res)
    {
        IOSNotificationController.instance.OnNotificationScheduleResult -= OnNotificationScheduleResult;



        string msg = string.Empty;

        if (res.IsSucceeded)
        {
            msg += "Notification was successfully scheduled\n allowed notifications types: \n";


            if ((IOSNotificationController.AllowedNotificationsType & IOSUIUserNotificationType.Alert) != 0)
            {
                msg += "Alert ";
            }

            if ((IOSNotificationController.AllowedNotificationsType & IOSUIUserNotificationType.Sound) != 0)
            {
                msg += "Sound ";
            }

            if ((IOSNotificationController.AllowedNotificationsType & IOSUIUserNotificationType.Badge) != 0)
            {
                msg += "Badge ";
            }
        }
        else
        {
            msg += "Notification scheduling failed";
        }


        IOSMessage.Create("On Notification Schedule Result", msg);
    }
    //--------------------------------------
    // INITIALIZE
    //--------------------------------------


    void Awake()
    {
        ISN_LocalNotificationsController.OnLocalNotificationReceived += HandleOnLocalNotificationReceived;



        NotificationCenter.OnWillPresentNotification += (NotificationRequest obj) => {
            Debug.Log("OnWillPresentNotification: " + obj.Content);
        };

        var launchNotification = NotificationCenter.LaunchNotification;

        if (launchNotification.Content != null)
        {
            IOSMessage.Create("Launch Notification", "Messgae: " + launchNotification.Content + "\nNotification ID: " + launchNotification.Id);
        }



        //Checking for a local launch notification
        if (ISN_LocalNotificationsController.Instance.LaunchNotification != null)
        {
            ISN_LocalNotification notification = ISN_LocalNotificationsController.Instance.LaunchNotification;

            IOSMessage.Create("Launch Notification", "Messgae: " + notification.Message + "\nNotification Data: " + notification.Data);
        }


        //Checking for a remote launch notification
        if (ISN_RemoteNotificationsController.Instance.LaunchNotification != null)
        {
            ISN_RemoteNotification notification = ISN_RemoteNotificationsController.Instance.LaunchNotification;

            IOSMessage.Create("Launch Remote Notification", "Body: " + notification.Body);
        }
    }
示例#26
0
    //--------------------------------------
    //  GET/SET
    //--------------------------------------


    //--------------------------------------
    //  Actions
    //--------------------------------------

    void HandleInterstitialAdDidFinishAction()
    {
        Debug.Log("OnInterstitialFinish action fired");
        IOSMessage.Create("Ad Event", "Ad Did Finish");
    }
    private void UrlNotFound(CEvent e)
    {
        string url = e.data as string;

        IOSMessage.Create("Url Exists", "The " + url + " wasn't registred");
    }
    private void UrlExcists(CEvent e)
    {
        string url = e.data as string;

        IOSMessage.Create("Url Exists", "The " + url + " is registred");
    }
示例#29
0
    void OnGUI()
    {
        UpdateToStartPos();


        GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "System Utils", style);

        //SA.IOSNative.

        StartY += YLableStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Check if FB App exists"))
        {
            bool result = SA.IOSNative.System.SharedApplication.CheckUrl("fb://");

            if (result)
            {
                IOSMessage.Create("Success", "Facebook App is installed on current device");
            }
            else
            {
                IOSMessage.Create("ERROR", "Facebook App is not installed on current device");
            }
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Open FB Profile"))
        {
            SA.IOSNative.System.SharedApplication.OpenUrl("fb://profile");
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Open App Store"))
        {
            SA.IOSNative.System.SharedApplication.OpenUrl("itms-apps://");
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Get IFA"))
        {
            IOSMessage.Create("Identifier Loaded", ISN_Device.CurrentDevice.AdvertisingIdentifier);
        }

        StartX  = XStartPos;
        StartY += YButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Set App Bages Count"))
        {
            IOSNativeUtility.SetApplicationBagesNumber(10);
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Clear Application Bages"))
        {
            IOSNativeUtility.SetApplicationBagesNumber(0);
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Show Device Info"))
        {
            ShowDevoceInfo();
        }


        StartX  = XStartPos;
        StartY += YButtonStep;
        StartY += YLableStep;

        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Pick Contacts UI"))
        {
            SA.IOSNative.Contacts.ContactStore.Instance.ShowContactsPickerUI((result) => {
                if (result.IsSucceeded)
                {
                    Debug.Log("Picked " + result.Contacts.Count + " contacts");
                    IOSMessage.Create("Success", "Picked " + result.Contacts.Count + " contacts");

                    foreach (var contact in result.Contacts)
                    {
                        Debug.Log("contact.GivenName: " + contact.GivenName);
                        if (contact.PhoneNumbers.Count > 0)
                        {
                            Debug.Log("contact.PhoneNumber: " + contact.PhoneNumbers[0].Digits);
                        }

                        if (contact.Emails.Count > 0)
                        {
                            Debug.Log("contact.Email: " + contact.Emails[0]);
                        }
                    }
                }
                else
                {
                    IOSMessage.Create("Error", result.Error.Code + " / " + result.Error.Message);
                }
            });
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Load Contacts"))
        {
            SA.IOSNative.Contacts.ContactStore.Instance.RetrievePhoneContacts((result) => {
                if (result.IsSucceeded)
                {
                    Debug.Log("Loaded " + result.Contacts.Count + " contacts");
                    IOSMessage.Create("Success", "Loaded " + result.Contacts.Count + " contacts");

                    foreach (var contact in result.Contacts)
                    {
                        if (contact.PhoneNumbers.Count > 0)
                        {
                            Debug.Log(contact.GivenName + " / " + contact.PhoneNumbers[0].Digits);
                        }
                    }
                }
                else
                {
                    IOSMessage.Create("Error", result.Error.Code + " / " + result.Error.Message);
                }
            });
        }



        StartX  = XStartPos;
        StartY += YButtonStep;
        StartY += YLableStep;



        GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Date Time Picker", style);

        StartY += YLableStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Time"))
        {
            IOSDateTimePicker.Instance.Show(IOSDateTimePickerMode.Time);
        }


        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Date"))
        {
            IOSDateTimePicker.Instance.Show(IOSDateTimePickerMode.Date);
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Date And Time"))
        {
            IOSDateTimePicker.Instance.Show(IOSDateTimePickerMode.DateAndTime);
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Countdown Timer"))
        {
            IOSDateTimePicker.Instance.Show(IOSDateTimePickerMode.CountdownTimer);
        }

        StartX  = XStartPos;
        StartY += YButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Set Date Without UI"))
        {
            IOSDateTimePicker.Instance.Show(IOSDateTimePickerMode.Date, time);
        }

        StartX  = XStartPos;
        StartY += YButtonStep;
        StartY += YLableStep;


        GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Video", style);

        StartY += YLableStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Player Streamed video"))
        {
            IOSVideoManager.Instance.PlayStreamingVideo("https://dl.dropboxusercontent.com/u/83133800/Important/Doosan/GT2100-Video.mov");
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Open YouTube Video"))
        {
            IOSVideoManager.Instance.OpenYouTubeVideo("xzCEdSKMkdU");
        }



        StartX  = XStartPos;
        StartY += YButtonStep;
        StartY += YLableStep;



        GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Camera Roll", style);

        StartY += YLableStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth + 10, buttonHeight), "Save Screenshot To Camera Roll"))
        {
            IOSCamera.OnImageSaved += OnImageSaved;
            IOSCamera.Instance.SaveScreenshotToCameraRoll();
        }


        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Save Texture To Camera Roll"))
        {
            IOSCamera.OnImageSaved += OnImageSaved;
            IOSCamera.Instance.SaveTextureToCameraRoll(hello_texture);
        }


        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Get Image From Camera"))
        {
            IOSCamera.OnImagePicked += OnImage;
            IOSCamera.Instance.PickImage(ISN_ImageSource.Camera);
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Get Image From Album"))
        {
            IOSCamera.OnImagePicked += OnImage;
            IOSCamera.Instance.PickImage(ISN_ImageSource.Album);
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Load Multiple Images"))
        {
            ISN_FilePicker.MediaPickFinished += delegate(ISN_FilePickerResult res) {
                Debug.Log("Picked " + res.PickedImages.Count + " images");

                if (res.PickedImages.Count == 0)
                {
                    return;
                }
                //destroying old texture
                Destroy(drawTexture);

                //applaying new texture
                drawTexture = res.PickedImages[0];
            };
            ISN_FilePicker.Instance.PickFromCameraRoll();
        }



        StartX  = XStartPos;
        StartY += YButtonStep;
        StartY += YLableStep;
        GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "PickedImage", style);
        StartY += YLableStep;

        if (drawTexture != null)
        {
            GUI.DrawTexture(new Rect(StartX, StartY, buttonWidth, buttonWidth), drawTexture);
        }
    }
 void OnAdvertisingIdentifierLoadedAction(string Identifier)
 {
     IOSMessage.Create("Identifier Loaded", Identifier);
 }