void StartPresenceHeartbeat (bool pause, int pauseTime)
        {
            try {
                string channelsJsonState;
                int allNonPresenceChannelsOrChannelGroupsCount;
                string channels;
                string channelGroups;

                if (RunIndependentOfSubscribe){
                    channelsJsonState = State;
                    allNonPresenceChannelsOrChannelGroupsCount = ((ChannelGroups.Length>0)?ChannelGroups.Split(',').Count():0) + ((Channels.Length>0)?Channels.Split(',').Count():0);
                    #if (ENABLE_PUBNUB_LOGGING)                
                    this.PubNubInstance.PNLog.WriteToLog(string.Format ("allNonPresenceChannelsOrChannelGroupsCount: {0}", allNonPresenceChannelsOrChannelGroupsCount), PNLoggingMethod.LevelInfo);
                    #endif
                    channels = Channels;
                    channelGroups = ChannelGroups;
                } else {
                    channelsJsonState = PubNubInstance.SubscriptionInstance.CompiledUserState;
                    allNonPresenceChannelsOrChannelGroupsCount = PubNubInstance.SubscriptionInstance.AllNonPresenceChannelsOrChannelGroups.Count;
                    channels = Helpers.GetNamesFromChannelEntities(PubNubInstance.SubscriptionInstance.AllNonPresenceChannelsOrChannelGroups, false);
                    channelGroups = Helpers.GetNamesFromChannelEntities(PubNubInstance.SubscriptionInstance.AllNonPresenceChannelsOrChannelGroups, true);
                }

                if (allNonPresenceChannelsOrChannelGroupsCount > 0){
                    isPresenceHearbeatRunning = true;
                    Uri request = BuildRequests.BuildPresenceHeartbeatRequest(
                        channels,
                        channelGroups,
                        channelsJsonState,
                        this.PubNubInstance,
                        null
                    );

                    RequestState requestState = new RequestState ();
                    requestState.OperationType = PNOperationType.PNPresenceHeartbeatOperation;
                    requestState.URL = request.OriginalString; 
                    requestState.Timeout = PubNubInstance.PNConfig.NonSubscribeTimeout;
                    requestState.Pause = pauseTime;
                    requestState.Reconnect = pause;
                    
                    #if (ENABLE_PUBNUB_LOGGING)
                    this.PubNubInstance.PNLog.WriteToLog (string.Format ("presenceheartbeat: /presence/ request.OriginalString {0} ", request.OriginalString ), PNLoggingMethod.LevelError);
                    #endif

                    webRequestId = webRequest.Run(requestState);

                    #if (ENABLE_PUBNUB_LOGGING)
                    this.PubNubInstance.PNLog.WriteToLog (string.Format ("StartPresenceHeartbeat: PresenceHeartbeat running, {0} ", pauseTime), PNLoggingMethod.LevelInfo);
                    #endif
                } 
                #if (ENABLE_PUBNUB_LOGGING)
                else {
                    this.PubNubInstance.PNLog.WriteToLog (string.Format ("StartPresenceHeartbeat: AllNonPresenceChannelsOrChannelGroups < 0 "), PNLoggingMethod.LevelInfo);
                }
                #endif
            }
            catch (Exception ex) {
                #if (ENABLE_PUBNUB_LOGGING)
                this.PubNubInstance.PNLog.WriteToLog (string.Format ("StartPresenceHeartbeat: PresenceHeartbeat exception {0}", ex.ToString ()), PNLoggingMethod.LevelError);
                #endif
            }
        }