Windows 8.1 and Windows 10 push To enable PUSH-notifications you will have to perform the following actions: Add the application to your space in devtodev system Activate Windows Messaging Service ang get SID and Client Secret values Add SID and Client Secret to the application integration settings in devtodev system. Integrate devtodev SDK to the application (see the "SDK integration" section to learn more how to integrate and initialize devtodev SDK) Add several lines of the code to switch on the push-notification in the SDK Create a campaign for sending push-notifications in "Push" section How to get SID and Client Secret 1. Go to the application settings in your Windows Store dashboard 2. Open Push Notifications submenu in Services menu Last update 05.05.2016 1
3. Go to Live Services site: 4. "Package SID" and "Client secret" will be your SID and Client Secret strings respectively Last update 05.05.2016 2
Implementation to app 1. Integrate devtodev SDK to your project. Even if you don't need devtodev analytics in your app, you should call DevToDev.SDK.Initialize(string appkey, string appsecret), DevToDev.SDK.OnActivate() and DevToDev.SDK.OnDeactivate() functions. Read more how to do it in Chapters 1.2 and 2.1 of the manual. 2. Add the following source after DevToDev.SDK.Initialize(string appkey, string appsecret) is called: DevToDev.PushManager.PushTokenReceived = (pushtoken) => { //pushtoken - the string contains the push token }; DevToDev.PushManager.PushTokenFailed = (error) => { //error - the error string. This function will be called when push token have not been obtained. }; DevToDev.PushManager.PushReceived = (PushType type, IDictionary<string, string> params) => { //type - type of the push message //params - IDictionary<string, string> with the custom user parameters form the push message }; DevToDev.PushManager.Initialize(); The PushType can have one of the following values: public enum PushType { ToastNotification, RawNotification } 3. Put the following source in your Application class (usually it is App.xaml.cs file) at the end of the OnLaunched(LaunchActivatedEventArgs e) function. For Example: protected override void OnLaunched(LaunchActivatedEventArgs e) { //...other source DevToDev.PushManager.HandleToastNavigation(e); } 4. Attention! This SDK could be integrated with Windows/Windows Phone 8.1 and Windows 10 projects. If you app is used on Windows/Windows Phone 8.1 devices, don't forget to add the "Toast capable" flag in your Package.appmanifest. Last update 05.05.2016 3
5. Keep in mind that your application must be built with the same Windows Store preferences you used in Chapter 3.2. In the "Create App Packages" window you have to log in with your Live ID and pick the appropriate application form the list. A file Package.StoreAssociation.xml will be added into the Project. Last update 05.05.2016 4
Changing the application settings in devtodev system 1. Proceed to Settings of your app. 2. Go to Integration page and insert the previously received Package SID and Client secret to appropriate fields in Push notifications section. 3. If the Package SID and Client secret are correct, you will see the following result Last update 05.05.2016 5
Creating a new push-notification in devtodev interface 1. Open PUSH tag and click on Create push or ADD NEW PUSH button. 2. Fill in campaign name, select an app for delivery. Attention! You can create a campaign only after at least one push token comes from devtodev SDK integrated to your application. Otherwise the app will not be displayed in the list. Last update 05.05.2016 6
3. Choose the user group to send a message. You can choose existing segment or create a new one. 4. Enter toast or tile details a. Toast Last update 05.05.2016 7
b. Tile 5. Schedule the delivery Last update 05.05.2016 8
6. Thats it! Last update 05.05.2016 9