/// POST OneSignal 'Update Player' (device)
        /// https://onesignal.com/api/v1/players/:id
        /// 
        public async Task<string> UpdateDevice(DeviceEdit device)
        {
            string json = JsonUtil<DeviceEdit>.ToJson(device);
            string api = string.Format("api/v1/players/{0}", device.Id);
            string result = await OneSignalAPIPut(api, json);

            return result;
        }
Example #2
0
        public void CreateDeviceJson()
        {
            DeviceEdit device = new DeviceEdit();
            device.Id = "acc48677-5845-45b3-b9cc-e6544215f0c8";
            device.Tags = new Dictionary<string, string>();
            device.Tags.Add("OrgID", "CCPASTA47");

            try
            {
                string json = JsonUtil<DeviceEdit>.ToJson(device);
                Console.WriteLine(json);
            }
            catch (Exception ex)
            { Console.WriteLine(ex.ToString()); }
        }
Example #3
0
        protected async Task UpdatePlayer()
        {
            DeviceEdit device = new DeviceEdit();
            device.Id = "acc48677-5845-45b3-b9cc-e6544215f0c8";
            device.Tags = new Dictionary<string, string>();
            device.Tags.Add("OrgID", "CCPASTA47");

            try
            {
                Push pushNotifier = new Push();
                string result = await pushNotifier.UpdateDevice(device);
                Console.WriteLine(result);
            }
            catch (Exception ex)
            { Console.WriteLine(ex.ToString()); }
        }