Skip to content

Commit

Permalink
#847563: Update latest versions of widget, demo project, and test pro…
Browse files Browse the repository at this point in the history
…ject
  • Loading branch information
KevinVlaanderen committed Aug 8, 2016
1 parent c6d3055 commit 1cc89e0
Show file tree
Hide file tree
Showing 20 changed files with 146 additions and 8,904 deletions.
Binary file modified demo/PushNotifications-Example.mpr
Binary file not shown.
71 changes: 71 additions & 0 deletions demo/javasource/pushnotifications/actions/SendMessageToUser.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// This file was generated by Mendix Modeler.
//
// WARNING: Only the following code will be retained when actions are regenerated:
// - the import list
// - the code between BEGIN USER CODE and END USER CODE
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
// Other code you write will be lost the next time you deploy the project.
// Special characters, e.g., é, ö, à, etc. are supported in comments.

package pushnotifications.actions;

import com.mendix.systemwideinterfaces.core.IContext;
import com.mendix.webui.CustomJavaAction;
import com.mendix.systemwideinterfaces.core.IMendixObject;
import static pushnotifications.proxies.microflows.Microflows.createAndSendMessageToUser;

/**
* Java action to send a message directly to all devices of a user
* Parameters:
* Device: Android or iOS
* MessageText: the contents of the message
* Title: The title of the message
* Badge: a number that appears on the app icon (iOS)
* LaunchImage: file name of the launch image (iOS)
* Sound: name of system sound to play (iOS)
*
*/
public class SendMessageToUser extends CustomJavaAction<Boolean>
{
private IMendixObject __UserParameter1;
private system.proxies.User UserParameter1;
private String MessageText;
private String Title;
private Long Badge;
private String LaunchImage;
private String Sound;

public SendMessageToUser(IContext context, IMendixObject UserParameter1, String MessageText, String Title, Long Badge, String LaunchImage, String Sound)
{
super(context);
this.__UserParameter1 = UserParameter1;
this.MessageText = MessageText;
this.Title = Title;
this.Badge = Badge;
this.LaunchImage = LaunchImage;
this.Sound = Sound;
}

@Override
public Boolean executeAction() throws Exception
{
this.UserParameter1 = __UserParameter1 == null ? null : system.proxies.User.initialize(getContext(), __UserParameter1);

// BEGIN USER CODE
createAndSendMessageToUser(getContext(), UserParameter1, MessageText, Title, Badge, LaunchImage, Sound);
return true;
// END USER CODE
}

/**
* Returns a string representation of this action
*/
@Override
public String toString()
{
return "SendMessageToUser";
}

// BEGIN EXTRA CODE
// END EXTRA CODE
}
1 change: 1 addition & 0 deletions demo/javasource/system/UserActionsRegistrar.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ public void handleEvent(Event event)
component.actionRegistry().registerUserAction(pushnotifications.actions.SendGoogleMessages.class);
component.actionRegistry().registerUserAction(pushnotifications.actions.SendMessage.class);
component.actionRegistry().registerUserAction(pushnotifications.actions.SendMessagesInBackground.class);
component.actionRegistry().registerUserAction(pushnotifications.actions.SendMessageToUser.class);
component.actionRegistry().registerUserAction(pushnotifications.actions.StartAPN.class);
component.actionRegistry().registerUserAction(pushnotifications.actions.StartGCM.class);
component.actionRegistry().registerUserAction(pushnotifications.actions.StopAPN.class);
Expand Down
Binary file not shown.
Loading

0 comments on commit 1cc89e0

Please sign in to comment.