<commit_before><?xml version = "1.0"?>
<?xml-stylesheet type="text/xsl" href="pb_help.xsl"?>
<API>
    <MODULE name="Push" parent="Rho">
        <HELP_OVERVIEW>The Push API provides access to Push messaging functionality</HELP_OVERVIEW>
        <MORE_HELP>Use this API to give application the ability to receive server initiated messages.</MORE_HELP>
        <PLATFORM>WM, Android, iOS, WP8</PLATFORM>
        <VER_INTRODUCED>4.0.0</VER_INTRODUCED>

        <TEMPLATES>
            <DEFAULT_INSTANCE/> <!-- object has default static property, all methods can be call by static way (called from default instance), produce default(), set_default() methods -->
            <PROPERTY_BAG/>
        </TEMPLATES>
        <PROPERTIES access="INSTANCE" generateAccessors="false">
            <DESC>These properties are used to configure the Push API.</DESC>

            <PROPERTY name="type" type="STRING" readOnly="true" generateAccessors="true">
               <DESC>Push engine type.</DESC>
                <VALUES>
                    <VALUE constName="PUSH_TYPE_RHOCONNECT" value="rhoconnect-push">
                        <DESC>RhoConnect push engine.</DESC>
                    </VALUE>
                    <VALUE constName="PUSH_TYPE_NATIVE" value="native-push">
                        <DESC>Native push engine (like GCM on Android).</DESC>
                    </VALUE>
                </VALUES>
            </PROPERTY>
            <PROPERTY name="deviceId" type="STRING" readOnly="true">
                <DESC>Push token used to identify particular device.</DESC>
            </PROPERTY>
            <PROPERTY name="userNotifyMode" type="STRING" default="backgroundNotifications" deprecated="true">
                <DESC>UI notification mode.</DESC>
                <PLATFORM>Android</PLATFORM>
                <VALUES>
                    <VALUE constName="PUSH_NOTIFY_NONE" value="none">
                        <DESC>Do not notify user about received push messages.</DESC>
                    </VALUE>
                    <VALUE constName="PUSH_NOTIFY_ALERTS" value="alert">
                        <DESC>Notify user with alerts inside of application UI only.</DESC>
                    </VALUE>
                    <VALUE constName="PUSH_NOTIFY_NOTIFICATIONS" value="notification">
                        <DESC>Notify user using notification bar.</DESC>
                    </VALUE>
                    <VALUE constName="PUSH_NOTIFY_NOTIFICATIONS_AND_ALERTS" value="backgroundNotifications">
                        <DESC>Notify user using notification bar if in background and with alerts in foreground.</DESC>
                    </VALUE>
                </VALUES>
            </PROPERTY>
            <PROPERTY name="senderId" type="STRING" readOnly="true">
                <PLATFORM>Android</PLATFORM>
                <DESC>Sender ID used to identify sender at GCM push server.</DESC>
            </PROPERTY>
            <PROPERTY name="pushServer" type="STRING" readOnly="true">
                <DESC>URL of RhoConnect Push server.</DESC>
            </PROPERTY>
            <PROPERTY name="pushAppName" type="STRING" readOnly="true">
                <DESC>Application name used by RhoConnect Push server to identify application.</DESC>
            </PROPERTY>
        </PROPERTIES>

        <METHODS>
            <METHOD name="enumerate" access="STATIC" hasCallback="optional">
                <DESC>Returns the push API objects configured within the application.</DESC>
                <RETURN type="ARRAY">
                    <DESC>Array of available push engines.</DESC>
                    <PARAM type="SELF_INSTANCE"/>
                </RETURN>
            </METHOD>
            <METHOD name="getDeviceId" access="INSTANCE" hasCallback="optional">
                <DESC>Returns push token used to identify particular device.</DESC>
                <RETURN type="STRING"/>
            </METHOD>
            <METHOD name="startNotifications" access="INSTANCE" hasCallback="mandatory" runInThread="none">
                <DESC>Start listening for push messages, errors or other push related events.</DESC>
                <CALLBACK type="HASH">
                    <DESC>Hash map with push message payload.</DESC>
                    <PARAMS>
                        <PARAM name="doSync" type="STRING">
                            <DESC>List of sources to sync separated by comma or 'all'.</DESC>
                        </PARAM>
                        <PARAM name="alertText" type="STRING">
                            <DESC>Alert message to show to user.</DESC>
                        </PARAM>
                        <PARAM name="vibrateDuration" type="INTEGER">
                            <DESC>Vibrate duration in milliseconds.</DESC>
                        </PARAM>
                        <PARAM name="alertSound" type="STRING">
                            <DESC>Path to sound file to play when push message is received.</DESC>
                        </PARAM>
                    </PARAMS>
                </CALLBACK>
            </METHOD>
            <METHOD name="stopNotifications" access="INSTANCE" hasCallback="none">
                <DESC>Stop listening push events.</DESC>
            </METHOD>
        </METHODS>

        <USER_OVERVIEW>
            <!--  More conversational style with INLINE SAMPLES, written in MarkDown -->
            <![CDATA[

            ]]>

        </USER_OVERVIEW>
        <EXAMPLES >
            <EXAMPLE title="Handle push message">
                <SECTIONS>
                    <SECTION>
                        <DESC>Start push nofification service and define alert popup window in push callback method.</DESC>
                        <CODE>
                            <RUBY>
                                <![CDATA[
def setup_push
  # Start listening for push messages. Parameter is an url to push_callback method
  Rho::Push.startNotifications(url_for(:action=>:push_callback))
end

<commit_msg>Correct access type for push methods<commit_after><?xml version = "1.0"?>
<?xml-stylesheet type="text/xsl" href="pb_help.xsl"?>
<API>
    <MODULE name="Push" parent="Rho">
        <HELP_OVERVIEW>The Push API provides access to Push messaging functionality</HELP_OVERVIEW>
        <MORE_HELP>Use this API to give application the ability to receive server initiated messages.</MORE_HELP>
        <PLATFORM>WM, Android, iOS, WP8</PLATFORM>
        <VER_INTRODUCED>4.0.0</VER_INTRODUCED>

        <TEMPLATES>
            <DEFAULT_INSTANCE/> <!-- object has default static property, all methods can be call by static way (called from default instance), produce default(), set_default() methods -->
            <PROPERTY_BAG/>
        </TEMPLATES>
        <PROPERTIES access="INSTANCE" generateAccessors="false">
            <DESC>These properties are used to configure the Push API.</DESC>

            <PROPERTY name="type" type="STRING" readOnly="true" generateAccessors="true">
               <DESC>Push engine type.</DESC>
                <VALUES>
                    <VALUE constName="PUSH_TYPE_RHOCONNECT" value="rhoconnect-push">
                        <DESC>RhoConnect push engine.</DESC>
                    </VALUE>
                    <VALUE constName="PUSH_TYPE_NATIVE" value="native-push">
                        <DESC>Native push engine (like GCM on Android).</DESC>
                    </VALUE>
                </VALUES>
            </PROPERTY>
            <PROPERTY name="deviceId" type="STRING" readOnly="true">
                <DESC>Push token used to identify particular device.</DESC>
            </PROPERTY>
            <PROPERTY name="userNotifyMode" type="STRING" default="backgroundNotifications" deprecated="true">
                <DESC>UI notification mode.</DESC>
                <PLATFORM>Android</PLATFORM>
                <VALUES>
                    <VALUE constName="PUSH_NOTIFY_NONE" value="none">
                        <DESC>Do not notify user about received push messages.</DESC>
                    </VALUE>
                    <VALUE constName="PUSH_NOTIFY_ALERTS" value="alert">
                        <DESC>Notify user with alerts inside of application UI only.</DESC>
                    </VALUE>
                    <VALUE constName="PUSH_NOTIFY_NOTIFICATIONS" value="notification">
                        <DESC>Notify user using notification bar.</DESC>
                    </VALUE>
                    <VALUE constName="PUSH_NOTIFY_NOTIFICATIONS_AND_ALERTS" value="backgroundNotifications">
                        <DESC>Notify user using notification bar if in background and with alerts in foreground.</DESC>
                    </VALUE>
                </VALUES>
            </PROPERTY>
            <PROPERTY name="senderId" type="STRING" readOnly="true">
                <PLATFORM>Android</PLATFORM>
                <DESC>Sender ID used to identify sender at GCM push server.</DESC>
            </PROPERTY>
            <PROPERTY name="pushServer" type="STRING" readOnly="true">
                <DESC>URL of RhoConnect Push server.</DESC>
            </PROPERTY>
            <PROPERTY name="pushAppName" type="STRING" readOnly="true">
                <DESC>Application name used by RhoConnect Push server to identify application.</DESC>
            </PROPERTY>
        </PROPERTIES>

        <METHODS>
            <METHOD name="enumerate" access="STATIC" hasCallback="optional">
                <DESC>Returns the push API objects configured within the application.</DESC>
                <RETURN type="ARRAY">
                    <DESC>Array of available push engines.</DESC>
                    <PARAM type="SELF_INSTANCE"/>
                </RETURN>
            </METHOD>
            <METHOD name="getDeviceId" access="STATIC" hasCallback="optional">
                <DESC>Returns push token used to identify particular device.</DESC>
                <RETURN type="STRING"/>
            </METHOD>
            <METHOD name="startNotifications" access="STATIC" hasCallback="mandatory" runInThread="none">
                <DESC>Start listening for push messages, errors or other push related events.</DESC>
                <CALLBACK type="HASH">
                    <DESC>Hash map with push message payload.</DESC>
                    <PARAMS>
                        <PARAM name="doSync" type="STRING">
                            <DESC>List of sources to sync separated by comma or 'all'.</DESC>
                        </PARAM>
                        <PARAM name="alertText" type="STRING">
                            <DESC>Alert message to show to user.</DESC>
                        </PARAM>
                        <PARAM name="vibrateDuration" type="INTEGER">
                            <DESC>Vibrate duration in milliseconds.</DESC>
                        </PARAM>
                        <PARAM name="alertSound" type="STRING">
                            <DESC>Path to sound file to play when push message is received.</DESC>
                        </PARAM>
                    </PARAMS>
                </CALLBACK>
            </METHOD>
            <METHOD name="stopNotifications" access="STATIC" hasCallback="none">
                <DESC>Stop listening push events.</DESC>
            </METHOD>
        </METHODS>

        <USER_OVERVIEW>
            <!--  More conversational style with INLINE SAMPLES, written in MarkDown -->
            <![CDATA[

            ]]>

        </USER_OVERVIEW>
        <EXAMPLES >
            <EXAMPLE title="Handle push message">
                <SECTIONS>
                    <SECTION>
                        <DESC>Start push nofification service and define alert popup window in push callback method.</DESC>
                        <CODE>
                            <RUBY>
                                <![CDATA[
def setup_push
  # Start listening for push messages. Parameter is an url to push_callback method
  Rho::Push.startNotifications(url_for(:action=>:push_callback))
end


{'fraction_non_alphanumeric': 0.10342230775667308, 'fraction_numerical': 0.0010041000753075056, 'mean_word_length': 1.6870503597122302, 'pattern_counts': {'":': 0, '<': 275, '<?xml version=': 0, '>': 275, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7467364', 'n_tokens_mistral': 2966, 'n_tokens_neox': 2813, 'n_words': 797}