Package com.kii.cloud.storage
Class APNSMessage.Builder
- java.lang.Object
-
- com.kii.cloud.storage.APNSMessage.Builder
-
- Enclosing class:
- APNSMessage
public static class APNSMessage.Builder extends java.lang.Object
Builder of APNSMessage.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description APNSMessage
build()
Build and return APNSMessage.APNSMessage.Builder
enable(boolean enabled)
Set flag of APNS delivery.APNSMessage.Builder
withAlertActionLocKey(java.lang.String actionLocKey)
Build with alert action loc key.APNSMessage.Builder
withAlertBody(java.lang.String body)
Build with alert body message.APNSMessage.Builder
withAlertLaunchImage(java.lang.String launchImage)
Build with alert launch Image.APNSMessage.Builder
withAlertLocArgs(java.lang.String[] locArgs)
Build with alert locArgs.APNSMessage.Builder
withAlertLocKey(java.lang.String locKey)
Build with alert loc key.APNSMessage.Builder
withAlertSubtitle(java.lang.String subtitle)
Build with alert subtitle.APNSMessage.Builder
withAlertTitle(java.lang.String title)
Build with alert title.APNSMessage.Builder
withAPNSData(APNSMessage.APNSData data)
Create builder with Data that will be sent only to iOS-APNS devices.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.APNSMessage.Builder
withCategory(java.lang.String category)
Build with category.APNSMessage.Builder
withContentAvailable(int contentAvailable)
Build with content-available.APNSMessage.Builder
withMutableContent(int mutableContent)
Build with mutable-content.APNSMessage.Builder
withSound(java.lang.String sound)
If provided, it will be used as the "sound" to be sent with the notification.
-
-
-
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. IfKiiPushMessage.Builder.enableAPNS(boolean)
called afterKiiPushMessage.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
-
withAPNSData
@NonNull public APNSMessage.Builder withAPNSData(@Nullable APNSMessage.APNSData data)
Create builder with Data that will be sent only to iOS-APNS devices. Corresponding to APNS's custom payload. For details please refer to APNS document The data specified here will be merged with the data specified onKiiPushMessage.buildWith(Data)
.- Parameters:
data
-KiiPushMessage.Data
APNS specific data.
-
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
-
withAlertBody
@NonNull public APNSMessage.Builder withAlertBody(@Nullable java.lang.String body)
Build with alert body message. Corresponding to APNS's "body" in apns.alert For details please refer to APNS document- Parameters:
body
- APNS alert message text.- 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
-
-