|
|
|
|
|
Change By:
|
Nikita Konev
|
|
Steps to Reproduce:
|
I trying to send PUSH'es on WinPhine WinPhone via https://github.com/aerogear/java-mpns.git All works fine, until i disconnect winphone from internet. Then MS Push Notification Service will responce DISCONNECTED, but tjis this item not present in enum MpnsResponse -> method Utilities.logicalResponseFor() returns null that cause NPE.
Here is code: public class MainMPNS2 { public static void main(String... args) { MpnsService service = MPNS.newService().delegate(new MpnsDelegate() { public void messageSent(MpnsNotification message, MpnsResponse response) { System.out.println("Message successfully sended " + message + " with responce " + response); }
public void messageFailed(MpnsNotification message, MpnsResponse response) { System.out.println("Fail on sending message " + message + " with responce " + response); } }).build();
ToastNotification notification = MPNS.newNotification().toast().title("title").subtitle("subtitle").parameter("/MainPage.xaml?action=promo&guid=0b30b696-a39c-432e-99fa-02359c788ebb").build();
String cloudId = "http://s.notify.live.net/u/1/our_private_url"; // per app service.push(cloudId, notification); } }
Here is stacktrace: Exception in thread "main" java.lang.NullPointerException at org.jboss.aerogear.windows.mpns.internal.Utilities.fireDelegate(Utilities.java:146) at org.jboss.aerogear.windows.mpns.internal.MpnsServiceImpl.push(MpnsServiceImpl.java:45) at org.jboss.aerogear.windows.mpns.internal.AbstractMpnsService.push(AbstractMpnsService.java:53) at MainMPNS2.main(MainMPNS2.java:27) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
|
|
|
|
|
|