public Task UnsubscribeAsync(IEnumerable <string> channels, CancellationToken cancellationToken)
        {
            ParseInstallation installation = ParseInstallation.CurrentInstallation;

            installation.RemoveAllFromList("channels", channels);
            return(installation.SaveAsync(cancellationToken));
        }
        public Task SubscribeAsync(IEnumerable <string> channels, CancellationToken cancellationToken)
        {
            ParseInstallation installation = ParseInstallation.CurrentInstallation;

            installation.AddRangeUniqueToList("channels", channels);
            return(installation.SaveAsync(cancellationToken));
        }
        public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
        {
            ParseInstallation installation = ParseInstallation.CurrentInstallation;

            installation.SetDeviceTokenFromData(deviceToken);

            installation.SaveAsync();
        }
Пример #4
0
        public void Initialize()
        {
            // We can only set some values here since we can be sure that Initialize is always called
            // from main thread.
            appBuildVersion = Application.version;
            appName         = Application.productName;

            RegisterDeviceTokenRequest(deviceToken => {
                if (deviceToken == null)
                {
                    return;
                }

                ParseInstallation installation = ParseInstallation.CurrentInstallation;
                installation.SetDeviceTokenFromData(deviceToken);

                // Optimistically assume this will finish.
                installation.SaveAsync();
            });
        }