I created example to test Push notification:
public class TestService implements IBackendlessService {
public MessageStatus testPush() {
List<String> devices = new ArrayList();
devices.add("08379B2D-D724-4166-917D-D41B1E55F17A");
DeliveryOptions deliveryOptions = new DeliveryOptions();
deliveryOptions.setPushSinglecast(devices);
deliveryOptions.setPublishPolicy(PublishPolicyEnum.PUSH);
PublishOptions publishOptions = new PublishOptions();
Map<String, String> headers = new HashMap<String, String>();
headers.put(PublishOptions.IOS_TITLE_TAG, "Title");
headers.put(PublishOptions.IOS_SUBTITLE_TAG, "SubTitle");
publishOptions.setHeaders(headers);
MessageStatus status = Backendless.Messaging.publish( "Test Message", publishOptions, deliveryOptions);
return status;
}
}
It works, I’ve got push on my iPhone.
Next I want to create afterPublish event handler, so I did:
I’ve run CodeRunner.sh, but breakpoint doesn’t work. (breakpoint on other place of code works fine). I think handler doesn’t executed…
I’ve tried to to create event handler for User:
public class GenericUserEventHandler extends com.backendless.servercode.extension.UserExtender
{
@Override
public void beforeUpdate( RunnerContext context, HashMap userValues ) throws Exception
{
System.out.println("DDDD");
}
}
It doesn’t work also…
Application ID
F20A5DDC-36F3-5EFA-FF8E-C4FFCB5AA300