Class APNSMessage.Builder

  • Enclosing class:
    APNSMessage

    public static class APNSMessage.Builder
    extends java.lang.Object
    Builder of APNSMessage.
    • Method Detail

      • build

        @NonNull
        public APNSMessage build()
        Build and return APNSMessage.
      • enable

        @NonNull
        public APNSMessage.Builder enable​(boolean enabled)
        Set flag of APNS delivery. If omit calling this method, APNS delivery is enabled. If KiiPushMessage.Builder.enableAPNS(boolean) called after KiiPushMessage.Builder#withAPNSMessage(GCMMessage), This property would be overwritten. (The converse also overwrite the property.)
        Parameters:
        enabled - if true message would be delivered via APNS. If false, this message would not delivered thru APNS.
        Returns:
        Builder of the message
      • withSound

        @NonNull
        public APNSMessage.Builder withSound​(@Nullable
                                             java.lang.String sound)
        If provided, it will be used as the "sound" to be sent with the notification. Corresponding to APNS's "sound" in aps notification payload. For details please refer to APNS document
        Parameters:
        sound - The name of a sound file in the application bundle.
      • withBadge

        @NonNull
        public APNSMessage.Builder withBadge​(int badge)
        If provided, it will be used as the "badge" to be sent with the notification Corresponding to APNS's "badge" in aps notification payload. For details please refer to APNS document
        Parameters:
        badge - The number to display as the badge of the application icon.
      • withAlertActionLocKey

        @NonNull
        public APNSMessage.Builder withAlertActionLocKey​(@Nullable
                                                         java.lang.String actionLocKey)
        Build with alert action loc key. Corresponding to APNS's "action-loc-key" in apns.alert For details please refer to APNS document
        Parameters:
        actionLocKey - String that iOS uses as a key to get localized string in to use for alert "View" button.
        Returns:
        Builder instance.
      • withAlertLocKey

        @NonNull
        public APNSMessage.Builder withAlertLocKey​(@Nullable
                                                   java.lang.String locKey)
        Build with alert loc key. Corresponding to APNS's "action-loc-key" in apns.alert For details please refer to APNS document
        Parameters:
        locKey - String that used as a key to an alert-message string in a "localizable.strings" file for current localization.
        Returns:
        Builder instance.
      • withAlertLocArgs

        @NonNull
        public APNSMessage.Builder withAlertLocArgs​(@NonNull
                                                    java.lang.String[] locArgs)
        Build with alert locArgs. Corresponding to APNS's "loc-args" in apns.alert For details please refer to APNS document
        Parameters:
        locArgs - Variable string values to appear in place of the format specifiers in locKey.
        Returns:
        Builder instance
      • withAlertLaunchImage

        @NonNull
        public APNSMessage.Builder withAlertLaunchImage​(@Nullable
                                                        java.lang.String launchImage)
        Build with alert launch Image. Corresponding to APNS's "launch-image" in apns.alert For details please refer to APNS document
        Parameters:
        launchImage - The filename of an image file in the application bundle.
        Returns:
        Builder instance
      • withAlertTitle

        @NonNull
        public APNSMessage.Builder withAlertTitle​(@Nullable
                                                  java.lang.String title)
        Build with alert title. Corresponding to APNS's "title" in apns.alert
        Parameters:
        title - APNS alert title text.
        Returns:
        Builder instance
      • withAlertSubtitle

        @NonNull
        public APNSMessage.Builder withAlertSubtitle​(@Nullable
                                                     java.lang.String subtitle)
        Build with alert subtitle. Corresponding to APNS's "subtitle" in apns.alert
        Parameters:
        subtitle - APNS alert subtitle text.
        Returns:
        Builder instance
      • withContentAvailable

        @NonNull
        public APNSMessage.Builder withContentAvailable​(int contentAvailable)
        Build with content-available. Corresponding to APNs's "content-available" in apns. For details, please refer to APNS document
        Parameters:
        contentAvailable - APNs content-available field number. If 0, content-available payload is not delivered. Otherwise, content-available=1 payload is delivered.
        Returns:
        Builder instance
      • withCategory

        @NonNull
        public APNSMessage.Builder withCategory​(@Nullable
                                                java.lang.String category)
        Build with category. Corresponding to APNS's "category" in apns. For details, please refer to APNS document
        Parameters:
        category - APNs category field.
        Returns:
        Builder instance
      • withMutableContent

        @NonNull
        public APNSMessage.Builder withMutableContent​(int mutableContent)
        Build with mutable-content. Corresponding to APNS's "mutable-content" in apns.
        Parameters:
        mutableContent - APNs mutable-content value.
        Returns:
        Builder instance