Push Notification helps you in sending event or alert to your App users even when they are not logged into App. App42 uses MPNS( Microsoft Push Notification Service) to send Push Notification on WP devices. Windows Phone provides three types of notifications
- Toast Notification
- Live Tile Notification
- Raw Notification
App42 currently supports Toast notification for Windows Phone.
- Register with App42 platform.
- Go to the dashboard and click on the Create App button.
- Fill all the mandatory fields and get your APIKey and SecretKey.
- Download App42 Windows Phone sample app and unzip it on your machine .
- Open this Sample App in your Microsoft Visual Studio 2010 Express for Windows Phone.
- Edit MainPage.xaml.cs file and put your APIKey and SecretKey (which were received in step#2 & #3) as shown below and also modify userId variable with your App user name .
- Build and Run Sample App.
- Go to AppHQ Console , Select Push Notification Tab.
- Select your service and click user tab.
- Check user name to send message.
- Click on send Message and write your message to be sent.
- Click on send button.
ServiceAPI sp = new ServiceAPI("Your APIKey","Your SecretKey");
PushNotificationService pushObj = sp.BuildPushNotificationService();
String userId = "Your User";
You can send message to App user using any App42 SDK (C#/Java/Android/Windows Phone/JS etc). Here is a snippet to send message to user from Windows Phone SDK.
void SendMessageToUser()
{
string userName = "AppUser";
string title = "Hi";
string subTitle = "Shashank";
string paramsToPass = "TestPage.xaml";
// Send Message to specific User.
pushObj.SendPushToastMessageToUser(userId , title, subTitle, paramsToPass, this);
}
For more details about other Push Notification functionalities see our documentation.
If you have any questions or need any further assistance to integrate this in your App, please feel free to write us at support@shephertz.com
Leave A Reply