Reputation: 195
I am trying to implement push notification for windows phone using IBM MobileFirst Platform Foundation 6.3.
I downloaded the push notification sample application from the ibm developer page here, and installed it on my device. I am trying to use unauthenticated MPNS.
I am able to send the notification to an Android app by calling the adapter but not to windows app. the MobileFirst Console shows the number of messages sent but none of them are received.
do i need to submit my app in the windows developer console to use unauthenticated push notification
Below is the log from the visual studio.
'TaskHost.exe' (CoreCLR: DefaultDomain): Loaded 'C:\windows\system32\mscorlib.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Windows.RuntimeHost.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Windows.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Net.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'TaskHost.exe' (CoreCLR: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Xml.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Upvotes: 0
Views: 172
Reputation: 2681
MPNS notifications has 3 types -
1) raw
2) toast
3) tile
The application must be in foreground to handle raw notifications. Toast notifications are short, text-based messages that appear at the top of the phone's display. Tile notifications can modify the appearance of application tiles user has pinned to the Quick Launch area of their device.
The output JSON of WL.Server.createDefaultNotification() , contains a raw and tile payload and no toast payload. This is why you notice pushNotificationReceived() firing and see the push payload, when application is in foreground.
Since the default JSON does not contain a toast payload, you will NOT see a toast , when your application is in background. If you did have a tile pinned to your quick launch area, you should have seen the tile notification.
To get a toast notification modify the code slightly -
var notification = WL.Server.createDefaultNotification(notificationText, badgeDigit, {custom:"data"});
notification.MPNS.toast = {};
notification.MPNS.toast.text1 = "Toast title";
notification.MPNS.toast.text2 = "Toast content";
To see a tile notification , pin your application to the quick launch area , put the application to background and then try sending the notification.
API and output JSON details can be found here :
Upvotes: 2