Android-sdk support of custom smart-text substitutions for push templates.
@@ -60,6 +60,7 @@ import java.util.Calendar;
import java.util.Collections;
import java.util.Date;
import java.util.List;
+import java.util.Map;
import java.util.UUID;
public final class Messaging
@@ -434,19 +435,29 @@ public final class Messaging
}
public MessageStatus pushWithTemplate( String templateName )
+ {
+ return this.pushWithTemplate( templateName, (Map<String, String>) null );
+ }
+
+ public MessageStatus pushWithTemplate( String templateName, Map<String, String> templateValues )
{
if( templateName == null )
throw new IllegalArgumentException( ExceptionMessage.NULL_EMPTY_TEMPLATE_NAME );
- return (MessageStatus) Invoker.invokeSync( MESSAGING_MANAGER_SERVER_ALIAS, "pushWithTemplate", new Object[] { templateName } );
+ return (MessageStatus) Invoker.invokeSync( MESSAGING_MANAGER_SERVER_ALIAS, "pushWithTemplate", new Object[] { templateName, templateValues } );
}
public void pushWithTemplate( String templateName, final AsyncCallback<MessageStatus> responder )
+ {
+ this.pushWithTemplate( templateName, null, responder );
+ }
+
+ public void pushWithTemplate( String templateName, Map<String, String> templateValues, final AsyncCallback<MessageStatus> responder )
{
if( templateName == null )
throw new IllegalArgumentException( ExceptionMessage.NULL_EMPTY_TEMPLATE_NAME );
- Invoker.invokeAsync( MESSAGING_MANAGER_SERVER_ALIAS, "pushWithTemplate", new Object[] { templateName }, responder );
+ Invoker.invokeAsync( MESSAGING_MANAGER_SERVER_ALIAS, "pushWithTemplate", new Object[] { templateName, templateValues }, responder );
}
public MessageStatus getMessageStatus( String messageId )
